Skip to content

Commit

Permalink
bbb
Browse files Browse the repository at this point in the history
  • Loading branch information
Nivaturimika committed Jul 12, 2024
1 parent 64dfe7d commit 82e256b
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions src/graphics/opengl_wrapper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ void create_opengl_context(sys::state& state) {
window::emit_error_message("WGL_ARB_create_context not supported", true);
}

// Explicitly request for OpenGL 4.2
static const int attribs_4_2[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
// Explicitly request for OpenGL 3.3
static const int attribs_3_3[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 3,
WGL_CONTEXT_FLAGS_ARB,
#ifndef NDEBUG
WGL_CONTEXT_DEBUG_BIT_ARB |
Expand All @@ -54,25 +54,9 @@ void create_opengl_context(sys::state& state) {
WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
state.open_gl.context = wglCreateContextAttribsARB(window_dc, nullptr, attribs_4_2);
state.open_gl.context = wglCreateContextAttribsARB(window_dc, nullptr, attribs_3_3);
if(state.open_gl.context == nullptr) {
static const int attribs_3_3[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 3,
WGL_CONTEXT_FLAGS_ARB,
#ifndef NDEBUG
WGL_CONTEXT_DEBUG_BIT_ARB |
#endif
0,
WGL_CONTEXT_PROFILE_MASK_ARB,
WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
0
};
state.open_gl.context = wglCreateContextAttribsARB(window_dc, nullptr, attribs_3_3);
state.open_gl.legacy_mode = true;
if(state.open_gl.context == nullptr) {
window::emit_error_message("Unable to create WGL context", true);
}
window::emit_error_message("Unable to create WGL context", true);
}

wglMakeCurrent(window_dc, HGLRC(state.open_gl.context));
Expand Down

0 comments on commit 82e256b

Please sign in to comment.