Files Class List
GLRenderDepth2D Class Reference

Detailed Description

OpenGL render depth buffer with a 2D texture.

+ Inheritance diagram for GLRenderDepth2D:

Public Member Functions

Render Buffer Creation and Initialization
bool Initialize (bool depthComparisonTexture=true)
 
bool Initialize (bool depthComparisonTexture, GLsizei width, GLsizei height, GLenum depthFormat=GL_DEPTH_COMPONENT)
 
bool Resize (GLsizei width, GLsizei height, GLenum depthFormat=GL_DEPTH_COMPONENT)
 
General Methods
void Delete ()
 
GLuint GetID () const
 
bool IsNull () const
 
void Bind () const
 
void Unbind () const
 
bool IsReady () const
 
bool IsComplete () const
 

Protected Attributes

GLuint framebufferID
 
GLuint depthbufferID
 
GLTexture2< TEXTURE_TYPE > texture
 
GLsizei bufferWidth
 
GLsizei bufferHeight
 
GLint prevBufferID
 
GLint prevViewport [4]
 

Texture Methods

GLuint GetTextureID () const
 
void BindTexture () const
 
void BindTexture (int textureUnit) const
 
void BuildTextureMipmaps ()
 
void SetTextureWrappingMode (GLenum wrapS, GLenum wrapT)
 
void SetTextureFilteringMode (GLenum magnificationFilter=0, GLenum minificationFilter=0)
 
void SetTextureAnisotropy (float anisotropy)
 
void SetTextureMaxAnisotropy ()
 
void SetTextureNoAnisotropy ()
 
void GenerateBuffer ()
 
void SetSize (GLsizei width, GLsizei height)
 

Member Function Documentation

§ Initialize() [1/2]

bool Initialize ( bool  depthComparisonTexture = true)
inherited

Generates the render buffer. Returns true if the render buffer is ready. If depthComparisonTexture is true, initializes the texture for depth comparison.

§ Initialize() [2/2]

bool Initialize ( bool  depthComparisonTexture,
GLsizei  width,
GLsizei  height,
GLenum  depthFormat = GL_DEPTH_COMPONENT 
)
inherited

Generates the render buffer and sets its size. Returns true if the render buffer is ready and complete. If depthComparisonTexture is true, initializes the texture for depth comparison.

§ Resize()

bool Resize ( GLsizei  width,
GLsizei  height,
GLenum  depthFormat = GL_DEPTH_COMPONENT 
)
inherited

Initializes or changes the size of the render buffer. Returns true if the buffer is complete.

§ Delete()

void Delete ( )
inherited

Deletes the render buffer.

§ GetID()

GLuint GetID ( ) const
inherited

Returns the frame buffer ID.

§ IsNull()

bool IsNull ( ) const
inherited

Returns true if the render buffer is not initialized, i.e. the render buffer id is invalid.

§ Bind()

void Bind ( ) const
inherited

Binds the frame buffer for rendering and adjusts the viewport accordingly.

§ Unbind()

void Unbind ( ) const
inherited

Binds the frame buffer that was used before this frame buffer was bound and reverts the viewport.

§ IsReady()

bool IsReady ( ) const
inherited

Returns true if the frame buffer is ready. This method can be called after initialization.

§ IsComplete()

bool IsComplete ( ) const
inherited

Returns true if the render buffer is complete.

§ GetTextureID()

GLuint GetTextureID ( ) const
inherited

Returns the texture ID.

§ BindTexture() [1/2]

void BindTexture ( ) const
inherited

Binds the texture to the current texture unit.

§ BindTexture() [2/2]

void BindTexture ( int  textureUnit) const
inherited

Binds the texture to the given texture unit.

§ BuildTextureMipmaps()

void BuildTextureMipmaps ( )
inherited

Builds mipmap levels for the texture.

§ SetTextureWrappingMode()

void SetTextureWrappingMode ( GLenum  wrapS,
GLenum  wrapT 
)
inherited

Sets the wrapping parameter for the texture. The acceptable values are GL_REPEAT, GL_MIRRORED_REPEAT, GL_CLAMP, and GL_CLAMP_TO_BORDER. If the wrap argument is zero, the corresponding wrapping parameter is not changed.

§ SetTextureFilteringMode()

void SetTextureFilteringMode ( GLenum  magnificationFilter = 0,
GLenum  minificationFilter = 0 
)
inherited

Sets the filtering mode for the texture. The acceptable values are GL_NEAREST and GL_LINEAR. The minification filter values can also be GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR. If the filter argument is zero, the corresponding filter parameter is not changed.

§ SetTextureAnisotropy()

void SetTextureAnisotropy ( float  anisotropy)
inherited

Sets the anisotropy level of the texture.

§ SetTextureMaxAnisotropy()

void SetTextureMaxAnisotropy ( )
inherited

Sets anisotropic filtering to the maximum permissible value.

§ SetTextureNoAnisotropy()

void SetTextureNoAnisotropy ( )
inherited

Turns off anisotropic filtering.

§ GenerateBuffer()

void GenerateBuffer ( )
protectedinherited

Generates the frame buffer and initializes the texture.

§ SetSize()

void SetSize ( GLsizei  width,
GLsizei  height 
)
protectedinherited

Sets the size of the frame buffer.

Member Data Documentation

§ framebufferID

GLuint framebufferID
protectedinherited

The frame-buffer ID.

§ depthbufferID

GLuint depthbufferID
protectedinherited

The depth-buffer ID.

§ texture

GLTexture2<TEXTURE_TYPE> texture
protectedinherited

The buffer texture.

§ bufferWidth

GLsizei bufferWidth
protectedinherited

The width of the frame buffer.

§ bufferHeight

GLsizei bufferHeight
protectedinherited

The height of the frame buffer.

§ prevBufferID

GLint prevBufferID
mutableprotectedinherited

Temporary storage for previous frame-buffer used before binding this buffer.

§ prevViewport

GLint prevViewport[4]
mutableprotectedinherited

Temporary storage for the size and position of the previous frame-buffer used before binding this buffer.