void VideoEngine::PopState() { // Restore the most recent context information and pop it from stack if(_context_stack.empty()) { IF_PRINT_WARNING(VIDEO_DEBUG) << "no video states were saved on the stack" << std::endl; return; } _current_context = _context_stack.top(); _context_stack.pop(); // Restore the modelview transformation glMatrixMode(GL_MODELVIEW); PopMatrix(); glViewport(_current_context.viewport.left, _current_context.viewport.top, _current_context.viewport.width, _current_context.viewport.height); if(_current_context.scissoring_enabled) { EnableScissoring(); glScissor(static_cast<GLint>((_current_context.scissor_rectangle.left / static_cast<float>(VIDEO_STANDARD_RES_WIDTH)) * _current_context.viewport.width), static_cast<GLint>((_current_context.scissor_rectangle.top / static_cast<float>(VIDEO_STANDARD_RES_HEIGHT)) * _current_context.viewport.height), static_cast<GLsizei>((_current_context.scissor_rectangle.width / static_cast<float>(VIDEO_STANDARD_RES_WIDTH)) * _current_context.viewport.width), static_cast<GLsizei>((_current_context.scissor_rectangle.height / static_cast<float>(VIDEO_STANDARD_RES_HEIGHT)) * _current_context.viewport.height) ); } else { DisableScissoring(); } }
void dx10StateManager::SetRasterizerState(ID3DRasterizerState* pRState) { m_bRSChanged = false; m_bRDInvalid = true; if (pRState != m_pRState) { m_pRState = pRState; m_bRSNeedApply = true; } if (m_bOverrideScissoring) EnableScissoring(m_bOverrideScissoringValue); }
void dx10StateManager::OverrideScissoring(bool bOverride, BOOL bValue) { m_bOverrideScissoring = bOverride; m_bOverrideScissoringValue = bValue; if (m_bOverrideScissoring) EnableScissoring(m_bOverrideScissoringValue); else { if (m_bRSChanged) { D3D_RASTERIZER_DESC tmpDesc; if (m_pRState) m_pRState->GetDesc(&tmpDesc); else dx10StateUtils::ResetDescription(tmpDesc); m_RDesc.ScissorEnable = tmpDesc.ScissorEnable; } } }