Defined in:Sets the direct rendering callback function for a viewport widget.
void SetDirectRenderCallback(DirectRenderCallback *callback, void *cookie = nullptr);
||A pointer to the direct rendering callback function.|
||A user-defined pointer that is passed to the direct rendering callback function.|
SetDirectRenderCallbackfunction installs a rendering callback function that is called once per frame to draw the contents of a viewport widget that are rendered directly to the frame buffer. If a texture rendering callback function is also installed (with the
ViewportWidget::SetTextureRenderCallbackfunction), then the direct rendering callback function is called after the contents of the texture map have been rendered, if necessary, and drawn to the frame buffer. Thus, the contents drawn with the direct rendering callback function appear on top of the viewport's texture image.
callbackparameter should point to a function having the following prototype.
The first parameter passed to the direct rendering callback function is a pointer to a list to which renderable objects can be added, and the second parameter is a pointer to the viewport that is being rendered. The last parameter receives the pointer specified by the
typedef void DirectRenderCallback(List<Renderable> *, ViewportWidget *, void *);
When the direct rendering callback function is called, the viewport's camera has already been established as the current rendering camera. The direct rendering callback function may cause calls to the
GraphicsMgr::Drawfunction to occur, and it may add renderable objects to the render list passed to it. If the render list contains any objects upon return from the direct rendering callback function, then they are immediately rendered with the
DrawRenderListfunction and removed from the list.
The direct rendering callback function would normally call the
GraphicsMgr::ClearColorBufferfunction first to clear the area covered by the viewport widget.
nullptr, then any currently installed direct rendering callback function is removed.