void MonitorEx::OnIconify( void ) {
	if ( modified ) {
		iconified = true;
		SetDefaultMode( fsWindow );
		RestoreGamma();
	}
}
示例#2
0
void AppActivate(bool active)
{
	if (active)
	{
		SetForegroundWindow(gl_hWnd);
		ShowWindow(gl_hWnd, SW_RESTORE);
		if (FullscreenApp)
		{
			ActivateGLcontext();
			SetWindowPos(gl_hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOZORDER);
		}
		// update gamma
#if 0
		UpdateGamma();				// immediately --> bugs with ATI
#else
		r_gamma->modified = true;	// later
#endif
	}
	else
	{
		if (FullscreenApp)
		{
			ShowWindow(gl_hWnd, SW_MINIMIZE);
			DeactivateGLcontext();
		}
		RestoreGamma();
	}
}
示例#3
0
void GLimp_Shutdown(bool complete)
{
	RestoreGamma();

	appPrintf("Performing GL shutdown\n");
	DestoryGLcontext();
	if (gl_hDC)
	{
		if (!ReleaseDC(gl_hWnd, gl_hDC))
			ErrFail("ReleaseDC()");
		gl_hDC = NULL;
	}

	Vid_DestroyWindow(true); //?? (gl_bitdepth->modified);
	gl_hWnd = NULL;

	if (gl_config.fullscreen)
	{
		if (complete)
		{
			Com_DPrintf("...restore display mode\n");
			MSGLOG(("CDS(NULL)\n"));
			ChangeDisplaySettings(NULL, 0);
		}
		gl_config.fullscreen = false;
	}
}
示例#4
0
文件: refresh.c 项目: smcv/yquake2
/*
 * Shuts the SDL render backend down
 */
void
GLimp_Shutdown(void)
{
	/* Clear the backbuffer and make it
	   current. This may help some broken
	   video drivers like the AMD Catalyst
	   to avoid artifacts in unused screen
	   areas. */
	if (SDL_WasInit(SDL_INIT_VIDEO))
	{
		glClearColor(0.0, 0.0, 0.0, 0.0);
		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
		GLimp_EndFrame();
	}

#ifdef X11GAMMA
	RestoreGamma();
#endif

	if (window)
	{
		/* cleanly ungrab input (needs window) */
		GLimp_GrabInput(false);

#if SDL_VERSION_ATLEAST(2, 0, 0)
		if(context)
		{
			SDL_GL_DeleteContext(context);
			context = NULL;
		}

		SDL_DestroyWindow(window);
#else
		SDL_FreeSurface(window);
#endif
	}

	window = NULL;

	if (SDL_WasInit(SDL_INIT_EVERYTHING) == SDL_INIT_VIDEO)
	{
		SDL_Quit();
	}
	else
	{
		SDL_QuitSubSystem(SDL_INIT_VIDEO);
	}

	gl_state.hwgamma = false;
}