示例#1
0
/*
** GLimp_EndFrame
** 
** Responsible for doing a swapbuffers and possibly for other stuff
** as yet to be determined.  Probably better not to make this a GLimp
** function and instead do a call to GLimp_SwapBuffers.
*/
void GLimp_EndFrame (void)
{
  // don't flip if drawing to front buffer
  if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
  {
    qglXSwapBuffers(dpy, win);
  }
}
示例#2
0
/*
** GLimp_EndFrame
**
** Responsible for doing a swapbuffers and possibly for other stuff
** as yet to be determined.  Probably better not to make this a GLimp
** function and instead do a call to GLimp_SwapBuffers.
*/
void GLimp_EndFrame( void ) {
	// don't flip if drawing to front buffer
	if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) {
		qglXSwapBuffers( dpy, win );
	}

	// check logging
	QGL_EnableLogging( (qboolean)r_logFile->integer ); // bk001205 - was ->value
}
示例#3
0
void VID_Finish (void)
{
	vid_usevsync = vid_vsync.integer && !cls.timedemo && qglXSwapIntervalSGI;
	switch(vid.renderpath)
	{
		case RENDERPATH_SOFT:
			if(vidx11_shmevent >= 0) {
				vidx11_ximage_pos = !vidx11_ximage_pos;
				vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data;
				DPSOFTRAST_SetRenderTargets(vid.width, vid.height, vid.softdepthpixels, vid.softpixels, NULL, NULL, NULL);

				// save mouse motion so we can deal with it later
				in_mouse_x = 0;
				in_mouse_y = 0;
				while(vidx11_shmwait)
					HandleEvents();
				in_mouse_x_save += in_mouse_x;
				in_mouse_y_save += in_mouse_y;
				in_mouse_x = 0;
				in_mouse_y = 0;

				++vidx11_shmwait;
				XShmPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[!vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height, True);
			} else {
				// no buffer switching here, we just flush the renderer
				DPSOFTRAST_Finish();
				XPutImage(vidx11_display, win, vidx11_gc, vidx11_ximage[vidx11_ximage_pos], 0, 0, 0, 0, vid.width, vid.height);
			}
			break;

		case RENDERPATH_GL11:
		case RENDERPATH_GL13:
		case RENDERPATH_GL20:
		case RENDERPATH_GLES1:
		case RENDERPATH_GLES2:
			if (vid_usingvsync != vid_usevsync)
			{
				vid_usingvsync = vid_usevsync;
				if (qglXSwapIntervalSGI && qglXSwapIntervalSGI (vid_usevsync))
					Con_Print("glXSwapIntervalSGI didn't accept the vid_vsync change, it will take effect on next vid_restart (GLX_SGI_swap_control does not allow turning off vsync)\n");
			}

			if (!vid_hidden)
			{
				CHECKGLERROR
				if (r_speeds.integer == 2 || gl_finish.integer)
					GL_Finish();
				qglXSwapBuffers(vidx11_display, win);CHECKGLERROR
			}
			break;

		case RENDERPATH_D3D9:
		case RENDERPATH_D3D10:
		case RENDERPATH_D3D11:
			break;
	}
示例#4
0
/*
** GLimp_EndFrame
**
** Responsible for doing a swapbuffers and possibly for other stuff
** as yet to be determined.  Probably better not to make this a GLimp
** function and instead do a call to GLimp_SwapBuffers.
*/
void GLimp_EndFrame( void ) {
	// don't flip if drawing to front buffer
	#ifdef HAVE_GLES
	eglSwapBuffers(g_EGLDisplay, g_EGLWindowSurface);
	#else
	if ( Q_stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) {
		qglXSwapBuffers( dpy, win );
	}

	// check logging
	QGL_EnableLogging( (qboolean)r_logFile->integer ); // bk001205 - was ->value
	#endif
}
示例#5
0
/*
** GLimp_EndFrame
** 
** Responsible for doing a swapbuffers and possibly for other stuff
** as yet to be determined.  Probably better not to make this a GLimp
** function and instead do a call to GLimp_SwapBuffers.
*/
void GLimp_EndFrame (void)
{
#if 0
	int	err;

	if ( !glState.finishCalled )
		qglFinish();

	// check for errors
	if ( !gl_ignore_errors->value ) {
		if ( ( err = qglGetError() ) != GL_NO_ERROR )
		{
			ri.Error( ERR_FATAL, "GLimp_EndFrame() - glGetError() failed (0x%x)!\n", err );
		}
	}
#endif

	// don't flip if drawing to front buffer
	if ( stricmp( r_drawBuffer->string, "GL_FRONT" ) != 0 )
	{
		qglXSwapBuffers(dpy, win);
	}

	// check logging
	QGL_EnableLogging( r_logFile->value );

#if 0
	GLimp_LogComment( "*** RE_EndFrame ***\n" );

	// decrement log
	if ( gl_log->value )
	{
		ri.Cvar_Set( "gl_log", va("%i",gl_log->value - 1 ) );
	}
#endif
}
示例#6
0
void GLimp_SwapBuffers()
{
    assert( dpy );
    qglXSwapBuffers( dpy, win );
}