Pioneer
Loading...
Searching...
No Matches
RenderTargetGL.h
Go to the documentation of this file.
1// Copyright © 2008-2024 Pioneer Developers. See AUTHORS.txt for details
2// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4#ifndef _OGL_RENDERTARGET_H
5#define _OGL_RENDERTARGET_H
6/*
7 * Framebuffer object with switchable target textures.
8 * In theory you should use one texture format and size per FBO
9 * 2013-May-05 left out stencil buffer because we don't need it now
10 */
11#include "OpenGLLibs.h"
13
14namespace Graphics {
15
16 class RendererOGL;
17
18 namespace OGL {
19 class RenderStateCache;
20 class CommandList;
21
23 public:
24 enum Binding {
25 READ = 1,
26 DRAW = 2,
27 BOTH = 3
28 };
29
31 virtual Texture *GetColorTexture() const override final;
32 virtual Texture *GetDepthTexture() const override final;
33 virtual void SetCubeFaceTexture(const Uint32 face, Texture *t) override final;
34 virtual void SetColorTexture(Texture *) override final;
35 virtual void SetDepthTexture(Texture *) override final;
36
37 protected:
38 friend class Graphics::RendererOGL;
39 friend class RenderStateCache;
40 friend class CommandList;
41
43 void Bind(Binding bind = BOTH);
44 void Unbind(Binding bind = BOTH);
46 bool CheckStatus();
47
49
51 GLuint m_fbo;
53
56 };
57
58 } // namespace OGL
59
60} // namespace Graphics
61
62#endif
Definition: CommandBufferGL.h:36
Definition: RenderStateCache.h:26
Definition: RenderTargetGL.h:22
virtual Texture * GetDepthTexture() const override final
Definition: RenderTargetGL.cpp:58
~RenderTarget()
Definition: RenderTargetGL.cpp:46
RefCountedPtr< Texture > m_depthTexture
Definition: RenderTargetGL.h:55
void Unbind(Binding bind=BOTH)
Definition: RenderTargetGL.cpp:102
bool CheckStatus()
Definition: RenderTargetGL.cpp:108
RendererOGL * m_renderer
Definition: RenderTargetGL.h:48
RefCountedPtr< Texture > m_colorTexture
Definition: RenderTargetGL.h:54
Binding
Definition: RenderTargetGL.h:24
@ BOTH
Definition: RenderTargetGL.h:27
@ READ
Definition: RenderTargetGL.h:25
@ DRAW
Definition: RenderTargetGL.h:26
bool m_active
Definition: RenderTargetGL.h:50
virtual Texture * GetColorTexture() const override final
Definition: RenderTargetGL.cpp:53
void Bind(Binding bind=BOTH)
Definition: RenderTargetGL.cpp:96
virtual void SetColorTexture(Texture *) override final
Definition: RenderTargetGL.cpp:73
virtual void SetCubeFaceTexture(const Uint32 face, Texture *t) override final
Definition: RenderTargetGL.cpp:63
GLuint m_depthRenderBuffer
Definition: RenderTargetGL.h:52
GLuint m_fbo
Definition: RenderTargetGL.h:51
void CreateDepthRenderbuffer()
Definition: RenderTargetGL.cpp:113
virtual void SetDepthTexture(Texture *) override final
Definition: RenderTargetGL.cpp:84
Definition: RenderTarget.h:38
Definition: RendererGL.h:39
Definition: Texture.h:103
Definition: RefCounted.h:36
Definition: Background.h:14
Definition: RenderTarget.h:20