From baad21805adde570729b67e2c320f22ddab9e439 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 19 Sep 2023 16:07:18 +0200 Subject: window,window-opengl: Renaming to gpu_* --- 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 41c262a..5babaf2 100644 --- a/c++/window-opengl/gl_xcb.cpp +++ b/c++/window-opengl/gl_xcb.cpp @@ -60,10 +60,10 @@ int translate_drawable_type_setting(gl_settings::drawable_type cmp){ } } -gl_context::gl_context(const glx_library_extensions& ext_lib, +gpu_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(dev)}, visual_id_{visual_id}, context_{context}, fb_config_{fb_config}{} -gl_context::~gl_context(){ +gpu_context::~gl_context(){ assert(device_); assert(device_->get_xcb_display()); @@ -75,7 +75,7 @@ gl_context::~gl_context(){ device_->flush(); } -own> gl_context::create_window(const video_mode& vid_mode, std::string_view title_view){ +own> gpu_context::create_window(const video_mode& vid_mode, std::string_view title_view){ SAW_ASSERT(device_){ return nullptr; @@ -87,17 +87,17 @@ own> gl_context::creat } ::GLXWindow glx_win = glXCreateWindow(device_->get_xcb_display(), fb_config_, win->get_xcb_window_handle(), nullptr); - return heap>(std::move(win), *this, glx_win); + return heap>(std::move(win), *this, glx_win); } -void gl_context::flush(){ +void gpu_context::flush(){ assert(device_); if(device_){ device_->flush(); } } -own > create_gl_context(io_provider& prov, const gl_settings& settings){ +own > create_gl_context(io_provider& prov, const gl_settings& settings){ own> device = create_xcb_device(prov); if (!device) { return nullptr; @@ -185,25 +185,25 @@ own > create_gl_context(io_provider& prov, co int visual_id = 0; glXGetFBConfigAttrib(device->display, fb_config, GLX_VISUAL_ID, &visual_id); - return heap(lib_ext, std::move(device), visual_id, + return heap(lib_ext, std::move(device), visual_id, context, fb_config); } return nullptr; } -gl_window::gl_window(own &&win, gl_context &ctx, +gpu_window::gpu_window(own &&win, gpu_context &ctx, ::GLXWindow glx_win) : window_{std::move(win)}, context_{&ctx}, glx_window_handle_{glx_win} {} -gl_window::~gl_window() { +gpu_window::~gpu_window() { assert(context.device); if (context.device) { ::glXDestroyWindow(context_->device_->get_xcb_display(), glx_window_); } } -void gl_window::bind() { +void gpu_window::bind() { assert(window_ && context_->device && context_->device_->get_xcb_display()); if (window) { if (context_->device_ && context_->device_->get_xcb_display()) { @@ -213,21 +213,21 @@ void gl_window::bind() { } } -void gl_window::show() { +void gpu_window::show() { assert(window_); if (window_) { window->show(); } } -void gl_window::hide() { +void gpu_window::hide() { assert(window_); if (window_) { window->hide(); } } -void gl_window::swap() { +void gpu_window::swap() { assert(context_->device_); assert(context_->device_->get_xcb_display()); if (context_->device && context_->device_->get_xcb_display()) { @@ -235,12 +235,12 @@ void gl_window::swap() { } } -const video_mode &gl_window::get_video_mode() const { +const video_mode &gpu_window::get_video_mode() const { assert(window_); return window_->get_video_mode(); } -const std::string_view gl_window::title() const { +const std::string_view gpu_window::title() const { assert(window_); if (window_) { return window_->get_title(); @@ -249,14 +249,14 @@ const std::string_view gl_window::title() const { return "Bad window"; } -void gl_window::resize(size_t height, size_t width) { +void gpu_window::resize(size_t height, size_t width) { assert(window_); if (window_) { window->resize(height, width); } } -conveyor gl_window::on_event() { +conveyor gpu_window::on_event() { assert(window_); return window_->on_event(); } -- cgit v1.2.3