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

HardwareChannel Class Reference

Video output channels if available on the current platform NOTE: hardware channels belong to a pipe rather than to a particular window. More...

#include <hardwareChannel.h>

Inheritance diagram for HardwareChannel:

GraphicsChannel TypedReferenceCount TypedObject ReferenceCount List of all members.

Public Member Functions

 HardwareChannel (GraphicsWindow *window)
 ~HardwareChannel (void)
virtual void window_resized (int x, int y)
 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.

int get_id (void) const
int get_xorg (void) const
int get_yorg (void) const
int get_xsize (void) const
int get_ysize (void) const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
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.

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 Attributes

int _id
int _xorg
int _yorg
int _xsize
int _ysize
Mutex _lock
GraphicsWindow_window
bool _is_active
GraphicsLayers _layers

Static Private Attributes

TypeHandle _type_handle

Detailed Description

Video output channels if available on the current platform NOTE: hardware channels belong to a pipe rather than to a particular window.

Definition at line 52 of file hardwareChannel.h.


Member Typedef Documentation

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

Definition at line 87 of file graphicsChannel.h.


Constructor & Destructor Documentation

HardwareChannel::HardwareChannel GraphicsWindow window  ) 
 

Definition at line 40 of file hardwareChannel.cxx.

HardwareChannel::~HardwareChannel void   ) 
 

Definition at line 60 of file hardwareChannel.cxx.


Member Function Documentation

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

Reimplemented from GraphicsChannel.

Definition at line 88 of file hardwareChannel.h.

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

Reimplemented from GraphicsChannel.

Definition at line 77 of file hardwareChannel.h.

int HardwareChannel::get_id void   )  const [inline]
 

Definition at line 29 of file hardwareChannel.I.

References _xorg, and INLINE.

GraphicsLayer * GraphicsChannel::get_layer int  index  )  const [inherited]
 

Returns the nth layer associated with the channel.

Definition at line 170 of file graphicsChannel.cxx.

int GraphicsChannel::get_num_layers  )  const [inherited]
 

Returns the number of layers currently associated with the channel.

Definition at line 156 of file graphicsChannel.cxx.

References GraphicsChannel::_layers, GraphicsChannel::_lock, nassertv, and PT.

GraphicsPipe * GraphicsChannel::get_pipe  )  const [inherited]
 

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 HardwareChannel::get_type void   )  const [inline, virtual]
 

Reimplemented from GraphicsChannel.

Definition at line 85 of file hardwareChannel.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 [inherited]
 

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.

int HardwareChannel::get_xorg void   )  const [inline]
 

Definition at line 41 of file hardwareChannel.I.

References _yorg, and INLINE.

int HardwareChannel::get_xsize void   )  const [inline]
 

Definition at line 65 of file hardwareChannel.I.

References _ysize.

int HardwareChannel::get_yorg void   )  const [inline]
 

Definition at line 53 of file hardwareChannel.I.

References _xsize, and INLINE.

int HardwareChannel::get_ysize void   )  const [inline]
 

Definition at line 77 of file hardwareChannel.I.

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

Reimplemented from GraphicsChannel.

Definition at line 80 of file hardwareChannel.h.

bool GraphicsChannel::is_active  )  const [inline, inherited]
 

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  )  [inherited]
 

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 GraphicsChannel::_layers, GraphicsChannel::_lock, and NULL.

void GraphicsChannel::move_layer int  from_index,
int  to_index
[inherited]
 

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 GraphicsChannel::_lock, and GraphicsChannel::_window.

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  )  [inherited]
 

Removes the nth layer.

This changes the numbers of all subsequent layers.

Definition at line 225 of file graphicsChannel.cxx.

References GraphicsChannel::_is_active, GraphicsChannel::_lock, and GraphicsChannel::win_display_regions_changed().

void GraphicsChannel::set_active bool  active  )  [inherited]
 

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 HardwareChannel::window_resized int  x,
int  y
[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 from GraphicsChannel.

Definition at line 77 of file hardwareChannel.cxx.


Member Data Documentation

int HardwareChannel::_id [protected]
 

Definition at line 69 of file hardwareChannel.h.

bool GraphicsChannel::_is_active [protected, inherited]
 

Definition at line 85 of file graphicsChannel.h.

Referenced by GraphicsChannel::GraphicsChannel(), and GraphicsChannel::remove_layer().

GraphicsLayers GraphicsChannel::_layers [protected, inherited]
 

Definition at line 88 of file graphicsChannel.h.

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

Mutex GraphicsChannel::_lock [protected, inherited]
 

Definition at line 83 of file graphicsChannel.h.

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

TypeHandle HardwareChannel::_type_handle [static, private]
 

Reimplemented from GraphicsChannel.

Definition at line 30 of file hardwareChannel.cxx.

GraphicsWindow* GraphicsChannel::_window [protected, inherited]
 

Definition at line 84 of file graphicsChannel.h.

Referenced by GraphicsChannel::move_layer().

int HardwareChannel::_xorg [protected]
 

Definition at line 70 of file hardwareChannel.h.

Referenced by get_id().

int HardwareChannel::_xsize [protected]
 

Definition at line 72 of file hardwareChannel.h.

Referenced by get_yorg().

int HardwareChannel::_yorg [protected]
 

Definition at line 71 of file hardwareChannel.h.

Referenced by get_xorg().

int HardwareChannel::_ysize [protected]
 

Definition at line 73 of file hardwareChannel.h.

Referenced by get_xsize().


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