15 #include "displayRegionDrawCallbackData.h"
17 #include "config_display.h"
18 #include "cullResult.h"
19 #include "displayRegion.h"
20 #include "graphicsOutput.h"
21 #include "graphicsStateGuardian.h"
22 #include "sceneSetup.h"
24 TypeHandle DisplayRegionDrawCallbackData::_type_handle;
32 DisplayRegionDrawCallbackData::
34 _cull_result(cull_result),
35 _scene_setup(scene_setup)
44 void DisplayRegionDrawCallbackData::
45 output(ostream &out)
const {
46 out << get_type() <<
"(" << (
void *)_cull_result <<
", "
47 << (
void *)_scene_setup <<
")";
67 if (_cull_result == NULL || _scene_setup == NULL) {
78 }
else if (!gsg->
set_scene(_scene_setup)) {
81 << gsg->get_type() <<
" cannot render scene with specified lens.\n";
88 _cull_result->
draw(current_thread);
virtual bool is_stereo() const
Returns true if this is a StereoDisplayRegion, false otherwise.
virtual void upcall()
You should make this call during the callback if you want to continue the normal rendering function t...
DisplayRegion * get_display_region() const
Returns the display region for the scene.
static Thread * get_current_thread()
Returns a pointer to the currently-executing Thread object.
virtual void clear_state_and_transform()
Forgets the current graphics state and current transform, so that the next call to set_state_and_tran...
GraphicsOutput * get_window() const
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
GraphicsStateGuardian * get_gsg() const
Returns the GSG that is associated with this window.
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order.
A thread; that is, a lightweight process.
Encapsulates all the communication with a particular instance of a given rendering backend...
virtual void end_scene()
Called between begin_frame() and end_frame() to mark the end of drawing commands for a "scene" (usual...
A rectangular subregion within a window for rendering into.
void draw(Thread *current_thread)
Asks all the bins to draw themselves in the correct order.
TypeHandle is the identifier used to differentiate C++ class types.
This object holds the camera position, etc., and other general setup information for rendering a part...
bool set_scene(SceneSetup *scene_setup)
Sets the SceneSetup object that indicates the initial camera position, etc.
virtual bool begin_scene()
Called between begin_frame() and end_frame() to mark the beginning of drawing commands for a "scene" ...