Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

GraphicsChannel Class Reference

This represents a single hardware output. More...

#include <graphicsChannel.h>

Inheritance diagram for GraphicsChannel:

TypedReferenceCount TypedObject ReferenceCount HardwareChannel List of all members.

Public Member Functions

 GraphicsChannel (GraphicsWindow *window)
 This is public just so derived window types can easily call it.

virtual ~GraphicsChannel ()
GraphicsLayermake_layer (int index=-1)
 Creates a new GraphicsLayer, associated with the window, at the indicated index position.

int get_num_layers () const
 Returns the number of layers currently associated with the channel.

GraphicsLayerget_layer (int index) const
 Returns the nth layer associated with the channel.

void move_layer (int from_index, int to_index)
 Changes the ordering of the layers so that the indicated layer will move to the indicated position.

void remove_layer (int index)
 Removes the nth layer.

GraphicsWindowget_window () const
 Returns the GraphicsWindow that this channel is associated with.

GraphicsPipeget_pipe () const
 Returns the GraphicsPipe that this channel is ultimately associated with, or NULL if no pipe is associated.

void set_active (bool active)
 Sets the active flag on the channel.

bool is_active () const
 Returns the active flag on the channel.

virtual void window_resized (int x_size, int y_size)
 This is called whenever the parent window has been resized; it should do whatever needs to be done to adjust the channel 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 ()

Protected Types

typedef pvector< PointerTo<
GraphicsLayer > > 
GraphicsLayers

Protected Member Functions

 GraphicsChannel ()

Protected Attributes

Mutex _lock
GraphicsWindow_window
bool _is_active
GraphicsLayers _layers

Private Member Functions

 GraphicsChannel (const GraphicsChannel &copy)
void operator= (const GraphicsChannel &copy)
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.


Static Private Attributes

TypeHandle _type_handle

Friends

class GraphicsWindow
class GraphicsLayer

Detailed Description

This represents a single hardware output.

Typically there is exactly one channel per window, but some implementations (e.g. SGI) support potentially several different video channel ports connected to different parts within a window.

Definition at line 51 of file graphicsChannel.h.


Member Typedef Documentation

typedef pvector< PointerTo< GraphicsLayer > > GraphicsChannel::GraphicsLayers [protected]
 

Definition at line 87 of file graphicsChannel.h.


Constructor & Destructor Documentation

GraphicsChannel::GraphicsChannel  )  [protected]
 

Definition at line 40 of file graphicsChannel.cxx.

References _is_active.

GraphicsChannel::GraphicsChannel GraphicsWindow window  ) 
 

This is public just so derived window types can easily call it.

Don't call it directly; instead, use GraphicsWindow::get_channel() to get a channel.

Definition at line 58 of file graphicsChannel.cxx.

References INLINE, and nassertv.

GraphicsChannel::GraphicsChannel const GraphicsChannel &  copy  )  [inline, private]
 

Definition at line 72 of file graphicsChannel.cxx.

GraphicsChannel::~GraphicsChannel  )  [virtual]
 

Definition at line 96 of file graphicsChannel.cxx.


Member Function Documentation

virtual TypeHandle GraphicsChannel::force_init_type void   )  [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Reimplemented in HardwareChannel.

Definition at line 102 of file graphicsChannel.h.

TypeHandle GraphicsChannel::get_class_type void   )  [inline, static]
 

Reimplemented from TypedReferenceCount.

Reimplemented in HardwareChannel.

Definition at line 91 of file graphicsChannel.h.

GraphicsLayer * GraphicsChannel::get_layer int  index  )  const
 

Returns the nth layer associated with the channel.

Definition at line 170 of file graphicsChannel.cxx.

int GraphicsChannel::get_num_layers  )  const
 

Returns the number of layers currently associated with the channel.

Definition at line 156 of file graphicsChannel.cxx.

References _layers, _lock, nassertv, and PT.

GraphicsPipe * GraphicsChannel::get_pipe  )  const
 

Returns the GraphicsPipe that this channel is ultimately associated with, or NULL if no pipe is associated.

Definition at line 268 of file graphicsChannel.cxx.

Referenced by GraphicsLayer::remove_dr().

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

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().

virtual TypeHandle GraphicsChannel::get_type void   )  const [inline, virtual]
 

Reimplemented from TypedReferenceCount.

Reimplemented in HardwareChannel.

Definition at line 99 of file graphicsChannel.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

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.

GraphicsWindow * GraphicsChannel::get_window  )  const
 

Returns the GraphicsWindow that this channel is associated with.

It is possible that the GraphicsWindow might have been deleted while an outstanding PT(GraphicsChannel) prevented all of its children channels from also being deleted; in this unlikely case, get_window() may return NULL.

Definition at line 250 of file graphicsChannel.cxx.

void GraphicsChannel::init_type void   )  [inline, static]
 

Reimplemented from TypedReferenceCount.

Reimplemented in HardwareChannel.

Definition at line 94 of file graphicsChannel.h.

bool GraphicsChannel::is_active  )  const [inline]
 

Returns the active flag on the channel.

Definition at line 32 of file graphicsChannel.I.

Referenced by GraphicsWindow::process_events().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

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().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

GraphicsLayer * GraphicsChannel::make_layer int  index = -1  ) 
 

Creates a new GraphicsLayer, associated with the window, at the indicated index position.

If the index position negative or past the end of the array, the end of the array is assumed. The layers will be rendered on top of each other, in increasing order by index, from back to front.

Definition at line 134 of file graphicsChannel.cxx.

References _layers, _lock, and NULL.

void GraphicsChannel::move_layer int  from_index,
int  to_index
 

Changes the ordering of the layers so that the indicated layer will move to the indicated position.

If to_index is negative or past the end of the array, the end of the array is assumed.

Definition at line 193 of file graphicsChannel.cxx.

References _lock, and _window.

void GraphicsChannel::operator= const GraphicsChannel &  copy  )  [inline, private]
 

Definition at line 84 of file graphicsChannel.cxx.

References _layers, and NULL.

int ReferenceCount::ref  )  const [inline, inherited]
 

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().

void GraphicsChannel::remove_layer int  index  ) 
 

Removes the nth layer.

This changes the numbers of all subsequent layers.

Definition at line 225 of file graphicsChannel.cxx.

References _is_active, _lock, and win_display_regions_changed().

void GraphicsChannel::set_active bool  active  ) 
 

Sets the active flag on the channel.

If the channel is marked as inactive, nothing will be rendered.

Definition at line 284 of file graphicsChannel.cxx.

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

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().

int ReferenceCount::unref  )  const [inline, inherited]
 

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().

void GraphicsChannel::win_display_regions_changed  )  [private]
 

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 335 of file graphicsChannel.cxx.

Referenced by GraphicsLayer::get_window(), and remove_layer().

void GraphicsChannel::window_resized int  x_size,
int  y_size
[virtual]
 

This is called whenever the parent window has been resized; it should do whatever needs to be done to adjust the channel to account for it.

Reimplemented in HardwareChannel.

Definition at line 305 of file graphicsChannel.cxx.

Referenced by GraphicsWindow::begin_flip().


Friends And Related Function Documentation

friend class GraphicsLayer [friend]
 

Definition at line 108 of file graphicsChannel.h.

friend class GraphicsWindow [friend]
 

Definition at line 107 of file graphicsChannel.h.


Member Data Documentation

bool GraphicsChannel::_is_active [protected]
 

Definition at line 85 of file graphicsChannel.h.

Referenced by GraphicsChannel(), and remove_layer().

GraphicsLayers GraphicsChannel::_layers [protected]
 

Definition at line 88 of file graphicsChannel.h.

Referenced by get_num_layers(), make_layer(), operator=(), and GraphicsWindow::process_events().

Mutex GraphicsChannel::_lock [protected]
 

Definition at line 83 of file graphicsChannel.h.

Referenced by get_num_layers(), make_layer(), move_layer(), and remove_layer().

TypeHandle GraphicsChannel::_type_handle [static, private]
 

Reimplemented from TypedReferenceCount.

Reimplemented in HardwareChannel.

Definition at line 30 of file graphicsChannel.cxx.

GraphicsWindow* GraphicsChannel::_window [protected]
 

Definition at line 84 of file graphicsChannel.h.

Referenced by move_layer().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:51:19 2003 for Panda by doxygen1.3