Propane::TextureRenderTarget Class Reference

An interface enabling render-to-texture using FBO and/or glCopyTexImage depending on hardware extensions. More...

#include <PropaneFramebuffer.h>

Inheritance diagram for Propane::TextureRenderTarget:

Propane::CopyTextureRenderTarget Propane::FBOTextureRenderTarget Propane::TextureRectangleFBOTextureRenderTarget List of all members.

Public Member Functions

 TextureRenderTarget (int width, int height)
virtual void begin ()=0
virtual void end ()=0
virtual GLuint * getRenderTexture ()=0
virtual int getWidth ()
 Get the width of the render-targeted texture.
virtual int getHeight ()
 Get the height of the render-targeted texture.
virtual void bindTexture ()=0
 Call this method to just bind the containing texture directly to the current texture context -- supports texture rectangle and non-standard textures too.
virtual void unbindTexture ()=0
 Call this method to unbind the containing texture.
virtual void texCoord (float s, float t)

Protected Member Functions

virtual void createTexture (int w, int h)=0
 Create the proper RGBA + depth texture for this use.

Protected Attributes

int textureWidth
 Width of the raw texture (in pixels).
int textureHeight
 Height of the raw texture (in pixels).

Detailed Description

An interface enabling render-to-texture using FBO and/or glCopyTexImage depending on hardware extensions.
Examples:

useRenderTarget.cpp.


Constructor & Destructor Documentation

Propane::TextureRenderTarget::TextureRenderTarget int  width,
int  height
[inline]
 

Create a new texture and render target. Instead of calling this directly, use getNewTextureRenderTarget to get the specific texture rendering target for your hardware.

Parameters:
width The width of the target texture, in pixels
height The height of the target texture, in pixels


Member Function Documentation

virtual void Propane::TextureRenderTarget::begin  )  [pure virtual]
 

Begin rendering to texture; every GL call after this one will render itself into the raw texture handle that we have retained.

Implemented in Propane::FBOTextureRenderTarget, Propane::TextureRectangleFBOTextureRenderTarget, and Propane::CopyTextureRenderTarget.

Examples:
useRenderTarget.cpp.

virtual void Propane::TextureRenderTarget::end  )  [pure virtual]
 

Stop rendering to texture; after this call completes the texture should be updated with whatever calls we made since begin().

Implemented in Propane::FBOTextureRenderTarget, Propane::TextureRectangleFBOTextureRenderTarget, and Propane::CopyTextureRenderTarget.

Examples:
useRenderTarget.cpp.

virtual GLuint* Propane::TextureRenderTarget::getRenderTexture  )  [pure virtual]
 

Get the raw texture for later use

Returns:
A pointer to the raw texture, or NULL if the render failed.

Implemented in Propane::FBOTextureRenderTarget, Propane::TextureRectangleFBOTextureRenderTarget, and Propane::CopyTextureRenderTarget.

Examples:
useRenderTarget.cpp.

virtual void Propane::TextureRenderTarget::texCoord float  s,
float  t
[inline, virtual]
 

Call this method to look up the texture coordinate of the FBO's target texture.

It uses glTexCoord2f.

This is required since ARB_texture_rectangle does not use the [0,1] convention for texture coordinates.

Parameters:
s The S-coordinate, from 0.0 to 1.0 inclusive
t The T-coordinate, from 0.0 to 1.0 inclusive

Reimplemented in Propane::TextureRectangleFBOTextureRenderTarget.


The documentation for this class was generated from the following file:
Generated on Sun Jan 14 16:49:12 2007 for Propane Injector by  doxygen 1.4.6