diff --git a/include/PICA/gpu.hpp b/include/PICA/gpu.hpp index d8f5ab195..0bf5941b9 100644 --- a/include/PICA/gpu.hpp +++ b/include/PICA/gpu.hpp @@ -160,6 +160,7 @@ class GPU { } } + Renderer* getRenderer() { return renderer.get(); } private: // GPU external registers // We have them in the end of the struct for cache locality reasons. Tl;dr we want the more commonly used things to be packed in the start diff --git a/include/emulator.hpp b/include/emulator.hpp index 5e5113959..c1d228e77 100644 --- a/include/emulator.hpp +++ b/include/emulator.hpp @@ -114,4 +114,6 @@ class Emulator { void setOutputSize(u32 width, u32 height) { gpu.setOutputSize(width, height); } EmulatorConfig& getConfig() { return config; } + RendererType getRendererType() const { return config.rendererType; } + Renderer* getRenderer() { return gpu.getRenderer(); } }; diff --git a/include/renderer_gl/renderer_gl.hpp b/include/renderer_gl/renderer_gl.hpp index 56324b0e3..07f91dcde 100644 --- a/include/renderer_gl/renderer_gl.hpp +++ b/include/renderer_gl/renderer_gl.hpp @@ -84,6 +84,10 @@ class RendererGL final : public Renderer { std::optional getColourBuffer(u32 addr, PICA::ColorFmt format, u32 width, u32 height, bool createIfnotFound = true); + // Note: The caller is responsible for deleting the currently bound FBO before calling this + void setFBO(uint handle) { screenFramebuffer.m_handle = handle; } + void resetStateManager() { gl.reset(); } + #ifdef PANDA3DS_FRONTEND_QT virtual void initGraphicsContext([[maybe_unused]] GL::Context* context) override { initGraphicsContextInternal(); } #endif