|
Public Member Functions |
| DynamicTexture () |
| Default Constructor.
|
| DynamicTexture (const RectI &updateRect) |
| Constructor.
|
| DynamicTexture (GuiControl *control) |
| Gui updater Constructor.
|
| ~DynamicTexture () |
| Destructor.
|
void | update () |
| Grabs the rectangle defined by mUpdateRect from the color-buffer and sticks it in the texture.
|
void | registerForGuiUpdates (GuiControl *control) |
| This registers this DynamicTexture to be updated every frame with the contents of a GuiControl.
|
bool | unregisterForGuiUpdates () |
| This will unregister this DynamicTexture from per-frame Gui updates.
|
void | registerForScreenUpdates () |
| This will register this DynamicTexture to be updated every frame.
|
bool | unregisterForScreenUpdates () |
| This will unregister this control from screen updates.
|
void | updateAtEndOfFrame () |
| This method just registers this texture to be updated at the end of the current frame.
|
void | setUpdateRect (const RectI &newRect) |
| This lets you change the rect that this texture grabs from the screen This is not a cheap operation, you don't want to do it unless you have a good reason to.
|
void | setEnableRTT (bool enable=true) |
| Manually enable or disable RTT mode.
|
void | storePixels () |
| Stores the pixels defined by the updateRect into a temporary DynamicTexture object so that they can be restored at a later time.
|
void | restorePixels () |
| Restores the pixels in the temporary DynamicTexture object by doing a dglDrawBitmap with them and drawing them, stretched to the updateRect.
|
TextureHandle | getTextureHandle () const |
| Returns the texture handle for this so it can be used to render.
|
const RectF *const | texCoordInfo () const |
| Returns a const pointer to the texture coordinate information.
|
const RectI *const | getUpdateRect () const |
| Returns the update rect of this dynamic texture.
|
GuiControl * | getGuiControl () const |
| Returns the GuiControl this texture is using, if any.
|
void | renderGuiControl (GuiControl *ctrl=NULL, bool rttMode=false) |
| Renders a GuiControl, and it's children, to the texture This has two different behaviors depending on if RTT emulation is specified as enabled.
|
Static Public Member Functions |
static void | updateGuiTextures () |
| This method is called in GuiCanvas before the screen-rendering takes place to update all of the registered GUI update textures.
|
static void | updateScreenTextures () |
| This method is called in GuiCanvas right before the buffers are swapped.
|
static void | updateEndOfFrameTextures () |
| This method will update all the textures that asked to be rendered at the end of the current frame.
|
Private Types |
typedef Vector< DynamicTexture
* >::iterator | RegisteredUpdateItr |
Private Member Functions |
void | initDT () |
| Helper function for the constructors.
|
Private Attributes |
TextureHandle * | mTextureHandle |
| TextureHandle.
|
Point2I | mSize |
S32 | mTexCBHandle |
RectI | mUpdateRect |
| When you call update() this is the rect, in screen coordinates, that gets grabbed.
|
RectF | mTextureCoords |
| This is the texturecoord information you need to know to create texturecoords if you are not using dglDrawBitmap.
|
bool | mRTT |
| Supports RTT emulation for Gui.
|
bool | mHasUpdateRect |
| Lets this have a default constructor.
|
GuiControl * | mGuiControl |
| If the object is registered as wanting a Gui update every frame, this is the variable that contains the Gui control it will render.
|
DynamicTexture * | mTempDynamicTexture |
| For RTT emulation.
|
Static Private Attributes |
static Vector< DynamicTexture * > | smRegisteredGuiUpdaters |
| This is a vector of DynamicTexture objects that will be updated every frame with their mGuiControl rendered to them.
|
static Vector< DynamicTexture * > | smRegisteredScreenUpdaters |
static Vector< DynamicTexture * > | smUpdateAtEndOfFrame |
Friends |
void | dynamicTextureCB (const U32 eventCode, void *userData) |
Renders a GuiControl, and it's children, to the texture This has two different behaviors depending on if RTT emulation is specified as enabled.
In OpenGL, rendering to an off screen buffer is a platform-specific operation and I don't have a Mac to make sure this works and what have you, so what happens is, if RTT mode is turned on, the area that will be used to draw the texture will be saved, with the temp DyanmicTexture object then the rendering will take place, it will grab the texture, then restore the edited area of the color-buffer.
If RTT is turned off, then it will draw the control on the screen, grab it, and leave it. This is not as useless as it seems, this is not at all a bad way to do things, just do it all in the GuiCanvas before it begins rendering the content control
- See also:
- GuiCanvas::renderFrame
- Parameters:
-