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

@ -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
}

View file

@ -2,7 +2,7 @@
#include <stb_image_write.h>
#if ENABLE_OPENGL
#if PANDA3DS_ENABLE_OPENGL
#include <glad/gl.h>
#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();