Panda3D
displayRegionCullCallbackData.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file displayRegionCullCallbackData.cxx
10  * @author drose
11  * @date 2009-03-14
12  */
13 
15 #include "cullHandler.h"
16 #include "sceneSetup.h"
17 #include "graphicsEngine.h"
18 
19 TypeHandle DisplayRegionCullCallbackData::_type_handle;
20 
21 
22 /**
23  *
24  */
25 DisplayRegionCullCallbackData::
26 DisplayRegionCullCallbackData(CullHandler *cull_handler, SceneSetup *scene_setup) :
27  _cull_handler(cull_handler),
28  _scene_setup(scene_setup)
29 {
30 }
31 
32 /**
33  *
34  */
35 void DisplayRegionCullCallbackData::
36 output(std::ostream &out) const {
37  out << get_type() << "(" << (void *)_cull_handler << ", "
38  << (void *)_scene_setup << ")";
39 }
40 
41 /**
42  * You should make this call during the callback if you want to continue the
43  * normal rendering function that would have been done in the absence of a
44  * callback.
45  *
46  * Specifically, this method will perform the cull traversal for the
47  * DisplayRegion's scene graph, and add all renderable objects to its
48  * CullResult.
49  */
51 upcall() {
52  Thread *current_thread = Thread::get_current_thread();
53  DisplayRegion *dr = _scene_setup->get_display_region();
54  GraphicsStateGuardian *gsg = dr->get_window()->get_gsg();
55 
56  dr->do_cull(_cull_handler, _scene_setup, gsg, current_thread);
57 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void upcall()
You should make this call during the callback if you want to continue the normal rendering function t...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This defines the abstract interface for an object that receives Geoms identified by the CullTraverser...
Definition: cullHandler.h:28
get_window
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
Definition: displayRegion.h:88
A thread; that is, a lightweight process.
Definition: thread.h:46
Encapsulates all the communication with a particular instance of a given rendering backend.
A rectangular subregion within a window for rendering into.
Definition: displayRegion.h:57
DisplayRegion * get_display_region() const
Returns the display region for the scene.
Definition: sceneSetup.I:42
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This object holds the camera position, etc., and other general setup information for rendering a part...
Definition: sceneSetup.h:32
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.