torque Torque Game Engine Documentation
TGE Version 1.5.2

Render To Texture Simulation


Detailed Description

Render To Texture is really great because it allows you to draw to offscreen buffers and not muck around with copying pixels etc.

Unfortunatly there is no way to do this cross-platform (that I know of) in OpenGL 1.5 so this is the work around. When the time comes to draw something to a texture we will copy the current contents of that area of the color buffer into a temporary DynamicTexture, draw (to that area), grab those pixels, then restore the contents of the color buffer to what it was before we drew to it. This method is NOT necesasary for every application of DynamicTexture. In fact, most applications will not need it at all.


Functions

void DynamicTexture::setEnableRTT (bool enable=true)
 Manually enable or disable RTT mode.
void DynamicTexture::storePixels ()
 Stores the pixels defined by the updateRect into a temporary DynamicTexture object so that they can be restored at a later time.
void DynamicTexture::restorePixels ()
 Restores the pixels in the temporary DynamicTexture object by doing a dglDrawBitmap with them and drawing them, stretched to the updateRect.


Function Documentation

void DynamicTexture::setEnableRTT ( bool  enable = true  )  [inherited]

Manually enable or disable RTT mode.

void DynamicTexture::storePixels (  )  [inherited]

Stores the pixels defined by the updateRect into a temporary DynamicTexture object so that they can be restored at a later time.

void DynamicTexture::restorePixels (  )  [inherited]

Restores the pixels in the temporary DynamicTexture object by doing a dglDrawBitmap with them and drawing them, stretched to the updateRect.




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen