If OpenGL has already been inited, it won't be inited a second time now.
This commit is contained in:
parent
bea0b2c795
commit
a78eba5604
|
@ -7,6 +7,8 @@
|
|||
|
||||
extern WINCLASS *MainWindow;
|
||||
|
||||
static bool oglAlreadyInit = false;
|
||||
|
||||
int CheckHardwareSupport(HDC hdc)
|
||||
{
|
||||
int PixelFormat = GetPixelFormat(hdc);
|
||||
|
@ -33,6 +35,8 @@ bool windows_opengl_init()
|
|||
int res;
|
||||
char *opengl_modes[3]={"software","half hardware (MCD driver)","hardware"};
|
||||
|
||||
if(oglAlreadyInit == true) return true;
|
||||
|
||||
oglDC = GetDC (MainWindow->getHWnd());
|
||||
|
||||
memset(&pfd,0, sizeof(PIXELFORMATDESCRIPTOR));
|
||||
|
@ -66,5 +70,7 @@ bool windows_opengl_init()
|
|||
else
|
||||
LOG("OpenGL mode: uknown\n");
|
||||
|
||||
oglAlreadyInit = true;
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Reference in New Issue