diff --git a/dlib/platform.d b/dlib/platform.d index 2afaa32..b84e170 100644 --- a/dlib/platform.d +++ b/dlib/platform.d @@ -614,6 +614,10 @@ struct PlatformWindow TicketMut cb_mut; Selection[CBM.max] selections; version(linux) u32 cb_transfer_size; + static if(__traits(compiles, { GLXContext context; })) + { + GLXContext glx_context; + } }; struct Library @@ -833,15 +837,15 @@ CreateWindow( None, ]; - GLXContext context = glXCreateContextAttribsARB(window.display, chosen_fb_config, null, True, context_attributes.ptr); + window.glx_context = glXCreateContextAttribsARB(window.display, chosen_fb_config, null, True, context_attributes.ptr); - if(!context) + if(!window.glx_context) { Errf("Failed to create OpenGL context"); return false; } - glXMakeCurrent(window.display, window.window, context); + glXMakeCurrent(window.display, window.window, window.glx_context); GLLoadFuncs(); }