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:
rogerman 2024-07-22 22:47:29 -07:00
parent 8e77a8d9f1
commit f323dc464f
3 changed files with 9 additions and 8 deletions

View File

@ -1955,8 +1955,9 @@ int _main()
// 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
//(can't say I really blame them)

View File

@ -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
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 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
if(wglGetCurrentContext() == main_hRC)
@ -110,7 +110,7 @@ static bool wgl_beginOpenGL()
return true;
}
static void wgl_endOpenGL()
void wgl_endOpenGL()
{
// Do nothing.
}
@ -232,8 +232,6 @@ bool windows_opengl_init()
main_hDC = hdc;
main_hRC = hGlRc;
oglAlreadyInit = true;
oglrender_beginOpenGL = &wgl_beginOpenGL;
oglrender_endOpenGL = &wgl_endOpenGL;
//use the new pbuffer context for further extension interrogation in shared opengl init
wgl_beginOpenGL();

View File

@ -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
it under the terms of the GNU General Public License as published by
@ -19,3 +19,5 @@
bool windows_opengl_init();
bool initContext(HWND hwnd, HGLRC *hRC);
bool wgl_beginOpenGL();
void wgl_endOpenGL();