| 988 | } |
| 989 | |
| 990 | void GFXGLDevice::_updateRenderTargets() |
| 991 | { |
| 992 | if ( mRTDirty || mCurrentRT->isPendingState() ) |
| 993 | { |
| 994 | if ( mRTDeactivate ) |
| 995 | { |
| 996 | mRTDeactivate->deactivate(); |
| 997 | mRTDeactivate = NULL; |
| 998 | } |
| 999 | |
| 1000 | // NOTE: The render target changes is not really accurate |
| 1001 | // as the GFXTextureTarget supports MRT internally. So when |
| 1002 | // we activate a GFXTarget it could result in multiple calls |
| 1003 | // to SetRenderTarget on the actual device. |
| 1004 | mDeviceStatistics.mRenderTargetChanges++; |
| 1005 | |
| 1006 | GFXGLTextureTarget *tex = dynamic_cast<GFXGLTextureTarget*>( mCurrentRT.getPointer() ); |
| 1007 | if ( tex ) |
| 1008 | { |
| 1009 | tex->applyState(); |
| 1010 | tex->makeActive(); |
| 1011 | } |
| 1012 | else |
| 1013 | { |
| 1014 | GFXGLWindowTarget *win = dynamic_cast<GFXGLWindowTarget*>( mCurrentRT.getPointer() ); |
| 1015 | AssertFatal( win != NULL, |
| 1016 | "GFXGLDevice::_updateRenderTargets() - invalid target subclass passed!" ); |
| 1017 | |
| 1018 | win->makeActive(); |
| 1019 | |
| 1020 | if( win->mContext != static_cast<GFXGLDevice*>(GFX)->mContext ) |
| 1021 | { |
| 1022 | mRTDirty = false; |
| 1023 | GFX->updateStates(true); |
| 1024 | } |
| 1025 | } |
| 1026 | |
| 1027 | mRTDirty = false; |
| 1028 | } |
| 1029 | |
| 1030 | if ( mViewportDirty ) |
| 1031 | { |
| 1032 | glViewport( mViewport.point.x, mViewport.point.y, mViewport.extent.x, mViewport.extent.y ); |
| 1033 | mViewportDirty = false; |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | GFXFormat GFXGLDevice::selectSupportedFormat( GFXTextureProfile* profile, |
| 1038 | const Vector<GFXFormat>& formats, |
nothing calls this directly
no test coverage detected