Skip to content

Commit

Permalink
glState: Also track the scissor test state.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 3, 2016
1 parent 50ae457 commit ed77133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Layers/xrRenderGL/glState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ void glState::Apply()

CHK_GL(glDepthMask(m_pDepthStencilState.DepthWriteMask ? GL_TRUE : GL_FALSE));

if (m_pRasterizerState.ScissorEnable)
glEnable(GL_SCISSOR_TEST);
else
glDisable(GL_SCISSOR_TEST);

if (m_pBlendState.BlendEnable)
glEnable(GL_BLEND);
else
Expand Down Expand Up @@ -99,6 +104,10 @@ void glState::UpdateRenderState(u32 name, u32 value)
m_pRasterizerState.CullMode = (D3DCULL)value;
break;

case D3DRS_SCISSORTESTENABLE:
m_pRasterizerState.ScissorEnable = value;
break;

case D3DRS_ZENABLE:
m_pDepthStencilState.DepthEnable = value ? TRUE : FALSE;
break;
Expand Down
1 change: 1 addition & 0 deletions src/Layers/xrRenderGL/glState.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
typedef struct
{
D3DCULL CullMode;
BOOL ScissorEnable;
} D3D_RASTERIZER_STATE;

typedef struct
Expand Down

0 comments on commit ed77133

Please sign in to comment.