Skip to content

Commit

Permalink
Add some renderer related helper functions in emulator and renderergl
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Oct 19, 2023
1 parent df3c901 commit b5b94a3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/PICA/gpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
4 changes: 4 additions & 0 deletions include/renderer_gl/renderer_gl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ class RendererGL final : public Renderer {

std::optional<ColourBuffer> 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
Expand Down

0 comments on commit b5b94a3

Please sign in to comment.