MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateRenderTargetViewport

Method UpdateRenderTargetViewport

trinity/Shader/Tr2EffectStateManager.cpp:1193–1219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1191}
1192
1193void Tr2EffectStateManager::UpdateRenderTargetViewport( unsigned width, unsigned height )
1194{
1195 CCP_ASSERT( width > 0 );
1196 CCP_ASSERT( height > 0 );
1197
1198 // Keep record of the render target's width and height. This is used when
1199 // checking whether the viewport extends beyond the render target or not.
1200 m_renderTargetWidth = width;
1201 m_renderTargetHeight = height;
1202
1203 // Reset the viewport
1204 m_viewportOnDevice.m_x = 0;
1205 m_viewportOnDevice.m_y = 0;
1206 m_viewportOnDevice.m_height = (float)height;
1207 m_viewportOnDevice.m_width = (float)width;
1208 m_viewport.height = height;
1209 m_viewport.width = width;
1210 m_viewport.x = 0;
1211 m_viewport.y = 0;
1212 m_viewport.minZ = m_viewportOnDevice.m_minZ = 0.0f;
1213 m_viewport.maxZ = m_viewportOnDevice.m_maxZ = 1.0f;
1214
1215 m_viewportSizeVar = Vector4( m_viewportOnDevice.m_width, m_viewportOnDevice.m_height, (float)m_renderTargetWidth, (float)m_renderTargetHeight );
1216
1217 // Reset the projection adjustment
1218 //m_viewport2projectionAdjustment = IdentityMatrix();
1219}
1220
1221void Tr2EffectStateManager::SetupViewport()
1222{

Calls 1

Vector4Class · 0.50

Tested by

no test coverage detected