#include <graphicsLayer.h>
Inheritance diagram for GraphicsLayer:
Public Member Functions | |
virtual | ~GraphicsLayer () |
DisplayRegion * | make_display_region () |
Creates a new DisplayRegion that covers the entire layer. | |
DisplayRegion * | make_display_region (float l, float r, float b, float t) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the layer. | |
int | get_num_drs () const |
Returns the number of DisplayRegions associated with the layer. | |
DisplayRegion * | get_dr (int index) const |
Returns the nth DisplayRegion associated with the layer. | |
void | remove_dr (int index) |
Removes (and possibly deletes) the nth DisplayRegion associated with the layer. | |
bool | remove_dr (DisplayRegion *display_region) |
Removes (and possibly deletes) the indicated DisplayRegion associated with the layer. | |
GraphicsChannel * | get_channel () const |
Returns the GraphicsChannel that this layer is associated with. | |
GraphicsWindow * | get_window () const |
Returns the GraphicsWindow that this layer is ultimately associated with, or NULL if no window is associated. | |
GraphicsPipe * | get_pipe () const |
Returns the GraphicsPipe that this layer is ultimately associated with, or NULL if no pipe is associated. | |
void | set_active (bool active) |
Sets the active flag on the layer. | |
bool | is_active () const |
Returns the active flag on the layer. | |
void | channel_resized (int x, int y) |
This is called whenever the parent channel has been resized; it should do whatever needs to be done to adjust the layer to account for it. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef pvector< PointerTo< DisplayRegion > > | DisplayRegions |
Private Member Functions | |
GraphicsLayer () | |
Use GraphicsChannel::make_layer() to make a new layer. | |
GraphicsLayer (GraphicsChannel *channel) | |
Use GraphicsChannel::make_layer() to make a new layer. | |
GraphicsLayer (const GraphicsLayer ©) | |
void | operator= (const GraphicsLayer ©) |
void | win_display_regions_changed () |
Intended to be called when the active state on a nested channel or layer or display region changes, forcing the window to recompute its list of active display regions. | |
Private Attributes | |
Mutex | _lock |
GraphicsChannel * | _channel |
bool | _is_active |
DisplayRegions | _display_regions |
Static Private Attributes | |
TypeHandle | _type_handle |
Friends | |
class | GraphicsChannel |
class | GraphicsWindow |
class | DisplayRegion |
When the channel renders, it will render all of its layers in index number order; each layer may overlap some or all of its DisplayRegions with other layers, and they will be drawn sequentially without clearing the framebuffer between layers.
Definition at line 57 of file graphicsLayer.h.
|
Definition at line 95 of file graphicsLayer.h. |
|
Use GraphicsChannel::make_layer() to make a new layer.
Definition at line 45 of file graphicsLayer.cxx. References _is_active. |
|
Use GraphicsChannel::make_layer() to make a new layer.
Definition at line 61 of file graphicsLayer.cxx. References nassertv. |
|
Definition at line 75 of file graphicsLayer.cxx. |
|
Definition at line 99 of file graphicsLayer.cxx. |
|
This is called whenever the parent channel has been resized; it should do whatever needs to be done to adjust the layer to account for it.
Definition at line 342 of file graphicsLayer.cxx. |
|
Reimplemented from TypedReferenceCount. Definition at line 111 of file graphicsLayer.h. |
|
Returns the GraphicsChannel that this layer is associated with. It is possible that the GraphicsChannel might have been deleted while an outstanding PT(GraphicsLayer) prevented all of its children layers from also being deleted; in this unlikely case, get_channel() may return NULL. Definition at line 269 of file graphicsLayer.cxx. References _display_regions, _lock, x, and y. Referenced by DisplayRegion::get_top(). |
|
Reimplemented from TypedReferenceCount. Definition at line 100 of file graphicsLayer.h. |
|
Returns the nth DisplayRegion associated with the layer. This might return NULL if another thread has recently removed a DisplayRegion. Definition at line 189 of file graphicsLayer.cxx. References _display_regions, DisplayRegion::_layer, _lock, NULL, PT, and win_display_regions_changed(). |
|
Returns the number of DisplayRegions associated with the layer.
Definition at line 171 of file graphicsLayer.cxx. References _display_regions, _lock, nassertv, NULL, and win_display_regions_changed(). |
|
Returns the GraphicsPipe that this layer is ultimately associated with, or NULL if no pipe is associated.
Definition at line 305 of file graphicsLayer.cxx. |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Reimplemented from TypedReferenceCount. Definition at line 108 of file graphicsLayer.h. |
|
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). Definition at line 71 of file typedObject.I. References TypeHandle::get_name(), TypedObject::get_type(), and INLINE. |
|
Returns the GraphicsWindow that this layer is ultimately associated with, or NULL if no window is associated.
Definition at line 287 of file graphicsLayer.cxx. References _channel, NULL, and GraphicsChannel::win_display_regions_changed(). Referenced by DisplayRegion::set_dimensions(). |
|
Reimplemented from TypedReferenceCount. Definition at line 103 of file graphicsLayer.h. |
|
Returns the active flag on the layer.
Definition at line 32 of file graphicsLayer.I. Referenced by GraphicsWindow::process_events(). |
|
Returns true if the current object is the indicated type exactly.
Definition at line 101 of file typedObject.I. Referenced by PT(), and CollisionNode::xform(). |
|
|
Creates a new DisplayRegion that covers the indicated sub-rectangle within the layer.
Definition at line 150 of file graphicsLayer.cxx. References _display_regions, _lock, and NULL. |
|
Creates a new DisplayRegion that covers the entire layer.
Definition at line 130 of file graphicsLayer.cxx. References _display_regions. |
|
Definition at line 87 of file graphicsLayer.cxx. References _display_regions, and NULL. |
|
Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Removes (and possibly deletes) the indicated DisplayRegion associated with the layer. All subsequent index numbers will shift down one. Returns true if the DisplayRegion was removed, false if it was not a member of the layer. Definition at line 236 of file graphicsLayer.cxx. References _channel, _lock, GraphicsChannel::get_pipe(), and NULL. |
|
Removes (and possibly deletes) the nth DisplayRegion associated with the layer. All subsequent index numbers will shift down one. Definition at line 211 of file graphicsLayer.cxx. |
|
Sets the active flag on the layer. If the layer is marked as inactive, nothing will be rendered. Definition at line 321 of file graphicsLayer.cxx. |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete(). User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it. The return value is the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Intended to be called when the active state on a nested channel or layer or display region changes, forcing the window to recompute its list of active display regions. It is assumed the lock is already held. Definition at line 371 of file graphicsLayer.cxx. Referenced by get_dr(), and get_num_drs(). |
|
Definition at line 118 of file graphicsLayer.h. |
|
Definition at line 116 of file graphicsLayer.h. |
|
Definition at line 117 of file graphicsLayer.h. |
|
Definition at line 92 of file graphicsLayer.h. Referenced by get_window(), and remove_dr(). |
|
Definition at line 96 of file graphicsLayer.h. Referenced by get_channel(), get_dr(), get_num_drs(), make_display_region(), operator=(), and GraphicsWindow::process_events(). |
|
Definition at line 93 of file graphicsLayer.h. Referenced by GraphicsLayer(). |
|
Definition at line 91 of file graphicsLayer.h. Referenced by get_channel(), get_dr(), get_num_drs(), make_display_region(), and remove_dr(). |
|
Reimplemented from TypedReferenceCount. Definition at line 32 of file graphicsLayer.cxx. |