Windows Port: Fix bug where the OpenGL 3D renderer would fail to initialize at program startup. (Regression from commit 76fe5f7
. Fixes #815.)
This commit is contained in:
parent
8e77a8d9f1
commit
f323dc464f
|
@ -1955,8 +1955,9 @@ int _main()
|
||||||
|
|
||||||
// struct configured_features my_config;
|
// struct configured_features my_config;
|
||||||
|
|
||||||
oglrender_init = windows_opengl_init;
|
oglrender_init = &windows_opengl_init;
|
||||||
|
oglrender_beginOpenGL = &wgl_beginOpenGL;
|
||||||
|
oglrender_endOpenGL = &wgl_endOpenGL;
|
||||||
|
|
||||||
//try and detect this for users who don't specify it on the commandline
|
//try and detect this for users who don't specify it on the commandline
|
||||||
//(can't say I really blame them)
|
//(can't say I really blame them)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2006-2016 DeSmuME team
|
Copyright (C) 2006-2024 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -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 wgl_beginOpenGL()
|
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,7 +110,7 @@ static bool wgl_beginOpenGL()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wgl_endOpenGL()
|
void wgl_endOpenGL()
|
||||||
{
|
{
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
@ -232,8 +232,6 @@ bool windows_opengl_init()
|
||||||
main_hDC = hdc;
|
main_hDC = hdc;
|
||||||
main_hRC = hGlRc;
|
main_hRC = hGlRc;
|
||||||
oglAlreadyInit = true;
|
oglAlreadyInit = true;
|
||||||
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
|
||||||
wgl_beginOpenGL();
|
wgl_beginOpenGL();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
Copyright (C) 2013 DeSmuME team
|
Copyright (C) 2013-2024 DeSmuME team
|
||||||
|
|
||||||
This file is free software: you can redistribute it and/or modify
|
This file is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -19,3 +19,5 @@
|
||||||
|
|
||||||
bool windows_opengl_init();
|
bool windows_opengl_init();
|
||||||
bool initContext(HWND hwnd, HGLRC *hRC);
|
bool initContext(HWND hwnd, HGLRC *hRC);
|
||||||
|
bool wgl_beginOpenGL();
|
||||||
|
void wgl_endOpenGL();
|
||||||
|
|
Loading…
Reference in New Issue