diff --git a/neo/renderer/RenderSystem.cpp b/neo/renderer/RenderSystem.cpp index 1ef4792c..70c27603 100644 --- a/neo/renderer/RenderSystem.cpp +++ b/neo/renderer/RenderSystem.cpp @@ -705,7 +705,7 @@ EndFrame Returns the number of msec spent in the back end ============= */ -void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec ) { +void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec, bool swapBuffer) { emptyCommand_t *cmd; if ( !glConfig.isInitialized ) { @@ -734,8 +734,11 @@ void idRenderSystemLocal::EndFrame( int *frontEndMsec, int *backEndMsec ) { GL_CheckErrors(); // add the swapbuffers command - cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) ); - cmd->commandId = RC_SWAP_BUFFERS; + if (swapBuffer) + { + cmd = (emptyCommand_t*)R_GetCommandBuffer(sizeof(*cmd)); + cmd->commandId = RC_SWAP_BUFFERS; + } // start the back end up again with the new command list R_IssueRenderCommands(); diff --git a/neo/renderer/RenderSystem.h b/neo/renderer/RenderSystem.h index f91a3c68..a7a06898 100644 --- a/neo/renderer/RenderSystem.h +++ b/neo/renderer/RenderSystem.h @@ -235,7 +235,7 @@ public: virtual void BeginFrame( int windowWidth, int windowHeight ) = 0; // if the pointers are not NULL, timing info will be returned - virtual void EndFrame( int *frontEndMsec, int *backEndMsec ) = 0; + virtual void EndFrame( int *frontEndMsec, int *backEndMsec, bool swapBuffer = true) = 0; // aviDemo uses this. // Will automatically tile render large screen shots if necessary diff --git a/neo/renderer/tr_local.h b/neo/renderer/tr_local.h index e59991bf..585ad7eb 100644 --- a/neo/renderer/tr_local.h +++ b/neo/renderer/tr_local.h @@ -719,7 +719,7 @@ public: virtual void WriteDemoPics(); virtual void DrawDemoPics(); virtual void BeginFrame( int windowWidth, int windowHeight ); - virtual void EndFrame( int *frontEndMsec, int *backEndMsec ); + virtual void EndFrame( int *frontEndMsec, int *backEndMsec, bool swapBuffer = true ); virtual void TakeScreenshot( int width, int height, const char *fileName, int downSample, renderView_t *ref ); virtual void CropRenderSize( int width, int height, bool makePowerOfTwo = false, bool forceDimensions = false ); virtual void CaptureRenderToImage( const char *imageName ); diff --git a/neo/tools/radiant/CamWnd.cpp b/neo/tools/radiant/CamWnd.cpp index 842710d3..0e4b969c 100644 --- a/neo/tools/radiant/CamWnd.cpp +++ b/neo/tools/radiant/CamWnd.cpp @@ -198,9 +198,10 @@ void CCamWnd::OnPaint() { CPaintDC dc(this); // device context for painting bool bPaint = true; + UpdateCaption(); + idGraphicsDeviceContextHelper context(dc.m_hDC, hglrc); - QE_CheckOpenGLForErrors(); g_pSplitList = NULL; if (g_bClipMode) { if (g_Clip1.Set() && g_Clip2.Set()) { @@ -209,7 +210,6 @@ void CCamWnd::OnPaint() { } Cam_Draw(); - QE_CheckOpenGLForErrors(); } /* @@ -961,6 +961,7 @@ void CCamWnd::Cam_Draw() { Cam_Render(); } + glViewport(0, 0, m_Camera.width, m_Camera.height); glScissor(0, 0, m_Camera.width, m_Camera.height); glClearColor(g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][0], g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][1], g_qeglobals.d_savedinfo.colors[COLOR_CAMERABACK][2], 0); @@ -1789,7 +1790,6 @@ void CCamWnd::BuildRendererState() { //common->Printf("Render data used %d brushes\n", numBrushes); worldDirty = false; - UpdateCaption(); } /* @@ -2096,7 +2096,7 @@ void CCamWnd::Cam_Render() { int frontEnd, backEnd; - renderSystem->EndFrame( &frontEnd, &backEnd ); + renderSystem->EndFrame( &frontEnd, &backEnd, false ); //common->Printf( "front:%i back:%i\n", frontEnd, backEnd ); //glPopAttrib();