X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=vid_wgl.c;h=fed809b0213e54ab80464d69ffe83b00f98a6fc8;hb=455faeb1bee79f41a289ae5ccd4c064cf5945233;hp=85343a9ed69b96b0ad8cf2e479aaa08b615f8736;hpb=f0759ed4221a432267e456d6862000cd55775504;p=xonotic%2Fdarkplaces.git diff --git a/vid_wgl.c b/vid_wgl.c index 85343a9e..fed809b0 100644 --- a/vid_wgl.c +++ b/vid_wgl.c @@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "resource.h" #include +// Tell startup code that we have a client +int cl_available = true; + int (WINAPI *qwglChoosePixelFormat)(HDC, CONST PIXELFORMATDESCRIPTOR *); int (WINAPI *qwglDescribePixelFormat)(HDC, int, UINT, LPPIXELFORMATDESCRIPTOR); //int (WINAPI *qwglGetPixelFormat)(HDC); @@ -748,6 +751,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp) HGLRC baseRC; int CenterX, CenterY; const char *gldrivername; + int depth; if (vid_initialized) Sys_Error("VID_InitMode called when video is already initialised\n"); @@ -799,6 +803,7 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp) { hdc = GetDC (NULL); i = GetDeviceCaps(hdc, RASTERCAPS); + depth = GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL); ReleaseDC (NULL, hdc); if (i & RC_PALETTE) { @@ -806,6 +811,12 @@ int VID_InitMode (int fullscreen, int width, int height, int bpp) Con_Printf ("Can't run in non-RGB mode\n"); return false; } + if (bpp > depth) + { + VID_Shutdown(); + Con_Printf ("A higher desktop depth is required to run this video mode\n"); + return false; + } WindowStyle = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; ExWindowStyle = 0;