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

GraphicsWindow Class Reference

An output medium for receiving the results of rendering. More...

#include <graphicsWindow.h>

Inheritance diagram for GraphicsWindow:

TypedReferenceCount ClearableRegion TypedObject ReferenceCount glxGraphicsWindow RIBGraphicsWindow wcrGraphicsWindow WinGraphicsWindow wdxGraphicsWindow7 wdxGraphicsWindow8 wglGraphicsWindow List of all members.

Public Member Functions

virtual ~GraphicsWindow ()
WindowProperties get_properties () const
 Returns the current properties of the window.

WindowProperties get_requested_properties () const
 Returns the properties of the window that are currently requested.

void clear_rejected_properties ()
 Empties the set of failed properties that will be returned by get_rejected_properties().

WindowProperties get_rejected_properties () const
 Returns the set of properties that have recently been requested, but could not be applied to the window for some reason.

void request_properties (const WindowProperties &requested_properties)
 Requests a property change on the window.

bool is_closed () const
 Returns true if the window has not yet been opened, or has been fully closed, false if it is open.

bool is_active () const
 Returns true if the window is ready to be rendered into, false otherwise.

bool is_fullscreen () const
 Returns true if the window has been opened as a fullscreen window, false otherwise.

void set_window_event (const string &window_event)
 Changes the name of the event that is generated when this window is modified externally, e.g.

string get_window_event () const
 Returns the name of the event that is generated when this window is modified externally, e.g.

GraphicsStateGuardianget_gsg () const
 Returns the GSG that is associated with this window.

GraphicsPipeget_pipe () const
 Returns the GraphicsPipe that this window is associated with.

GraphicsChannelget_channel (int index)
 Returns a GraphicsChannel pointer that can be used to access the indicated channel number.

void remove_channel (int index)
 Deletes a GraphicsChannel that was previously created via a call to get_channel().

int get_max_channel_index () const
 Returns the largest channel index number yet created, plus 1.

bool is_channel_defined (int index) const
 Returns true if the channel with the given index number has already been defined, false if it hasn't.

int get_num_display_regions () const
 Returns the number of active DisplayRegions that have been created within the various layers and channels of the window.

DisplayRegionget_display_region (int n) const
 Returns the nth active DisplayRegion of those that have been created within the various layers and channels of the window.

int get_num_input_devices () const
 Returns the number of separate input devices associated with the window.

string get_input_device_name (int device) const
 Returns the name of the nth input device.

bool has_pointer (int device) const
 Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise.

bool has_keyboard (int device) const
 Returns true if the nth input device has a keyboard, false otherwise.

MouseData get_mouse_data (int device) const
 Returns the MouseData associated with the nth input device.

bool has_button_event (int device) const
 Returns true if the indicated device has a pending button event (a mouse button or keyboard button down/up), false otherwise.

ButtonEvent get_button_event (int device)
 Assuming a previous call to has_button_event() returned true, this returns the pending button event.

virtual int verify_window_sizes (int numsizes, int *dimen)
 Determines which of the indicated window sizes are supported by available hardware (e.g.

PointerTo< DisplayRegionmake_scratch_display_region (int x_size, int y_size) const
 Allocates and returns a temporary DisplayRegion that may be used to render offscreen into.

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.

virtual bool begin_frame ()
 This function will be called within the draw thread before beginning rendering for a given frame.

void clear ()
 Clears the entire framebuffer before rendering, according to the settings of get_color_clear_active() and get_depth_clear_active() (inherited from ClearableRegion).

virtual void end_frame ()
 This function will be called within the draw thread after rendering is completed for a given frame.

virtual void make_current ()
 This function will be called within the draw thread during begin_frame() to ensure the graphics context is ready for drawing.

virtual void release_gsg ()
 Releases the current GSG pointer, if it is currently held, and resets the GSG to NULL.

virtual void begin_flip ()
 This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.

virtual void end_flip ()
 This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.

virtual void process_events ()
 Do whatever processing is necessary to ensure that the window responds to user events.

virtual void set_properties_now (WindowProperties &properties)
 Applies the requested set of properties to the window, if possible, for instance to request a change in size or minimization status.

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.

void copy_clear_settings (const ClearableRegion &copy)
 A convenience function that does the same thing as the assignment operator; this is just syntactically a little nicer (and a little clearer) to call from a derived class.

void set_clear_color_active (bool clear_color_active)
 Toggles the flag that indicates whether the color buffer should be cleared every frame.

bool get_clear_color_active () const
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.

void set_clear_depth_active (bool clear_depth_active)
 Toggles the flag that indicates whether the depth buffer should be cleared every frame.

bool get_clear_depth_active () const
 Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame.

void set_clear_color (const Colorf &color)
 Sets the clear color to the indicated value.

const Colorfget_clear_color () const
 Returns the current clear color value.

void set_clear_depth (float depth)
 Sets the clear depth to the indicated value.

float get_clear_depth () const
 Returns the current clear depth value.

bool is_any_clear_active () const
 Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Protected Types

typedef vector_GraphicsWindowInputDevice InputDevices

Protected Member Functions

 GraphicsWindow (GraphicsPipe *pipe, GraphicsStateGuardian *gsg)
 Normally, the GraphicsWindow constructor is not called directly; these are created instead via the GraphicsEngine::make_window() function.

virtual void close_window ()
 Closes the window right now.

virtual bool open_window ()
 Opens the window right now.

virtual bool do_reshape_request (int x_origin, int y_origin, int x_size, int y_size)
 Called from the window thread in response to a request from within the code (via request_properties()) to change the size and/or position of the window.

void declare_channel (int index, GraphicsChannel *chan)
 An internal function to add the indicated newly-created channel to the list at the indicated channel number.

void system_changed_properties (const WindowProperties &properties)
 Should be called (from within the window thread) when process_events() detects an external change in some important window property; for instance, when the user resizes the window.

void system_changed_size (int x_size, int y_size)
 An internal function to update all the channels with the new size of the window.


Protected Attributes

InputDevices _input_devices
Mutex _input_lock
PointerTo< GraphicsStateGuardian_gsg
PointerTo< GraphicsPipe_pipe
WindowProperties _properties

Private Types

typedef pvector< PointerTo<
GraphicsChannel > > 
Channels
typedef pvector< DisplayRegion * > DisplayRegions

Private Member Functions

 GraphicsWindow (const GraphicsWindow &copy)
void operator= (const GraphicsWindow &copy)
void determine_display_regions () const
 Recomputes the list of active DisplayRegions within the window, if they have changed recently.

void do_determine_display_regions ()
 Recomputes the list of active DisplayRegions within the window.


Private Attributes

Mutex _lock
Channels _channels
DisplayRegions _display_regions
bool _display_regions_stale
WindowProperties _requested_properties
WindowProperties _rejected_properties
string _window_event

Static Private Attributes

TypeHandle _type_handle

Friends

class GraphicsPipe
class GraphicsEngine

Detailed Description

An output medium for receiving the results of rendering.

Typically this is a window on the computer desktop, but it may also be the entire desktop or console screen (i.e. a fullscreen window), or a window on another machine, or even a disk file.

The GraphicsWindow class handles all of the details about creating a window and its framebuffer, and managing the properties associated with the windowing system, such as position and size and keyboard/mouse input. The actual rendering, and anything associated with the graphics context itself, is managed by the window's GraphicsStateGuardian.

Definition at line 77 of file graphicsWindow.h.


Member Typedef Documentation

typedef pvector< PointerTo< GraphicsChannel > > GraphicsWindow::Channels [private]
 

Definition at line 187 of file graphicsWindow.h.

typedef pvector<DisplayRegion *> GraphicsWindow::DisplayRegions [private]
 

Definition at line 190 of file graphicsWindow.h.

typedef vector_GraphicsWindowInputDevice GraphicsWindow::InputDevices [protected]
 

Definition at line 169 of file graphicsWindow.h.


Constructor & Destructor Documentation

GraphicsWindow::GraphicsWindow GraphicsPipe pipe,
GraphicsStateGuardian gsg
[protected]
 

Normally, the GraphicsWindow constructor is not called directly; these are created instead via the GraphicsEngine::make_window() function.

Definition at line 48 of file graphicsWindow.cxx.

References _display_regions_stale, _properties, and _window_event.

GraphicsWindow::GraphicsWindow const GraphicsWindow &  copy  )  [private]
 

Definition at line 80 of file graphicsWindow.cxx.

References nassertv.

GraphicsWindow::~GraphicsWindow  )  [virtual]
 

Definition at line 104 of file graphicsWindow.cxx.


Member Function Documentation

void GraphicsWindow::begin_flip  )  [virtual]
 

This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.

This should instruct the window to prepare for the flip at the next video sync, but it should not wait.

We have the two separate functions, begin_flip() and end_flip(), to make it easier to flip all of the windows at the same time.

Reimplemented in glxGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 887 of file graphicsWindow.cxx.

References _channels, _properties, WindowProperties::get_x_size(), WindowProperties::get_y_size(), and GraphicsChannel::window_resized().

bool GraphicsWindow::begin_frame  )  [virtual]
 

This function will be called within the draw thread before beginning rendering for a given frame.

It should do whatever setup is required, and return true if the frame should be rendered, or false if it should be skipped.

Reimplemented in wdxGraphicsWindow8, glxGraphicsWindow, and RIBGraphicsWindow.

Definition at line 758 of file graphicsWindow.cxx.

void GraphicsWindow::clear  ) 
 

Clears the entire framebuffer before rendering, according to the settings of get_color_clear_active() and get_depth_clear_active() (inherited from ClearableRegion).

This function is called only within the draw thread.

Definition at line 787 of file graphicsWindow.cxx.

References _properties, WindowProperties::add_properties(), WindowProperties::clear_origin(), WindowProperties::clear_size(), do_reshape_request(), WindowProperties::get_x_origin(), WindowProperties::get_x_size(), WindowProperties::get_y_origin(), WindowProperties::get_y_size(), WindowProperties::has_origin(), WindowProperties::has_size(), is_fullscreen(), WindowProperties::set_origin(), WindowProperties::set_size(), and system_changed_size().

void GraphicsWindow::clear_rejected_properties  ) 
 

Empties the set of failed properties that will be returned by get_rejected_properties().

Definition at line 174 of file graphicsWindow.cxx.

References _lock, _requested_properties, and WindowProperties::add_properties().

void GraphicsWindow::close_window  )  [protected, virtual]
 

Closes the window right now.

Called from the window thread.

Reimplemented in glxGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 1088 of file graphicsWindow.cxx.

Referenced by wcrGraphicsWindow::do_close_window().

void ClearableRegion::copy_clear_settings const ClearableRegion copy  )  [inline, inherited]
 

A convenience function that does the same thing as the assignment operator; this is just syntactically a little nicer (and a little clearer) to call from a derived class.

Definition at line 85 of file clearableRegion.I.

References ClearableRegion::_flags, and ClearableRegion::F_clear_color_active.

void GraphicsWindow::declare_channel int  index,
GraphicsChannel chan
[protected]
 

An internal function to add the indicated newly-created channel to the list at the indicated channel number.

The caller must grab and hold _lock before making this call.

Definition at line 1203 of file graphicsWindow.cxx.

Referenced by get_window_event().

void GraphicsWindow::determine_display_regions  )  const [inline, private]
 

Recomputes the list of active DisplayRegions within the window, if they have changed recently.

Definition at line 160 of file graphicsWindow.I.

Referenced by remove_channel().

void GraphicsWindow::do_determine_display_regions  )  [private]
 

Recomputes the list of active DisplayRegions within the window.

Definition at line 1227 of file graphicsWindow.cxx.

bool GraphicsWindow::do_reshape_request int  x_origin,
int  y_origin,
int  x_size,
int  y_size
[protected, virtual]
 

Called from the window thread in response to a request from within the code (via request_properties()) to change the size and/or position of the window.

Returns true if the window is successfully changed, or false if there was a problem.

Reimplemented in WinGraphicsWindow.

Definition at line 1125 of file graphicsWindow.cxx.

Referenced by clear().

void GraphicsWindow::end_flip  )  [virtual]
 

This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.

This should cause the window to wait for the flip, if necessary.

Reimplemented in wdxGraphicsWindow7, and wdxGraphicsWindow8.

Definition at line 909 of file graphicsWindow.cxx.

References _channels, nassertv, and NULL.

void GraphicsWindow::end_frame  )  [virtual]
 

This function will be called within the draw thread after rendering is completed for a given frame.

It should do whatever finalization is required.

Reimplemented in RIBGraphicsWindow, and wcrGraphicsWindow.

Definition at line 818 of file graphicsWindow.cxx.

Referenced by RIBGraphicsWindow::begin_frame().

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

Reimplemented from TypedReferenceCount.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 210 of file graphicsWindow.h.

ButtonEvent GraphicsWindow::get_button_event int  device  ) 
 

Assuming a previous call to has_button_event() returned true, this returns the pending button event.

Definition at line 642 of file graphicsWindow.cxx.

References _gsg, and PointerTo< GraphicsStateGuardian >::clear().

GraphicsChannel * GraphicsWindow::get_channel int  index  ) 
 

Returns a GraphicsChannel pointer that can be used to access the indicated channel number.

All windows have at least one channel, channel 0, which corresponds to the entire window. If the hardware supports it, some kinds of windows may also have a number of hardware channels available at indices 1..n, which will correspond to a subregion of the window.

This function returns a GraphicsChannel pointer if a channel is available, or NULL if it is not. If called twice with the same index number, it will return the same pointer.

Definition at line 313 of file graphicsWindow.cxx.

Referenced by ChanConfig::chan_eval().

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

Reimplemented from TypedReferenceCount.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 199 of file graphicsWindow.h.

const Colorf & ClearableRegion::get_clear_color  )  const [inline, inherited]
 

Returns the current clear color value.

This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.

Definition at line 211 of file clearableRegion.I.

bool ClearableRegion::get_clear_color_active  )  const [inline, inherited]
 

Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.

See set_clear_color_active().

Definition at line 127 of file clearableRegion.I.

References ClearableRegion::_flags, and ClearableRegion::F_clear_depth_active.

float ClearableRegion::get_clear_depth  )  const [inline, inherited]
 

Returns the current clear depth value.

This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.

Definition at line 253 of file clearableRegion.I.

bool ClearableRegion::get_clear_depth_active  )  const [inline, inherited]
 

Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame.

See set_clear_depth_active().

Definition at line 169 of file clearableRegion.I.

References ClearableRegion::_clear_depth.

DisplayRegion * GraphicsWindow::get_display_region int  n  )  const
 

Returns the nth active DisplayRegion of those that have been created within the various layers and channels of the window.

This may return NULL if n is out of bounds; particularly likely if the number of display regions has changed since the last call to get_num_display_regions().

Definition at line 478 of file graphicsWindow.cxx.

References _input_devices, _input_lock, and nassertr.

GraphicsStateGuardian * GraphicsWindow::get_gsg  )  const [inline]
 

Returns the GSG that is associated with this window.

There is a one-to-one association between windows and GSG's.

This may return NULL if the graphics context has not yet been created for the window, e.g. before the first frame has rendered; or after the window has been closed.

Definition at line 102 of file graphicsWindow.I.

Referenced by NonlinearImager::set_texture_size().

string GraphicsWindow::get_input_device_name int  device  )  const
 

Returns the name of the nth input device.

Definition at line 529 of file graphicsWindow.cxx.

int GraphicsWindow::get_max_channel_index  )  const
 

Returns the largest channel index number yet created, plus 1.

All channels associated with this window will have an index number in the range [0, get_max_channel_index()). This function, in conjunction with is_channel_defined(), below, may be used to determine the complete set of channels associated with the window.

Definition at line 395 of file graphicsWindow.cxx.

References _input_devices, and _input_lock.

MouseData GraphicsWindow::get_mouse_data int  device  )  const
 

Returns the MouseData associated with the nth input device.

Definition at line 594 of file graphicsWindow.cxx.

References _gsg, _lock, _properties, PointerTo< GraphicsStateGuardian >::clear(), WindowProperties::get_x_size(), WindowProperties::get_y_size(), ClearableRegion::is_any_clear_active(), make_scratch_display_region(), nassertv, NULL, and PT.

int GraphicsWindow::get_num_display_regions  )  const
 

Returns the number of active DisplayRegions that have been created within the various layers and channels of the window.

Definition at line 449 of file graphicsWindow.cxx.

References _input_devices.

int GraphicsWindow::get_num_input_devices  )  const
 

Returns the number of separate input devices associated with the window.

Typically, a window will have exactly one input device: the keyboard/mouse pair. However, some windows may have no input devices, and others may add additional devices, for instance for a joystick.

Definition at line 511 of file graphicsWindow.cxx.

GraphicsPipe * GraphicsWindow::get_pipe  )  const [inline]
 

Returns the GraphicsPipe that this window is associated with.

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

Definition at line 125 of file graphicsWindow.I.

Referenced by GraphicsEngine::setup_scene().

WindowProperties GraphicsWindow::get_properties  )  const
 

Returns the current properties of the window.

Definition at line 130 of file graphicsWindow.cxx.

References _lock, and _requested_properties.

Referenced by wdxGraphicsWindow8::end_flip(), DisplayRegion::get_pipe(), and DisplayRegion::get_right().

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

WindowProperties GraphicsWindow::get_rejected_properties  )  const
 

Returns the set of properties that have recently been requested, but could not be applied to the window for some reason.

This set of properties will remain unchanged until they are changed by a new failed request, or clear_rejected_properties() is called.

Definition at line 196 of file graphicsWindow.cxx.

References _lock, and _window_event.

WindowProperties GraphicsWindow::get_requested_properties  )  const
 

Returns the properties of the window that are currently requested.

These properties will be applied to the window (if valid) at the next execution of process_events().

Definition at line 154 of file graphicsWindow.cxx.

References _lock, and _rejected_properties.

Referenced by DisplayRegion::get_pipe().

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

Reimplemented from TypedReferenceCount.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 207 of file graphicsWindow.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.

string GraphicsWindow::get_window_event  )  const
 

Returns the name of the event that is generated when this window is modified externally, e.g.

to be resized or closed by the user. See set_window_event().

Definition at line 272 of file graphicsWindow.cxx.

References declare_channel(), and NULL.

bool GraphicsWindow::has_button_event int  device  )  const
 

Returns true if the indicated device has a pending button event (a mouse button or keyboard button down/up), false otherwise.

If this returns true, the particular event may be extracted via get_button_event().

Definition at line 621 of file graphicsWindow.cxx.

References _gsg, nassertv, and NULL.

bool GraphicsWindow::has_keyboard int  device  )  const
 

Returns true if the nth input device has a keyboard, false otherwise.

Definition at line 573 of file graphicsWindow.cxx.

References _gsg, make_current(), and NULL.

bool GraphicsWindow::has_pointer int  device  )  const
 

Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise.

Definition at line 552 of file graphicsWindow.cxx.

References _properties, WindowProperties::get_x_size(), and WindowProperties::get_y_size().

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

Reimplemented from TypedReferenceCount.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 202 of file graphicsWindow.h.

bool GraphicsWindow::is_active  )  const [inline]
 

Returns true if the window is ready to be rendered into, false otherwise.

Definition at line 59 of file graphicsWindow.I.

References _gsg, and INLINE.

Referenced by wdxGraphicsWindow8::begin_frame().

bool ClearableRegion::is_any_clear_active  )  const [inline, inherited]
 

Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear.

Definition at line 272 of file clearableRegion.I.

Referenced by get_mouse_data().

bool GraphicsWindow::is_channel_defined int  index  )  const
 

Returns true if the channel with the given index number has already been defined, false if it hasn't.

If this returns true, calling get_channel() on the given index number will return the channel pointer. If it returns false, calling get_channel() will create and return a new channel pointer.

Definition at line 423 of file graphicsWindow.cxx.

References _input_devices, _input_lock, and nassertr.

bool GraphicsWindow::is_closed  )  const [inline]
 

Returns true if the window has not yet been opened, or has been fully closed, false if it is open.

The window is not opened immediately after GraphicsEngine::make_window() is called; nor is it closed immediately after GraphicsEngine::remove_window() is called. Either operation may take a frame or two.

Definition at line 44 of file graphicsWindow.I.

References _properties.

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 GraphicsWindow::is_fullscreen  )  const [inline]
 

Returns true if the window has been opened as a fullscreen window, false otherwise.

Definition at line 75 of file graphicsWindow.I.

References _pipe, and INLINE.

Referenced by clear(), and wdxGraphicsWindow8::create_screen_buffers_and_device().

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

void GraphicsWindow::make_current void   )  [virtual]
 

This function will be called within the draw thread during begin_frame() to ensure the graphics context is ready for drawing.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, and wglGraphicsWindow.

Definition at line 836 of file graphicsWindow.cxx.

Referenced by has_keyboard().

PointerTo< DisplayRegion > GraphicsWindow::make_scratch_display_region int  x_size,
int  y_size
const
 

Allocates and returns a temporary DisplayRegion that may be used to render offscreen into.

This DisplayRegion is not associated with any layer.

To allocate a normal DisplayRegion for rendering, use the interface provided in GraphicsLayer.

Definition at line 719 of file graphicsWindow.cxx.

Referenced by get_mouse_data().

bool GraphicsWindow::open_window void   )  [protected, virtual]
 

Opens the window right now.

Called from the window thread. Returns true if the window is successfully opened, or false if there was a problem.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 1104 of file graphicsWindow.cxx.

void GraphicsWindow::operator= const GraphicsWindow &  copy  )  [private]
 

Definition at line 92 of file graphicsWindow.cxx.

References _channels, _properties, and NULL.

void GraphicsWindow::process_events  )  [virtual]
 

Do whatever processing is necessary to ensure that the window responds to user events.

Also, honor any requests recently made via request_properties().

This function is called only within the window thread.

Reimplemented in glxGraphicsWindow, wcrGraphicsWindow, and WinGraphicsWindow.

Definition at line 931 of file graphicsWindow.cxx.

References _channels, GraphicsLayer::_display_regions, _display_regions, _display_regions_stale, GraphicsChannel::_layers, _lock, DisplayRegion::is_active(), GraphicsLayer::is_active(), and GraphicsChannel::is_active().

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 GraphicsWindow::release_gsg  )  [virtual]
 

Releases the current GSG pointer, if it is currently held, and resets the GSG to NULL.

The window will be permanently unable to render; this is normally called only just before destroying the window. This should only be called from within the draw thread.

Reimplemented in glxGraphicsWindow, and wglGraphicsWindow.

Definition at line 856 of file graphicsWindow.cxx.

Referenced by GraphicsEngine::WindowRenderer::add_gsg(), wglGraphicsWindow::make_current(), and glxGraphicsWindow::make_current().

void GraphicsWindow::remove_channel int  index  ) 
 

Deletes a GraphicsChannel that was previously created via a call to get_channel().

Note that the channel is not actually deleted until all pointers to it are cleared.

Definition at line 367 of file graphicsWindow.cxx.

References _display_regions, _lock, determine_display_regions(), and NULL.

void GraphicsWindow::request_properties const WindowProperties requested_properties  ) 
 

Requests a property change on the window.

For example, use this method to request a window change size or minimize or something.

The change is not made immediately; rather, the request is saved and will be applied the next time the window task is run (probably at the next frame).

Definition at line 226 of file graphicsWindow.cxx.

References _channels, _lock, nassertr, NULL, and PT.

void ClearableRegion::set_clear_color const Colorf color  )  [inline, inherited]
 

Sets the clear color to the indicated value.

This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.

Definition at line 190 of file clearableRegion.I.

References ClearableRegion::_flags, and INLINE.

void ClearableRegion::set_clear_color_active bool  clear_color_active  )  [inline, inherited]
 

Toggles the flag that indicates whether the color buffer should be cleared every frame.

If this is true, the color buffer will be cleared to the color indicated by set_clear_color(); otherwise, it will be left alone.

Definition at line 106 of file clearableRegion.I.

References ClearableRegion::_flags, ClearableRegion::F_clear_depth_active, and INLINE.

void ClearableRegion::set_clear_depth float  depth  )  [inline, inherited]
 

Sets the clear depth to the indicated value.

This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.

Definition at line 232 of file clearableRegion.I.

void ClearableRegion::set_clear_depth_active bool  clear_depth_active  )  [inline, inherited]
 

Toggles the flag that indicates whether the depth buffer should be cleared every frame.

If this is true, the depth buffer will be cleared to the depth value indicated by set_clear_depth(); otherwise, it will be left alone.

Definition at line 148 of file clearableRegion.I.

References ClearableRegion::_clear_color, Colorf, and INLINE.

void GraphicsWindow::set_properties_now WindowProperties properties  )  [virtual]
 

Applies the requested set of properties to the window, if possible, for instance to request a change in size or minimization status.

The window properties are applied immediately, rather than waiting until the next frame. This implies that this method may *only* be called from within the window thread.

The properties that have been applied are cleared from the structure by this function; so on return, whatever remains in the properties structure are those that were unchanged for some reason (probably because the underlying interface does not support changing that property on an open window).

Reimplemented in glxGraphicsWindow, and WinGraphicsWindow.

Definition at line 990 of file graphicsWindow.cxx.

Referenced by verify_window_sizes().

void GraphicsWindow::set_window_event const string &  window_event  ) 
 

Changes the name of the event that is generated when this window is modified externally, e.g.

to be resized or closed by the user.

By default, all windows have the same window event unless they are explicitly changed. When the event is generated, it includes one parameter: the window itself.

Definition at line 254 of file graphicsWindow.cxx.

void GraphicsWindow::system_changed_properties const WindowProperties properties  )  [protected]
 

Should be called (from within the window thread) when process_events() detects an external change in some important window property; for instance, when the user resizes the window.

Definition at line 1144 of file graphicsWindow.cxx.

void GraphicsWindow::system_changed_size int  x_size,
int  y_size
[protected]
 

An internal function to update all the channels with the new size of the window.

This should always be called before changing the _size members of the _properties structure.

Definition at line 1173 of file graphicsWindow.cxx.

Referenced by clear().

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

int GraphicsWindow::verify_window_sizes int  numsizes,
int *  dimen
[virtual]
 

Determines which of the indicated window sizes are supported by available hardware (e.g.

in fullscreen mode).

On entry, dimen is an array containing contiguous x,y pairs specifying possible display sizes; it is numsizes*2 words long. The function will zero out any invalid x,y size pairs. The return value is the number of valid sizes that were found.

Note this doesn't guarantee a resize attempt will work; you still need to check the return value.

(It might be better to implement some sort of query interface that returns an array of supported sizes, but this way is somewhat simpler and will do the job on most cards, assuming they handle the std sizes the app knows about.)

Reimplemented in wdxGraphicsWindow8.

Definition at line 696 of file graphicsWindow.cxx.

References _lock, _rejected_properties, _requested_properties, WindowProperties::add_properties(), WindowProperties::clear(), WindowProperties::is_any_specified(), and set_properties_now().

void GraphicsWindow::win_display_regions_changed  )  [inline]
 

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.

Definition at line 144 of file graphicsWindow.I.


Friends And Related Function Documentation

friend class GraphicsEngine [friend]
 

Definition at line 216 of file graphicsWindow.h.

friend class GraphicsPipe [friend]
 

Definition at line 215 of file graphicsWindow.h.


Member Data Documentation

Channels GraphicsWindow::_channels [private]
 

Definition at line 188 of file graphicsWindow.h.

Referenced by begin_flip(), end_flip(), operator=(), process_events(), and request_properties().

DisplayRegions GraphicsWindow::_display_regions [private]
 

Definition at line 191 of file graphicsWindow.h.

Referenced by process_events(), and remove_channel().

bool GraphicsWindow::_display_regions_stale [private]
 

Definition at line 192 of file graphicsWindow.h.

Referenced by GraphicsWindow(), and process_events().

PointerTo< GraphicsStateGuardian > GraphicsWindow::_gsg [protected]
 

Definition at line 173 of file graphicsWindow.h.

Referenced by glxGraphicsWindow::begin_frame(), get_button_event(), get_mouse_data(), has_button_event(), has_keyboard(), is_active(), RIBGraphicsWindow::set_image_filename_template(), glxGraphicsWindow::~glxGraphicsWindow(), and wglGraphicsWindow::~wglGraphicsWindow().

InputDevices GraphicsWindow::_input_devices [protected]
 

Definition at line 170 of file graphicsWindow.h.

Referenced by glxGraphicsWindow::begin_flip(), get_display_region(), get_max_channel_index(), get_num_display_regions(), glxGraphicsWindow::glxGraphicsWindow(), WinGraphicsWindow::handle_keyresume(), wcrGraphicsWindow::handle_mouse_motion(), wcrGraphicsWindow::handle_reshape(), is_channel_defined(), and glxGraphicsWindow::process_events().

Mutex GraphicsWindow::_input_lock [protected]
 

Definition at line 171 of file graphicsWindow.h.

Referenced by get_display_region(), get_max_channel_index(), and is_channel_defined().

Mutex GraphicsWindow::_lock [private]
 

Definition at line 184 of file graphicsWindow.h.

Referenced by clear_rejected_properties(), get_mouse_data(), get_properties(), get_rejected_properties(), get_requested_properties(), process_events(), remove_channel(), request_properties(), and verify_window_sizes().

PointerTo< GraphicsPipe > GraphicsWindow::_pipe [protected]
 

Definition at line 174 of file graphicsWindow.h.

Referenced by is_fullscreen(), and GraphicsEngine::setup_scene().

WindowProperties GraphicsWindow::_properties [protected]
 

Definition at line 181 of file graphicsWindow.h.

Referenced by begin_flip(), clear(), WinGraphicsWindow::do_fullscreen_resize(), get_mouse_data(), GraphicsWindow(), has_pointer(), is_closed(), operator=(), and WinGraphicsWindow::reconsider_fullscreen_size().

WindowProperties GraphicsWindow::_rejected_properties [private]
 

Definition at line 195 of file graphicsWindow.h.

Referenced by get_requested_properties(), and verify_window_sizes().

WindowProperties GraphicsWindow::_requested_properties [private]
 

Definition at line 194 of file graphicsWindow.h.

Referenced by clear_rejected_properties(), get_properties(), and verify_window_sizes().

TypeHandle GraphicsWindow::_type_handle [static, private]
 

Reimplemented from TypedReferenceCount.

Reimplemented in wdxGraphicsWindow7, wdxGraphicsWindow8, glxGraphicsWindow, RIBGraphicsWindow, wcrGraphicsWindow, wglGraphicsWindow, and WinGraphicsWindow.

Definition at line 33 of file graphicsWindow.cxx.

string GraphicsWindow::_window_event [private]
 

Definition at line 196 of file graphicsWindow.h.

Referenced by get_rejected_properties(), and GraphicsWindow().


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