8 #ifndef META_OCEAN_PLATFORM_GL_TEXTURE_FRAMEBUFFER_H
9 #define META_OCEAN_PLATFORM_GL_TEXTURE_FRAMEBUFFER_H
46 inline unsigned int samples()
const;
52 inline GLuint textureId()
const;
65 virtual bool resize(
const unsigned int width,
const unsigned int height,
const GLenum internalFormat = GL_RGBA);
80 bool bindToProgram(
const GLuint programId,
const std::string& attributeName,
const unsigned int index = 0u);
98 explicit inline operator bool()
const;
103 GLuint objectId_ = 0u;
106 GLuint textureId_ = 0u;
109 unsigned int samples_ = 1u;
122 inline TextureFramebuffer::operator bool()
const
124 ocean_assert(objectId_ == 0u && textureId_ == 0u || objectId_ != 0u && textureId_ != 0u);
125 return textureId_ != 0u;
This class encapsulates an OpenGL context.
Definition: platform/gl/Context.h:29
This class implements a texture framebuffer allowing to render into a texture object.
Definition: platform/gl/TextureFramebuffer.h:28
TextureFramebuffer()=default
Creates a new framebuffer object.
bool release()
Releases this framebuffer.
virtual bool resize(const unsigned int width, const unsigned int height, const GLenum internalFormat=GL_RGBA)
Resizes the off-screen framebuffer.
GLuint textureId() const
Returns the id of the texture of this framebuffer.
Definition: platform/gl/TextureFramebuffer.h:117
unsigned int samples() const
Returns the number of samples.
Definition: platform/gl/TextureFramebuffer.h:112
unsigned int samples_
The number of samples.
Definition: platform/gl/TextureFramebuffer.h:109
virtual bool unbind()
Unbinds the framebuffer as target framebuffer.
bool setSamples(const unsigned int samples)
(Re-)sets the number of samples of this texture framebuffer.
virtual bool bind()
Binds the framebuffer as target framebuffer.
TextureFramebuffer(Context &context)
Creates a new framebuffer object with know associated context.
bool bindToProgram(const GLuint programId, const std::string &attributeName, const unsigned int index=0u)
Bind this texture to a given shader program.
GLuint textureId_
The id of the texture.
Definition: platform/gl/TextureFramebuffer.h:106
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15