diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-11-02 15:26:25 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-11-02 15:26:45 +0000 |
| commit | 40081cb330fa838ad9c0a7b87c20b2300ea7fb38 (patch) | |
| tree | cac98c197bfa607ee3ba7134582443b98948e849 /src/render/Framebuffer.cpp | |
| parent | 32b18179dd789cde948c97eb3c2ebbdd6af36bf7 (diff) | |
renderer: improve api around new framebuffer changes
ref #8325
Diffstat (limited to 'src/render/Framebuffer.cpp')
| -rw-r--r-- | src/render/Framebuffer.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/render/Framebuffer.cpp b/src/render/Framebuffer.cpp index 7e086778..814a3339 100644 --- a/src/render/Framebuffer.cpp +++ b/src/render/Framebuffer.cpp @@ -65,9 +65,10 @@ bool CFramebuffer::alloc(int w, int h, uint32_t drmFormat) { return true; } -void CFramebuffer::addStencil() { +void CFramebuffer::addStencil(SP<CTexture> tex) { // TODO: Allow this with gles2 #ifndef GLES2 + m_pStencilTex = tex; glBindTexture(GL_TEXTURE_2D, m_pStencilTex->m_iTexID); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, m_vSize.x, m_vSize.y, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0); @@ -109,5 +110,17 @@ CFramebuffer::~CFramebuffer() { } bool CFramebuffer::isAllocated() { - return m_iFbAllocated; -}
\ No newline at end of file + return m_iFbAllocated && m_cTex; +} + +SP<CTexture> CFramebuffer::getTexture() { + return m_cTex; +} + +GLuint CFramebuffer::getFBID() { + return m_iFbAllocated ? m_iFb : 0; +} + +SP<CTexture> CFramebuffer::getStencilTex() { + return m_pStencilTex; +} |
