From a636a0d1da600fb9492b7b1e49a8a7e7d2333f5a Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Mon, 10 Jul 2023 09:25:39 -0700 Subject: [PATCH] Replace `ENABLE_OPENGL` with `PANDA3DS_ENABLE_OPENGL` --- CMakeLists.txt | 6 +++--- include/emulator.hpp | 4 ++-- src/core/PICA/gpu.cpp | 4 ++-- src/emulator.cpp | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 74c33f87..0c665f48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ endif() option(DISABLE_PANIC_DEV "Make a build with fewer and less intrusive asserts" OFF) option(GPU_DEBUG_INFO "Enable additional GPU debugging info" OFF) -option(ENABLE_OPENGL "Enable OpenGL rendering backend" ON) +option(PANDA3DS_ENABLE_OPENGL "Enable OpenGL rendering backend" ON) option(ENABLE_LTO "Enable link-time optimization" OFF) option(ENABLE_USER_BUILD "Make a user-facing build. These builds have various assertions disabled, LTO, and more" OFF) option(ENABLE_HTTP_SERVER "Enable HTTP server. Used for Discord bot support" OFF) @@ -180,8 +180,8 @@ endif() target_link_libraries(Alber PRIVATE dynarmic SDL2-static cryptopp) -if(ENABLE_OPENGL) - target_compile_definitions(Alber PUBLIC "ENABLE_OPENGL=1") +if(PANDA3DS_ENABLE_OPENGL) + target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_OPENGL=1") set(RENDERER_GL_INCLUDE_FILES include/opengl.hpp include/renderer_gl/renderer_gl.hpp include/renderer_gl/textures.hpp diff --git a/include/emulator.hpp b/include/emulator.hpp index ae6e7142..7f5bef0e 100644 --- a/include/emulator.hpp +++ b/include/emulator.hpp @@ -13,7 +13,7 @@ #include "io_file.hpp" #include "memory.hpp" -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL #include "gl_state.hpp" #endif @@ -33,7 +33,7 @@ class Emulator { EmulatorConfig config; SDL_Window* window; -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL SDL_GLContext glContext; GLStateManager gl; #endif diff --git a/src/core/PICA/gpu.cpp b/src/core/PICA/gpu.cpp index 29eeef04..b4fb644e 100644 --- a/src/core/PICA/gpu.cpp +++ b/src/core/PICA/gpu.cpp @@ -8,7 +8,7 @@ #include "PICA/float_types.hpp" #include "PICA/regs.hpp" -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL #include "renderer_gl/renderer_gl.hpp" #endif @@ -21,7 +21,7 @@ GPU::GPU(Memory& mem, EmulatorConfig& config) : mem(mem), config(config) { mem.setVRAM(vram); // Give the bus a pointer to our VRAM // TODO: configurable backend -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL renderer.reset(new RendererGL(*this, regs)); #endif } diff --git a/src/emulator.cpp b/src/emulator.cpp index db628853..6b821d86 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -2,7 +2,7 @@ #include -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL #include #endif @@ -27,7 +27,7 @@ Emulator::Emulator() : kernel(cpu, memory, gpu), cpu(memory, kernel), gpu(memory Helpers::warn("Failed to initialize SDL2 GameController: %s", SDL_GetError()); } -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL // Request OpenGL 4.1 Core (Max available on MacOS) // MacOS gets mad if we don't explicitly demand a core profile SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); @@ -434,7 +434,7 @@ bool Emulator::loadELF(std::ifstream& file) { // Reset our graphics context and initialize the GPU's graphics context void Emulator::initGraphicsContext() { -#if ENABLE_OPENGL +#if PANDA3DS_ENABLE_OPENGL gl.reset(); // TODO (For when we have multiple backends): Only do this if we are using OpenGL #endif gpu.initGraphicsContext();