Skip to content

Commit 2a050ca

Browse files
authored
Minor Improvements to Win32 GL Init (#568)
1 parent a448348 commit 2a050ca

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

source/renderer/platform/ogl/Extensions.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44

55
using namespace mce::Platform;
66

7-
const char* OGL::ERROR_MSG = "Error initializing GL extensions. OpenGL 1.5 or later is required. Update your graphics drivers!";
7+
#ifdef FEATURE_GFX_SHADERS
8+
#define MIN_GL_VERSION "2.0"
9+
#define ERROR_MSG_EXTRA " Try switching to a non-shader build, or update your graphics drivers!"
10+
#else
11+
#define MIN_GL_VERSION "1.5"
12+
#define ERROR_MSG_EXTRA " Update your graphics drivers!"
13+
#endif
14+
15+
const char* OGL::ERROR_MSG = "Error initializing GL extensions. OpenGL " MIN_GL_VERSION " or later is required." ERROR_MSG_EXTRA;
816

917
bool OGL::InitBindings()
1018
{
@@ -26,7 +34,7 @@ void* OGL::GetProcAddress(const char* name)
2634
result = (void*)wglGetProcAddress(name);
2735
if (result == nullptr)
2836
{
29-
HMODULE handle = GetModuleHandle("opengl32.dll");
37+
static HMODULE handle = GetModuleHandle("opengl32.dll");
3038
if (handle != NULL)
3139
{
3240
result = (void*)GetProcAddress(handle, name);

0 commit comments

Comments
 (0)