Replace ENABLE_OPENGL with PANDA3DS_ENABLE_OPENGL

This commit is contained in:
Wunkolo 2023-07-10 09:25:39 -07:00
parent c53080b444
commit a636a0d1da
4 changed files with 10 additions and 10 deletions

View file

@ -19,7 +19,7 @@ endif()
option(DISABLE_PANIC_DEV "Make a build with fewer and less intrusive asserts" OFF) 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(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_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_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) 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) target_link_libraries(Alber PRIVATE dynarmic SDL2-static cryptopp)
if(ENABLE_OPENGL) if(PANDA3DS_ENABLE_OPENGL)
target_compile_definitions(Alber PUBLIC "ENABLE_OPENGL=1") target_compile_definitions(Alber PUBLIC "PANDA3DS_ENABLE_OPENGL=1")
set(RENDERER_GL_INCLUDE_FILES include/opengl.hpp set(RENDERER_GL_INCLUDE_FILES include/opengl.hpp
include/renderer_gl/renderer_gl.hpp include/renderer_gl/textures.hpp include/renderer_gl/renderer_gl.hpp include/renderer_gl/textures.hpp

View file

@ -13,7 +13,7 @@
#include "io_file.hpp" #include "io_file.hpp"
#include "memory.hpp" #include "memory.hpp"
#if ENABLE_OPENGL #if PANDA3DS_ENABLE_OPENGL
#include "gl_state.hpp" #include "gl_state.hpp"
#endif #endif
@ -33,7 +33,7 @@ class Emulator {
EmulatorConfig config; EmulatorConfig config;
SDL_Window* window; SDL_Window* window;
#if ENABLE_OPENGL #if PANDA3DS_ENABLE_OPENGL
SDL_GLContext glContext; SDL_GLContext glContext;
GLStateManager gl; GLStateManager gl;
#endif #endif

View file

@ -8,7 +8,7 @@
#include "PICA/float_types.hpp" #include "PICA/float_types.hpp"
#include "PICA/regs.hpp" #include "PICA/regs.hpp"
#if ENABLE_OPENGL #if PANDA3DS_ENABLE_OPENGL
#include "renderer_gl/renderer_gl.hpp" #include "renderer_gl/renderer_gl.hpp"
#endif #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 mem.setVRAM(vram); // Give the bus a pointer to our VRAM
// TODO: configurable backend // TODO: configurable backend
#if ENABLE_OPENGL #if PANDA3DS_ENABLE_OPENGL
renderer.reset(new RendererGL(*this, regs)); renderer.reset(new RendererGL(*this, regs));
#endif #endif
} }

View file

@ -2,7 +2,7 @@
#include <stb_image_write.h> #include <stb_image_write.h>
#if ENABLE_OPENGL #if PANDA3DS_ENABLE_OPENGL
#include <glad/gl.h> #include <glad/gl.h>
#endif #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()); 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) // Request OpenGL 4.1 Core (Max available on MacOS)
// MacOS gets mad if we don't explicitly demand a core profile // 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); 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 // Reset our graphics context and initialize the GPU's graphics context
void Emulator::initGraphicsContext() { 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 gl.reset(); // TODO (For when we have multiple backends): Only do this if we are using OpenGL
#endif #endif
gpu.initGraphicsContext(); gpu.initGraphicsContext();