Pioneer
RenderTargetGL.h
Go to the documentation of this file.
1 // Copyright © 2008-2021 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"
12 #include "graphics/RenderTarget.h"
13 
14 namespace Graphics {
15 
16  class RendererOGL;
17 
18  namespace OGL {
19 
21  public:
22  ~RenderTarget();
23  virtual Texture *GetColorTexture() const;
24  virtual Texture *GetDepthTexture() const;
25  virtual void SetCubeFaceTexture(const Uint32 face, Texture *t) final;
26  virtual void SetColorTexture(Texture *) final;
27  virtual void SetDepthTexture(Texture *) final;
28 
29  protected:
30  friend class Graphics::RendererOGL;
32  void Bind();
33  void Unbind();
35  bool CheckStatus();
36 
37  bool m_active;
38  GLuint m_fbo;
40 
43  };
44 
45  } // namespace OGL
46 
47 } // namespace Graphics
48 
49 #endif
Definition: RenderTargetGL.h:20
virtual void SetCubeFaceTexture(const Uint32 face, Texture *t) final
Definition: RenderTargetGL.cpp:35
RenderTarget(const RenderTargetDesc &)
Definition: RenderTargetGL.cpp:10
void Unbind()
Definition: RenderTargetGL.cpp:81
~RenderTarget()
Definition: RenderTargetGL.cpp:18
RefCountedPtr< Texture > m_depthTexture
Definition: RenderTargetGL.h:42
bool CheckStatus()
Definition: RenderTargetGL.cpp:87
virtual Texture * GetColorTexture() const
Definition: RenderTargetGL.cpp:24
virtual void SetColorTexture(Texture *) final
Definition: RenderTargetGL.cpp:47
RefCountedPtr< Texture > m_colorTexture
Definition: RenderTargetGL.h:41
bool m_active
Definition: RenderTargetGL.h:37
void Bind()
Definition: RenderTargetGL.cpp:75
virtual void SetDepthTexture(Texture *) final
Definition: RenderTargetGL.cpp:61
GLuint m_depthRenderBuffer
Definition: RenderTargetGL.h:39
GLuint m_fbo
Definition: RenderTargetGL.h:38
virtual Texture * GetDepthTexture() const
Definition: RenderTargetGL.cpp:29
void CreateDepthRenderbuffer()
Definition: RenderTargetGL.cpp:92
Definition: RenderTarget.h:38
Definition: RendererGL.h:45
Definition: Texture.h:106
Definition: RefCounted.h:36
Definition: Background.h:13
Definition: RenderTarget.h:20