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

wcrGraphicsWindow Class Reference

#include <wcrGraphicsWindow.h>

Inheritance diagram for wcrGraphicsWindow:

GraphicsWindow TypedReferenceCount ClearableRegion TypedObject ReferenceCount List of all members.

Public Member Functions

 wcrGraphicsWindow (GraphicsPipe *pipe)
 wcrGraphicsWindow (GraphicsPipe *pipe, const GraphicsWindow::Properties &props)
virtual ~wcrGraphicsWindow ()
virtual bool supports_update () const
 Returns true if this particular kind of GraphicsWindow supports use of the update() function to update the graphics one frame at a time, so that the window does not need to be the program's main loop.

virtual void update ()
virtual void end_frame ()
 Swaps the front and back buffers.

virtual void swap ()
 Swaps the front and back buffers explicitly.

virtual int get_depth_bitwidth ()
virtual TypeHandle get_gsg_type () const
 Returns the TypeHandle of the kind of GSG preferred by this kind of window.

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 unmake_current ()
bool mouse_entry_enabled ()
bool mouse_motion_enabled ()
bool mouse_passive_motion_enabled ()
void handle_mouse_motion (int x, int y)
void handle_mouse_entry (int state)
void handle_keypress (ButtonHandle key, int x, int y)
void handle_keyrelease (ButtonHandle key)
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
LONG WINAPI window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
ButtonHandle lookup_key (WPARAM wparam) const
void DestroyMe (bool bAtExitFnCalled)
virtual void deactivate_window ()
virtual void reactivate_window ()
virtual bool resize (unsigned int xsize, unsigned int ysize)
virtual unsigned int verify_window_sizes (unsigned int numsizes, unsigned int *dimen)
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 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 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.

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

GraphicsWindowmake_wcrGraphicsWindow (const FactoryParams &params)
TypeHandle get_class_type ()
void init_type ()

Public Attributes

HWND _mwindow

Protected Types

typedef vector_GraphicsWindowInputDevice InputDevices

Protected Member Functions

int choose_visual ()
virtual void config ()
void setup_colormap ()
void enable_mouse_input (bool val)
void enable_mouse_motion (bool val)
void enable_mouse_passive_motion (bool val)
void enable_mouse_entry (bool val)
void handle_reshape ()
void process_events ()
 Do whatever processing is necessary to ensure that the window responds to user events.

virtual void do_close_window ()
void check_for_color_cursor_support ()
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 Attributes

int _context
HDC _hdc
PIXELFORMATDESCRIPTOR _pixelformat
HPALETTE _colormap
HCURSOR _hMouseCursor
HWND _hOldForegroundWindow
UINT_PTR _PandaPausedTimer
DEVMODE * _pCurrent_display_settings
bool _bIsLowVidMemCard
bool _bLoadedCustomCursor
bool _window_inactive
bool _active_minimized_fullscreen
bool _return_control_to_app
bool _exiting_window
bool _mouse_input_enabled
bool _mouse_motion_enabled
bool _mouse_passive_motion_enabled
bool _mouse_entry_enabled
bool _ime_open
DWORD _start_time
DWORD _start_frame_count
DWORD _cur_frame_count
float _current_fps
string _extensions_str

Static Private Attributes

TypeHandle _type_handle

Member Typedef Documentation

typedef vector_GraphicsWindowInputDevice GraphicsWindow::InputDevices [protected, inherited]
 

Definition at line 169 of file graphicsWindow.h.


Constructor & Destructor Documentation

wcrGraphicsWindow::wcrGraphicsWindow GraphicsPipe pipe  ) 
 

Definition at line 662 of file wcrGraphicsWindow.cxx.

References config().

wcrGraphicsWindow::wcrGraphicsWindow GraphicsPipe pipe,
const GraphicsWindow::Properties &  props
 

Definition at line 674 of file wcrGraphicsWindow.cxx.

References Software.

wcrGraphicsWindow::~wcrGraphicsWindow  )  [virtual]
 

Definition at line 196 of file wcrGraphicsWindow.cxx.

References hwnd_pandawin_map, and NULL.


Member Function Documentation

void GraphicsWindow::begin_flip  )  [virtual, inherited]
 

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 GraphicsWindow::_channels, GraphicsWindow::_properties, WindowProperties::get_x_size(), WindowProperties::get_y_size(), and GraphicsChannel::window_resized().

bool GraphicsWindow::begin_frame  )  [virtual, inherited]
 

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 wcrGraphicsWindow::check_for_color_cursor_support  )  [protected]
 

Definition at line 593 of file wcrGraphicsWindow.cxx.

References chromium, and NULL.

int wcrGraphicsWindow::choose_visual  )  [protected]
 

Definition at line 723 of file wcrGraphicsWindow.cxx.

References ICD, MCD, and Software.

void GraphicsWindow::clear  )  [inherited]
 

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 GraphicsWindow::_properties, WindowProperties::add_properties(), WindowProperties::clear_origin(), WindowProperties::clear_size(), GraphicsWindow::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(), GraphicsWindow::is_fullscreen(), WindowProperties::set_origin(), WindowProperties::set_size(), and GraphicsWindow::system_changed_size().

void GraphicsWindow::clear_rejected_properties  )  [inherited]
 

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

Definition at line 174 of file graphicsWindow.cxx.

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

void GraphicsWindow::close_window  )  [protected, virtual, inherited]
 

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

void wcrGraphicsWindow::config void   )  [protected, virtual]
 

***/ __asm int 3

Definition at line 245 of file wcrGraphicsWindow.cxx.

Referenced by wcrGraphicsWindow().

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 wcrGraphicsWindow::deactivate_window  )  [virtual]
 

Definition at line 1459 of file wcrGraphicsWindow.cxx.

References NULL.

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

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 GraphicsWindow::get_window_event().

void wcrGraphicsWindow::DestroyMe bool  bAtExitFnCalled  ) 
 

Definition at line 106 of file wcrGraphicsWindow.cxx.

References chromium, FONT_BITMAP_OGLDISPLAYLISTNUM, HDC(), LAST_ERROR, NULL, PrintErrorMessage(), and report_errors().

void wcrGraphicsWindow::do_close_window  )  [protected, virtual]
 

Definition at line 184 of file wcrGraphicsWindow.cxx.

References GraphicsWindow::close_window().

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

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 GraphicsWindow::clear().

void wcrGraphicsWindow::enable_mouse_entry bool  val  )  [protected]
 

void wcrGraphicsWindow::enable_mouse_input bool  val  )  [protected]
 

Definition at line 1303 of file wcrGraphicsWindow.cxx.

References chromium, LAST_ERROR, and PrintErrorMessage().

void wcrGraphicsWindow::enable_mouse_motion bool  val  )  [protected]
 

Definition at line 1314 of file wcrGraphicsWindow.cxx.

References chromium, and report_errors().

void wcrGraphicsWindow::enable_mouse_passive_motion bool  val  )  [protected]
 

Definition at line 1325 of file wcrGraphicsWindow.cxx.

References chromium, LAST_ERROR, and PrintErrorMessage().

void GraphicsWindow::end_flip  )  [virtual, inherited]
 

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 GraphicsWindow::_channels, nassertv, and NULL.

void wcrGraphicsWindow::end_frame  )  [virtual]
 

Swaps the front and back buffers.

Reimplemented from GraphicsWindow.

Definition at line 939 of file wcrGraphicsWindow.cxx.

References _cur_frame_count, chromium, and GLboolean().

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

Reimplemented from GraphicsWindow.

Definition at line 137 of file wcrGraphicsWindow.h.

ButtonEvent GraphicsWindow::get_button_event int  device  )  [inherited]
 

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 GraphicsWindow::_gsg, and PointerTo< GraphicsStateGuardian >::clear().

GraphicsChannel * GraphicsWindow::get_channel int  index  )  [inherited]
 

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 wcrGraphicsWindow::get_class_type  )  [static]
 

Reimplemented from GraphicsWindow.

Definition at line 1422 of file wcrGraphicsWindow.cxx.

Referenced by wcrGraphicsPipe::wcrGraphicsPipe().

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.

int wcrGraphicsWindow::get_depth_bitwidth  )  [virtual]
 

Definition at line 1384 of file wcrGraphicsWindow.cxx.

References global_wcrwinptr, hwnd_pandawin_map, NULL, and window_proc().

DisplayRegion * GraphicsWindow::get_display_region int  n  )  const [inherited]
 

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 GraphicsWindow::_input_devices, GraphicsWindow::_input_lock, and nassertr.

GraphicsStateGuardian * GraphicsWindow::get_gsg  )  const [inline, inherited]
 

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

TypeHandle wcrGraphicsWindow::get_gsg_type  )  const [virtual]
 

Returns the TypeHandle of the kind of GSG preferred by this kind of window.

Definition at line 1399 of file wcrGraphicsWindow.cxx.

string GraphicsWindow::get_input_device_name int  device  )  const [inherited]
 

Returns the name of the nth input device.

Definition at line 529 of file graphicsWindow.cxx.

int GraphicsWindow::get_max_channel_index  )  const [inherited]
 

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 GraphicsWindow::_input_devices, and GraphicsWindow::_input_lock.

MouseData GraphicsWindow::get_mouse_data int  device  )  const [inherited]
 

Returns the MouseData associated with the nth input device.

Definition at line 594 of file graphicsWindow.cxx.

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

int GraphicsWindow::get_num_display_regions  )  const [inherited]
 

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 GraphicsWindow::_input_devices.

int GraphicsWindow::get_num_input_devices  )  const [inherited]
 

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, inherited]
 

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

Returns the current properties of the window.

Definition at line 130 of file graphicsWindow.cxx.

References GraphicsWindow::_lock, and GraphicsWindow::_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 [inherited]
 

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 GraphicsWindow::_lock, and GraphicsWindow::_window_event.

WindowProperties GraphicsWindow::get_requested_properties  )  const [inherited]
 

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 GraphicsWindow::_lock, and GraphicsWindow::_rejected_properties.

Referenced by DisplayRegion::get_pipe().

TypeHandle wcrGraphicsWindow::get_type  )  const [virtual]
 

Reimplemented from GraphicsWindow.

Definition at line 1432 of file wcrGraphicsWindow.cxx.

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

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 GraphicsWindow::declare_channel(), and NULL.

void wcrGraphicsWindow::handle_keypress ButtonHandle  key,
int  x,
int  y
 

Definition at line 1182 of file wcrGraphicsWindow.cxx.

void wcrGraphicsWindow::handle_keyrelease ButtonHandle  key  ) 
 

Definition at line 1197 of file wcrGraphicsWindow.cxx.

References process_1_event().

void wcrGraphicsWindow::handle_mouse_entry int  state  ) 
 

Definition at line 1168 of file wcrGraphicsWindow.cxx.

void wcrGraphicsWindow::handle_mouse_motion int  x,
int  y
 

Definition at line 1157 of file wcrGraphicsWindow.cxx.

References GraphicsWindow::_input_devices, and ButtonHandle::none().

void wcrGraphicsWindow::handle_reshape  )  [protected]
 

Definition at line 1133 of file wcrGraphicsWindow.cxx.

References GraphicsWindow::_input_devices, and MOUSE_EXITED.

bool GraphicsWindow::has_button_event int  device  )  const [inherited]
 

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 GraphicsWindow::_gsg, nassertv, and NULL.

bool GraphicsWindow::has_keyboard int  device  )  const [inherited]
 

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

Definition at line 573 of file graphicsWindow.cxx.

References GraphicsWindow::_gsg, GraphicsWindow::make_current(), and NULL.

bool GraphicsWindow::has_pointer int  device  )  const [inherited]
 

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 GraphicsWindow::_properties, WindowProperties::get_x_size(), and WindowProperties::get_y_size().

void wcrGraphicsWindow::init_type  )  [static]
 

Reimplemented from GraphicsWindow.

Definition at line 1426 of file wcrGraphicsWindow.cxx.

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

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

Definition at line 59 of file graphicsWindow.I.

References GraphicsWindow::_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 GraphicsWindow::get_mouse_data().

bool GraphicsWindow::is_channel_defined int  index  )  const [inherited]
 

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 GraphicsWindow::_input_devices, GraphicsWindow::_input_lock, and nassertr.

bool GraphicsWindow::is_closed  )  const [inline, inherited]
 

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 GraphicsWindow::_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, inherited]
 

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

Definition at line 75 of file graphicsWindow.I.

References GraphicsWindow::_pipe, and INLINE.

Referenced by GraphicsWindow::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().

ButtonHandle wcrGraphicsWindow::lookup_key WPARAM  wparam  )  const
 

Definition at line 1856 of file wcrGraphicsWindow.cxx.

void wcrGraphicsWindow::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 from GraphicsWindow.

Definition at line 1336 of file wcrGraphicsWindow.cxx.

References CRGraphicsStateGuardian::get_class_type().

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

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 GraphicsWindow::get_mouse_data().

GraphicsWindow * wcrGraphicsWindow::make_wcrGraphicsWindow const FactoryParams params  )  [static]
 

Definition at line 1404 of file wcrGraphicsWindow.cxx.

References _active_minimized_fullscreen, _exiting_window, and _window_inactive.

bool wcrGraphicsWindow::mouse_entry_enabled  )  [inline]
 

Definition at line 69 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::mouse_motion_enabled  )  [inline]
 

Definition at line 70 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::mouse_passive_motion_enabled  )  [inline]
 

Definition at line 71 of file wcrGraphicsWindow.h.

References HDC().

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

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 wcrGraphicsWindow::process_events  )  [inline, protected, 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 from GraphicsWindow.

Definition at line 1218 of file wcrGraphicsWindow.cxx.

void wcrGraphicsWindow::reactivate_window  )  [virtual]
 

Definition at line 1516 of file wcrGraphicsWindow.cxx.

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, inherited]
 

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

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 GraphicsWindow::_display_regions, GraphicsWindow::_lock, GraphicsWindow::determine_display_regions(), and NULL.

void GraphicsWindow::request_properties const WindowProperties requested_properties  )  [inherited]
 

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 GraphicsWindow::_channels, GraphicsWindow::_lock, nassertr, NULL, and PT.

bool wcrGraphicsWindow::resize unsigned int  xsize,
unsigned int  ysize
[virtual]
 

Definition at line 1026 of file wcrGraphicsWindow.cxx.

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, inherited]
 

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 GraphicsWindow::verify_window_sizes().

void GraphicsWindow::set_window_event const string &  window_event  )  [inherited]
 

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 wcrGraphicsWindow::setup_colormap  )  [protected]
 

Definition at line 876 of file wcrGraphicsWindow.cxx.

bool wcrGraphicsWindow::supports_update  )  const [virtual]
 

Returns true if this particular kind of GraphicsWindow supports use of the update() function to update the graphics one frame at a time, so that the window does not need to be the program's main loop.

Returns false if the only way to update the window is to call main_loop().

Definition at line 1257 of file wcrGraphicsWindow.cxx.

References _mouse_input_enabled.

void wcrGraphicsWindow::swap  )  [virtual]
 

Swaps the front and back buffers explicitly.

Definition at line 1021 of file wcrGraphicsWindow.cxx.

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

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, inherited]
 

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

void wcrGraphicsWindow::unmake_current void   )  [virtual]
 

Definition at line 1372 of file wcrGraphicsWindow.cxx.

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 wcrGraphicsWindow::update void   )  [virtual]
 

Definition at line 1268 of file wcrGraphicsWindow.cxx.

References _mouse_motion_enabled.

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

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 GraphicsWindow::_lock, GraphicsWindow::_rejected_properties, GraphicsWindow::_requested_properties, WindowProperties::add_properties(), WindowProperties::clear(), WindowProperties::is_any_specified(), and GraphicsWindow::set_properties_now().

unsigned int wcrGraphicsWindow::verify_window_sizes unsigned int  numsizes,
unsigned int *  dimen
[virtual]
 

Definition at line 1068 of file wcrGraphicsWindow.cxx.

References DWORD, find_acceptable_display_mode(), and uint.

void GraphicsWindow::win_display_regions_changed  )  [inline, inherited]
 

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.

LONG WINAPI wcrGraphicsWindow::window_proc HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam
 

Definition at line 1558 of file wcrGraphicsWindow.cxx.

Referenced by get_depth_bitwidth().


Member Data Documentation

bool wcrGraphicsWindow::_active_minimized_fullscreen [private]
 

Definition at line 115 of file wcrGraphicsWindow.h.

Referenced by make_wcrGraphicsWindow().

bool wcrGraphicsWindow::_bIsLowVidMemCard [private]
 

Definition at line 111 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::_bLoadedCustomCursor [private]
 

Definition at line 112 of file wcrGraphicsWindow.h.

HPALETTE wcrGraphicsWindow::_colormap [private]
 

Definition at line 105 of file wcrGraphicsWindow.h.

int wcrGraphicsWindow::_context [private]
 

Definition at line 102 of file wcrGraphicsWindow.h.

DWORD wcrGraphicsWindow::_cur_frame_count [private]
 

Definition at line 128 of file wcrGraphicsWindow.h.

Referenced by end_frame().

float wcrGraphicsWindow::_current_fps [private]
 

Definition at line 129 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::_exiting_window [private]
 

Definition at line 117 of file wcrGraphicsWindow.h.

Referenced by make_wcrGraphicsWindow().

string wcrGraphicsWindow::_extensions_str [private]
 

Definition at line 131 of file wcrGraphicsWindow.h.

PointerTo< GraphicsStateGuardian > GraphicsWindow::_gsg [protected, inherited]
 

Definition at line 173 of file graphicsWindow.h.

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

HDC wcrGraphicsWindow::_hdc [private]
 

Definition at line 103 of file wcrGraphicsWindow.h.

HCURSOR wcrGraphicsWindow::_hMouseCursor [private]
 

Definition at line 106 of file wcrGraphicsWindow.h.

HWND wcrGraphicsWindow::_hOldForegroundWindow [private]
 

Definition at line 107 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::_ime_open [private]
 

Definition at line 123 of file wcrGraphicsWindow.h.

InputDevices GraphicsWindow::_input_devices [protected, inherited]
 

Definition at line 170 of file graphicsWindow.h.

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

Mutex GraphicsWindow::_input_lock [protected, inherited]
 

Definition at line 171 of file graphicsWindow.h.

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

bool wcrGraphicsWindow::_mouse_entry_enabled [private]
 

Definition at line 122 of file wcrGraphicsWindow.h.

bool wcrGraphicsWindow::_mouse_input_enabled [private]
 

Definition at line 119 of file wcrGraphicsWindow.h.

Referenced by supports_update().

bool wcrGraphicsWindow::_mouse_motion_enabled [private]
 

Definition at line 120 of file wcrGraphicsWindow.h.

Referenced by update().

bool wcrGraphicsWindow::_mouse_passive_motion_enabled [private]
 

Definition at line 121 of file wcrGraphicsWindow.h.

HWND wcrGraphicsWindow::_mwindow
 

Definition at line 98 of file wcrGraphicsWindow.h.

UINT_PTR wcrGraphicsWindow::_PandaPausedTimer [private]
 

Definition at line 108 of file wcrGraphicsWindow.h.

Referenced by static_window_proc().

DEVMODE* wcrGraphicsWindow::_pCurrent_display_settings [private]
 

Definition at line 110 of file wcrGraphicsWindow.h.

PointerTo< GraphicsPipe > GraphicsWindow::_pipe [protected, inherited]
 

Definition at line 174 of file graphicsWindow.h.

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

PIXELFORMATDESCRIPTOR wcrGraphicsWindow::_pixelformat [private]
 

Definition at line 104 of file wcrGraphicsWindow.h.

WindowProperties GraphicsWindow::_properties [protected, inherited]
 

Definition at line 181 of file graphicsWindow.h.

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

bool wcrGraphicsWindow::_return_control_to_app [private]
 

Definition at line 116 of file wcrGraphicsWindow.h.

DWORD wcrGraphicsWindow::_start_frame_count [private]
 

Definition at line 127 of file wcrGraphicsWindow.h.

DWORD wcrGraphicsWindow::_start_time [private]
 

Definition at line 126 of file wcrGraphicsWindow.h.

TypeHandle wcrGraphicsWindow::_type_handle [static, private]
 

Reimplemented from GraphicsWindow.

Definition at line 52 of file wcrGraphicsWindow.cxx.

bool wcrGraphicsWindow::_window_inactive [private]
 

Definition at line 114 of file wcrGraphicsWindow.h.

Referenced by make_wcrGraphicsWindow().


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