From f968488e344e5b3fd69d8a69fa2e0c0c087b31ad Mon Sep 17 00:00:00 2001 From: omigamedev Date: Tue, 2 Jun 2026 08:54:51 +0200 Subject: [PATCH] Move Windows GL info mapping to renderer gl --- docs/modernization/build-inventory.md | 3 +++ docs/modernization/roadmap.md | 3 +++ src/main.cpp | 11 ++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 2f935f1..f26de87 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -196,6 +196,9 @@ Known local toolchain state: longer expose raw OpenGL enum defaults; default texture formats, sampler filters/wraps, and render-target formats resolve through backend-owned overloads. + The Windows entrypoint also consumes backend-owned generic OpenGL error-code + and info-string tokens; WGL context/pixel-format constants remain in the + platform shell for a later platform-boundary slice. - `windows-msvc-vcpkg-headless` validates manifest install/configure/build/test for the current headless component matrix; see DEBT-0007 for remaining app and platform triplet migration. diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index 51c723f..09c599c 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -463,6 +463,9 @@ Legacy `Texture2D`, `TextureManager`, `Sampler`, and `RTT` public headers no longer expose raw OpenGL enum defaults; default texture formats, sampler filters/wraps, and render-target formats are resolved through backend-owned overloads. +The Windows entrypoint now delegates generic OpenGL error-code and info-string +tokens to `pp_renderer_gl`; WGL context/pixel-format constants remain in the +platform shell for a later platform-boundary slice. The existing renderer classes are not yet fully behind the renderer interfaces. diff --git a/src/main.cpp b/src/main.cpp index 8b086cd..02f7c54 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include "canvas.h" #include "keymap.h" #include "hmd.h" +#include "renderer_gl/opengl_capabilities.h" #include "../resource.h" #include @@ -828,7 +829,7 @@ void _post_call_callback(const char* name, void* funcptr, int len_args, ...) GLenum error_code; error_code = glad_glGetError(); - if (error_code != GL_NO_ERROR) + if (error_code != pp::renderer::gl::no_error_code()) { LOG("ERROR %d in %s\n", error_code, name); } @@ -958,9 +959,9 @@ int main(int argc, char** argv) return 0; } - LOG("GL version: %s", glGetString(GL_VERSION)); - LOG("GL vendor: %s", glGetString(GL_VENDOR)); - LOG("GL renderer: %s", glGetString(GL_RENDERER)); + LOG("GL version: %s", glGetString(static_cast(pp::renderer::gl::version_string_name()))); + LOG("GL vendor: %s", glGetString(static_cast(pp::renderer::gl::vendor_string_name()))); + LOG("GL renderer: %s", glGetString(static_cast(pp::renderer::gl::renderer_string_name()))); #ifdef USE_RENDERDOC if (!win32_renderdoc_init()) @@ -968,7 +969,7 @@ int main(int argc, char** argv) #endif // USE_RENDERDOC swprintf_s(window_title, L"PanoPainter %s (%s)", g_version_number_w, - str2wstr((char*)glGetString(GL_RENDERER)).c_str()); + str2wstr((char*)glGetString(static_cast(pp::renderer::gl::renderer_string_name()))).c_str()); // If supported create a 3.3 context if (GLAD_WGL_ARB_create_context)