From 9b5ca88b97c3a00153946920ae52870c452fb4a1 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 11 Aug 2023 03:03:09 +0200 Subject: c++,window-opengl: Fixing comp issues --- c++/window-opengl/gl_xcb.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'c++/window-opengl/gl_xcb.cpp') 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( - glxGetProcAddress(reinterpret_cast("glXCreateContextAttribsARB"))); + Display*, GLXFBConfig, GLXContext, Bool, const int*)>( + glXGetProcAddress(reinterpret_cast("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(cmp) & - static_cast(GlSettings::DrawableType::windowBit)) { + static_cast(gl_settings::drawable_type::window_bit)) { i |= static_cast(GLX_WINDOW_BIT); } if (static_cast(cmp) & - static_cast(GlSettings::DrawableType::PixMapBit)) { + static_cast(gl_settings::drawable_type::pixmap_bit)) { i |= static_cast(GLX_PIXMAP_BIT); } if (static_cast(cmp) & - static_cast(GlSettings::DrawableType::PBufferBit)) { + static_cast(gl_settings::drawable_type::pbuffer_bit)) { i |= static_cast(GLX_PBUFFER_BIT); } return i; @@ -61,16 +61,16 @@ int translate_drawable_type_setting(gl_settings::drawable_type cmp){ } gl_context::gl_context(const glx_library_extensions& ext_lib, - own> 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> 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_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_context::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>(std::move(win), *this, glx_win); } @@ -199,15 +199,15 @@ gl_window::gl_window(own &&win, gl_context::~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::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::hide() { void gl_window::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_); } } -- cgit v1.2.3