Windows Port: Fix OpenGL renderer init failure. (Regression from commit 76fe5f7
. Fixes #810.)
This commit is contained in:
parent
241ca96cf1
commit
de62116cc8
|
@ -98,7 +98,7 @@ static HGLRC main_hRC;
|
||||||
static HDC main_hDC;
|
static HDC main_hDC;
|
||||||
static HWND main_hWND;
|
static HWND main_hWND;
|
||||||
|
|
||||||
static bool _begin()
|
static bool wgl_beginOpenGL()
|
||||||
{
|
{
|
||||||
//wglMakeCurrent is slow in some environments. so, check if the desired context is already current
|
//wglMakeCurrent is slow in some environments. so, check if the desired context is already current
|
||||||
if(wglGetCurrentContext() == main_hRC)
|
if(wglGetCurrentContext() == main_hRC)
|
||||||
|
@ -110,6 +110,11 @@ static bool _begin()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool wgl_endOpenGL()
|
||||||
|
{
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
|
|
||||||
static bool makeBootstrapContext()
|
static bool makeBootstrapContext()
|
||||||
{
|
{
|
||||||
//not sure how relevant all this is, since it is just a context for bootstrapping, but we may as well make it as normal as we can, just to be safe
|
//not sure how relevant all this is, since it is just a context for bootstrapping, but we may as well make it as normal as we can, just to be safe
|
||||||
|
@ -227,10 +232,10 @@ bool windows_opengl_init()
|
||||||
main_hDC = hdc;
|
main_hDC = hdc;
|
||||||
main_hRC = hGlRc;
|
main_hRC = hGlRc;
|
||||||
oglAlreadyInit = true;
|
oglAlreadyInit = true;
|
||||||
oglrender_beginOpenGL = _begin;
|
oglrender_beginOpenGL = &wgl_beginOpenGL;
|
||||||
|
oglrender_endOpenGL = &wgl_endOpenGL;
|
||||||
//use the new pbuffer context for further extension interrogation in shared opengl init
|
//use the new pbuffer context for further extension interrogation in shared opengl init
|
||||||
_begin();
|
wgl_beginOpenGL();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue