ViewportWidget::SetTextureRenderCallback
Defined in:
Sets the texture rendering callback function for a viewport widget.
C4Viewports.h
Prototype
void SetTextureRenderCallback(TextureRenderCallback *callback, void *cookie = nullptr);
Parameters
callback |
A pointer to the texture rendering callback function. |
cookie |
A user-defined pointer that is passed to the texture rendering callback function. |
Description
The SetTextureRenderCallback
function installs a rendering callback function that is called to draw the contents of a viewport widget's texture map. This callback function is called only after a viewport's texture map has been established with a call to the ViewportWidget::EnableViewportTexture
function, and it is called once per frame unless the viewport can cache a static texture (as indicated by the staticFlag
parameter of the ViewportWidget::EnableViewportTexture
function) and the texture map has not been invalidated with the ViewportWidget::InvalidateViewportTexture
function.The
callback
parameter should point to a function having the following prototype.
typedef void TextureRenderCallback(ViewportWidget *, void *);
cookie
parameter.Right before the rendering callback function is called, the viewport's camera is established as the current rendering camera, and the viewport's texture map is established as the current rendering target. The callback function may cause calls to the
GraphicsMgr::ClearColorBuffer
and GraphicsMgr::Draw
functions to occur, and these affect only the viewport's texture map.If the
callback
parameter is nullptr
, then any currently installed texture rendering callback function is removed, but items can still be rendered in the viewport through the direct rendering callback function if one has been installed using the ViewportWidget::SetDirectRenderCallback
function.
See Also
ViewportWidget::SetDirectRenderCallback
ViewportWidget::SetMouseEventCallback