summaryrefslogtreecommitdiff
path: root/c++/window-opengl/gl_xcb.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2023-08-11 03:03:09 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2023-08-11 03:03:09 +0200
commit9b5ca88b97c3a00153946920ae52870c452fb4a1 (patch)
tree2bb1584448414f2cc127f9d79428ccef96df1de3 /c++/window-opengl/gl_xcb.cpp
parentac0096ca16e5aee2ce58a40a30dd1f033369efdb (diff)
c++,window-opengl: Fixing comp issues
Diffstat (limited to 'c++/window-opengl/gl_xcb.cpp')
-rw-r--r--c++/window-opengl/gl_xcb.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/c++/window-opengl/gl_xcb.cpp b/c++/window-opengl/gl_xcb.cpp
index f93e9a9..18ce1cf 100644
--- a/c++/window-opengl/gl_xcb.cpp
+++ b/c++/window-opengl/gl_xcb.cpp
@@ -27,8 +27,8 @@ glx_library_extensions load_glx_library_extensions(const char* extension_string)
GLXContext (*glXCreateContextAttribsARB)(Display*, GLXFBConfig, GLXContext, Bool, const int*) = nullptr;
if(find != extensions.end()){
glXCreateContextAttribsARB = reinterpret_cast<GLXContext(*)(
- Display*, GLXConfig, GLXContext, Bool, const int*)>(
- glxGetProcAddress(reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB")));
+ Display*, GLXFBConfig, GLXContext, Bool, const int*)>(
+ glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB")));
}
return {extensions_view, glXCreateContextAttribsARB};
@@ -45,15 +45,15 @@ int translate_render_type_settings(gl_settings::render_type cmp){
int translate_drawable_type_setting(gl_settings::drawable_type cmp){
int i = 0;
if (static_cast<int32_t>(cmp) &
- static_cast<int32_t>(GlSettings::DrawableType::windowBit)) {
+ static_cast<int32_t>(gl_settings::drawable_type::window_bit)) {
i |= static_cast<int32_t>(GLX_WINDOW_BIT);
}
if (static_cast<int32_t>(cmp) &
- static_cast<int32_t>(GlSettings::DrawableType::PixMapBit)) {
+ static_cast<int32_t>(gl_settings::drawable_type::pixmap_bit)) {
i |= static_cast<int32_t>(GLX_PIXMAP_BIT);
}
if (static_cast<int32_t>(cmp) &
- static_cast<int32_t>(GlSettings::DrawableType::PBufferBit)) {
+ static_cast<int32_t>(gl_settings::drawable_type::pbuffer_bit)) {
i |= static_cast<int32_t>(GLX_PBUFFER_BIT);
}
return i;
@@ -61,16 +61,16 @@ int translate_drawable_type_setting(gl_settings::drawable_type cmp){
}
gl_context<gl::backend::linux_xcb>::gl_context(const glx_library_extensions& ext_lib,
- own<device<backend::linux_xcb>> dev, int visual_id, GLXContext context, GLXFBConfig fb_config): ext_lib_{ext_lib}, device_{std::move(device)}, visual_id_{visual_id}, context_{context}, fb_config_{fb_config}{}
+ own<device<backend::linux_xcb>> dev, int visual_id, GLXContext context, GLXFBConfig fb_config): ext_lib_{ext_lib}, device_{std::move(dev)}, visual_id_{visual_id}, context_{context}, fb_config_{fb_config}{}
gl_context<gl::backend::linux_xcb>::~gl_context(){
assert(device_);
- assert(device_->display_);
+ assert(device_->get_xcb_display());
if(context_){
/// @todo Check if this context is bound and only unbind if that is the case
- // ::glXMakeContextCurrent(device_->display_, None, None, nullptr);
- ::glXMakeDestroyContext(device_->display_, context_);
+ // ::glXMakeContextCurrent(device_->get_xcb_display(), None, None, nullptr);
+ ::glXMakeDestroyContext(device_->get_xcb_display(), context_);
}
device_->flush();
}
@@ -86,7 +86,7 @@ own<gl_window<gl::backnd::linux_xcb>> gl_context<gl::backend::linux_xcb>::create
return nullptr;
}
- ::GLXWindow glx_win = glXCreateWindow(device_->display_, fb_config_, win->xcb_window_, nullptr);
+ ::GLXWindow glx_win = glXCreateWindow(device_->get_xcb_display(), fb_config_, win->xcb_window_, nullptr);
return heap<gl_window<gl::backend::linux_xcb>>(std::move(win), *this, glx_win);
}
@@ -199,15 +199,15 @@ gl_window<gl::backend::linux_xcb>::gl_window(own<xcb_window> &&win, gl_context<g
gl_window<gl::backend::linux_xcb>::~gl_window() {
assert(context.device);
if (context.device) {
- ::glXDestroyWindow(context_->device_->display, glx_window_);
+ ::glXDestroyWindow(context_->device_->get_xcb_display(), glx_window_);
}
}
void gl_window<gl::backend::linux_xcb>::bind() {
- assert(window_ && context_->device && context_->device_->display);
+ assert(window_ && context_->device && context_->device_->get_xcb_display());
if (window) {
- if (context_->device_ && context_->device_->display) {
- ::glXMakeContextCurrent(context_->device_->display, glx_window_,
+ if (context_->device_ && context_->device_->get_xcb_display()) {
+ ::glXMakeContextCurrent(context_->device_->get_xcb_display(), glx_window_,
glx_window_, context_->context);
}
}
@@ -229,9 +229,9 @@ void gl_window<gl::backend::linux_xcb>::hide() {
void gl_window<gl::backend::linux_xcb>::swap() {
assert(context_->device_);
- assert(context_->device_->display);
- if (context_->device && context_->device_->display) {
- ::glXSwapBuffers(context_->device_->display, glx_window_);
+ assert(context_->device_->get_xcb_display());
+ if (context_->device && context_->device_->get_xcb_display()) {
+ ::glXSwapBuffers(context_->device_->get_xcb_display(), glx_window_);
}
}