move glx context into platform window
This commit is contained in:
parent
9f2b7d84dc
commit
c7454e4695
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user