mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-07 14:45:41 +12:00
Add some renderer related helper functions in emulator and renderergl
This commit is contained in:
parent
df3c90109b
commit
b5b94a3526
3 changed files with 7 additions and 0 deletions
|
@ -160,6 +160,7 @@ class GPU {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Renderer* getRenderer() { return renderer.get(); }
|
||||||
private:
|
private:
|
||||||
// GPU external registers
|
// 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
|
// 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
|
||||||
|
|
|
@ -114,4 +114,6 @@ class Emulator {
|
||||||
void setOutputSize(u32 width, u32 height) { gpu.setOutputSize(width, height); }
|
void setOutputSize(u32 width, u32 height) { gpu.setOutputSize(width, height); }
|
||||||
|
|
||||||
EmulatorConfig& getConfig() { return config; }
|
EmulatorConfig& getConfig() { return config; }
|
||||||
|
RendererType getRendererType() const { return config.rendererType; }
|
||||||
|
Renderer* getRenderer() { return gpu.getRenderer(); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -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);
|
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
|
#ifdef PANDA3DS_FRONTEND_QT
|
||||||
virtual void initGraphicsContext([[maybe_unused]] GL::Context* context) override { initGraphicsContextInternal(); }
|
virtual void initGraphicsContext([[maybe_unused]] GL::Context* context) override { initGraphicsContextInternal(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue