Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
halldorfannar authored Feb 16, 2017
1 parent ea4de81 commit bed30b0
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
Nothing to see here. This is used for all kinds of experimentation and temporary work.

```cpp
void offset_game_projection_matrices(float offsetX, float offsetY)
enum CaptureType
{
// In this simple example we only need to modify the projection matrix associated with the game camera.
// If the game is doing clever things like optimizing reflections or shadows based on projection matrix
// then those code paths need to take a non-zero projection offset into account.
kCaptureType360Mono = 0,
kCaptureType360Stereo,
kCaptureTypeSuperResolution,
kCaptureTypeStereo
};

// For nostalgia effect this game is using an old classic:
D3DXMATRIX projection;
D3DXMatrixPerspectiveFovRH(&projection, g_fov_radians, g_aspect, g_z_near, g_z_far)

// Apply the offsets directly to the finished product (values are already normalized):
projection._31 += offsetX;
projection._32 += offsetY;
struct CaptureConfiguration
{
CaptureType captureType;
};

// Update the games projection matrix:
g_projection_matrix = projection;
}
typedef void(*StartCaptureCallback)(const CaptureConfiguration&, void* userPointer);
typedef void(*StopCaptureCallback)(void* userPointer);
```

0 comments on commit bed30b0

Please sign in to comment.