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

wdxGraphicsWindow8 Class Reference

A single graphics window for rendering DirectX under Microsoft Windows. More...

#include <wdxGraphicsWindow8.h>

Inheritance diagram for wdxGraphicsWindow8:

WinGraphicsWindow GraphicsWindow TypedReferenceCount ClearableRegion TypedObject ReferenceCount List of all members.

Public Member Functions

 wdxGraphicsWindow8 (GraphicsPipe *pipe, GraphicsStateGuardian *gsg)
virtual ~wdxGraphicsWindow8 ()
virtual bool open_window (void)
 Opens the window right now.

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

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

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 LONG window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 This is the nonstatic window_proc function.

virtual bool handle_mouse_motion (int x, int y)
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
virtual void make_current (void)
 This function will be called within the draw thread during begin_frame() to ensure the graphics context is ready for drawing.

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

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.

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 release_gsg ()
 Releases the current GSG pointer, if it is currently held, and resets the GSG to NULL.

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 ()
LONG WINAPI static_window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 This is attached to the window class for all WinGraphicsWindow windows; it is called to handle window events.


Protected Types

typedef vector_GraphicsWindowInputDevice InputDevices

Protected Member Functions

virtual void fullscreen_restored (WindowProperties &properties)
 This is a hook for derived classes to do something special, if necessary, when a fullscreen window has been restored after being minimized.

virtual void handle_reshape ()
 Called in the window thread when the window size or location is changed, this updates the properties structure accordingly.

virtual bool do_fullscreen_resize (int x_size, int y_size)
 Called in the window thread to resize a fullscreen window.

virtual void close_window ()
 Closes the window right now.

virtual void fullscreen_minimized (WindowProperties &properties)
 This is a hook for derived classes to do something special, if necessary, when a fullscreen window has been minimized.

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.

virtual void reconsider_fullscreen_size (DWORD &x_size, DWORD &y_size, DWORD &bitdepth)
 Called before creating a fullscreen window to give the driver a chance to adjust the particular resolution request, if necessary.

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

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

Static Protected Attributes

bool _loaded_custom_cursor
HCURSOR _mouse_cursor
const char *const _window_class_name = "WinGraphicsWindow"
bool _window_class_registered = false

Private Member Functions

void create_screen_buffers_and_device (DXScreenData &Display, bool force_16bpp_zbuffer)
 Called whenever the window is resized, this recreates the necessary buffers for rendering.

bool choose_device (void)
 Looks at the list of available graphics adapters and chooses a suitable one for the window.

bool search_for_device (wdxGraphicsPipe8 *dxpipe, DXDeviceInfo *device_info)
 Searches for a suitable hardware device for rendering.

bool reset_device_resize_window (UINT new_xsize, UINT new_ysize)
 Called after a window (either fullscreen or windowed) has been resized, this recreates the D3D structures to match the new size.

void init_resized_window ()
 Reinitializes the window after it has been resized, or after it is first created.


Static Private Member Functions

int D3DFMT_to_DepthBits (D3DFORMAT fmt)
 Returns the number of depth bits represented by the indicated D3DFORMAT value.

bool is_badvidmem_card (D3DADAPTER_IDENTIFIER8 *pDevID)
 Returns true if the indicated video adapter card is known to report an inaccurate figure for available video memory.


Private Attributes

DXGraphicsStateGuardian8_dxgsg
DXScreenData _wcontext
int _depth_buffer_bpp
bool _awaiting_restore

Static Private Attributes

TypeHandle _type_handle

Friends

class wdxGraphicsPipe8

Detailed Description

A single graphics window for rendering DirectX under Microsoft Windows.

Definition at line 47 of file wdxGraphicsWindow8.h.


Member Typedef Documentation

typedef vector_GraphicsWindowInputDevice GraphicsWindow::InputDevices [protected, inherited]
 

Definition at line 169 of file graphicsWindow.h.


Constructor & Destructor Documentation

wdxGraphicsWindow8::wdxGraphicsWindow8 GraphicsPipe pipe,
GraphicsStateGuardian gsg
 

Definition at line 81 of file wdxGraphicsWindow8.cxx.

wdxGraphicsWindow8::~wdxGraphicsWindow8  )  [virtual]
 

Definition at line 101 of file wdxGraphicsWindow8.cxx.


Member Function Documentation

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

Reimplemented in wglGraphicsWindow.

Definition at line 117 of file winGraphicsWindow.cxx.

References WinGraphicsWindow::process_1_event().

bool wdxGraphicsWindow8::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 from GraphicsWindow.

Definition at line 248 of file wdxGraphicsWindow8.cxx.

References _dxgsg, GraphicsWindow::is_active(), NULL, and DXGraphicsStateGuardian8::show_frame().

bool wdxGraphicsWindow8::choose_device void   )  [private]
 

Looks at the list of available graphics adapters and chooses a suitable one for the window.

Returns true if successful, false on failure.

Definition at line 937 of file wdxGraphicsWindow8.cxx.

References dx_preferred_device_id.

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 WinGraphicsWindow::close_window  )  [protected, virtual, inherited]
 

Closes the window right now.

Called from the window thread.

Reimplemented from GraphicsWindow.

Reimplemented in wglGraphicsWindow.

Definition at line 223 of file winGraphicsWindow.cxx.

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 wdxGraphicsWindow8::create_screen_buffers_and_device DXScreenData Display,
bool  force_16bpp_zbuffer
[private]
 

Called whenever the window is resized, this recreates the necessary buffers for rendering.

Sets _depth_buffer_bpp appropriately.

Definition at line 695 of file wdxGraphicsWindow8.cxx.

References dx_multisample_antialiasing_level, and GraphicsWindow::is_fullscreen().

int wdxGraphicsWindow8::D3DFMT_to_DepthBits D3DFORMAT  fmt  )  [static, private]
 

Returns the number of depth bits represented by the indicated D3DFORMAT value.

Definition at line 1712 of file wdxGraphicsWindow8.cxx.

References _dxgsg.

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

bool wdxGraphicsWindow8::do_fullscreen_resize int  x_size,
int  y_size
[protected, virtual]
 

Called in the window thread to resize a fullscreen window.

Reimplemented from WinGraphicsWindow.

Definition at line 370 of file wdxGraphicsWindow8.cxx.

References _wcontext, DXScreenData::CardIDNum, DXScreenData::DisplayMode, dx_force_16bpp_zbuffer, R5G6B5_FLAG, reset_device_resize_window(), DXScreenData::SupportedScreenDepthsMask, and X1R5G5B5_FLAG.

bool WinGraphicsWindow::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 from GraphicsWindow.

Definition at line 389 of file winGraphicsWindow.cxx.

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

Definition at line 283 of file wdxGraphicsWindow8.cxx.

References _dxgsg, GraphicsWindow::get_properties(), WindowProperties::get_x_origin(), WindowProperties::get_x_size(), WindowProperties::get_y_origin(), WindowProperties::get_y_size(), WinGraphicsWindow::handle_reshape(), NULL, and reset_device_resize_window().

void GraphicsWindow::end_frame  )  [virtual, inherited]
 

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 wdxGraphicsWindow8::force_init_type void   )  [inline, virtual]
 

Reimplemented from WinGraphicsWindow.

Definition at line 105 of file wdxGraphicsWindow8.h.

void WinGraphicsWindow::fullscreen_minimized WindowProperties properties  )  [protected, virtual, inherited]
 

This is a hook for derived classes to do something special, if necessary, when a fullscreen window has been minimized.

The given WindowProperties struct will be applied to this window's properties after this function returns.

Definition at line 349 of file winGraphicsWindow.cxx.

References WinGraphicsWindow::_hWnd, WindowProperties::set_origin(), and WindowProperties::set_size().

void wdxGraphicsWindow8::fullscreen_restored WindowProperties properties  )  [protected, virtual]
 

This is a hook for derived classes to do something special, if necessary, when a fullscreen window has been restored after being minimized.

The given WindowProperties struct will be applied to this window's properties after this function returns.

Reimplemented from WinGraphicsWindow.

Definition at line 306 of file wdxGraphicsWindow8.cxx.

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 wdxGraphicsWindow8::get_class_type void   )  [inline, static]
 

Reimplemented from WinGraphicsWindow.

Definition at line 94 of file wdxGraphicsWindow8.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 [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().

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

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

Reimplemented from WinGraphicsWindow.

Definition at line 102 of file wdxGraphicsWindow8.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 [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 WinGraphicsWindow::handle_mouse_exit void   )  [virtual, inherited]
 

Definition at line 1536 of file winGraphicsWindow.cxx.

bool wdxGraphicsWindow8::handle_mouse_motion int  x,
int  y
[virtual]
 

Reimplemented from WinGraphicsWindow.

Definition at line 1786 of file wdxGraphicsWindow8.cxx.

void wdxGraphicsWindow8::handle_reshape  )  [protected, virtual]
 

Called in the window thread when the window size or location is changed, this updates the properties structure accordingly.

Reimplemented from WinGraphicsWindow.

Definition at line 330 of file wdxGraphicsWindow8.cxx.

References _wcontext, DXScreenData::bIsLowVidMemCard, and DXScreenData::CardIDNum.

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 wdxGraphicsWindow8::init_resized_window  )  [private]
 

Reinitializes the window after it has been resized, or after it is first created.

Assumes CreateDevice or Device->Reset() has just been called, and the new size is specified in _wcontext.PresParams.

Definition at line 1626 of file wdxGraphicsWindow8.cxx.

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

Reimplemented from WinGraphicsWindow.

Definition at line 97 of file wdxGraphicsWindow8.h.

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 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 wdxGraphicsWindow8::is_badvidmem_card D3DADAPTER_IDENTIFIER8 *  pDevID  )  [static, private]
 

Returns true if the indicated video adapter card is known to report an inaccurate figure for available video memory.

Definition at line 1748 of file wdxGraphicsWindow8.cxx.

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 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 wdxGraphicsWindow8::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 105 of file wdxGraphicsWindow8.cxx.

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

bool wdxGraphicsWindow8::open_window void   )  [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 from WinGraphicsWindow.

Definition at line 1770 of file wdxGraphicsWindow8.cxx.

void WinGraphicsWindow::process_events  )  [virtual, inherited]
 

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 139 of file winGraphicsWindow.cxx.

void WinGraphicsWindow::reconsider_fullscreen_size DWORD x_size,
DWORD y_size,
DWORD bitdepth
[protected, virtual, inherited]
 

Called before creating a fullscreen window to give the driver a chance to adjust the particular resolution request, if necessary.

Reimplemented in wglGraphicsWindow.

Definition at line 525 of file winGraphicsWindow.cxx.

References GraphicsWindow::_properties, DWORD, WindowProperties::get_undecorated(), and WindowProperties::has_undecorated().

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 wdxGraphicsWindow8::reset_device_resize_window UINT  new_xsize,
UINT  new_ysize
[private]
 

Called after a window (either fullscreen or windowed) has been resized, this recreates the D3D structures to match the new size.

Definition at line 1570 of file wdxGraphicsWindow8.cxx.

Referenced by do_fullscreen_resize(), and end_flip().

bool wdxGraphicsWindow8::search_for_device wdxGraphicsPipe8 dxpipe,
DXDeviceInfo device_info
[private]
 

Searches for a suitable hardware device for rendering.

Definition at line 1260 of file wdxGraphicsWindow8.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 WinGraphicsWindow::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 from GraphicsWindow.

Definition at line 204 of file winGraphicsWindow.cxx.

References WinGraphicsWindow::open_fullscreen_window().

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.

LONG WINAPI WinGraphicsWindow::static_window_proc HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam
[static, inherited]
 

This is attached to the window class for all WinGraphicsWindow windows; it is called to handle window events.

Definition at line 1139 of file winGraphicsWindow.cxx.

References get_icon_filename(), get_mono_cursor_filename(), NULL, WinGraphicsWindow::static_window_proc(), and Filename::to_os_specific().

Referenced by WinGraphicsWindow::static_window_proc().

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

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 wdxGraphicsWindow8::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.

Reimplemented from GraphicsWindow.

Definition at line 174 of file wdxGraphicsWindow8.cxx.

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 wdxGraphicsWindow8::window_proc HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam
[virtual]
 

This is the nonstatic window_proc function.

It is called to handle window events for this particular window.

Reimplemented from WinGraphicsWindow.

Definition at line 455 of file wdxGraphicsWindow8.cxx.

References _dxgsg, and NULL.


Friends And Related Function Documentation

friend class wdxGraphicsPipe8 [friend]
 

Definition at line 110 of file wdxGraphicsWindow8.h.


Member Data Documentation

bool wdxGraphicsWindow8::_awaiting_restore [private]
 

Definition at line 91 of file wdxGraphicsWindow8.h.

int wdxGraphicsWindow8::_depth_buffer_bpp [private]
 

Definition at line 90 of file wdxGraphicsWindow8.h.

DXGraphicsStateGuardian8* wdxGraphicsWindow8::_dxgsg [private]
 

Definition at line 87 of file wdxGraphicsWindow8.h.

Referenced by begin_frame(), D3DFMT_to_DepthBits(), end_flip(), and window_proc().

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

HWND WinGraphicsWindow::_hWnd [protected, inherited]
 

Definition at line 116 of file winGraphicsWindow.h.

Referenced by WinGraphicsWindow::fullscreen_minimized().

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(), wcrGraphicsWindow::handle_mouse_motion(), wcrGraphicsWindow::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 WinGraphicsWindow::_loaded_custom_cursor [static, protected, inherited]
 

Definition at line 35 of file winGraphicsWindow.cxx.

HCURSOR WinGraphicsWindow::_mouse_cursor [static, protected, inherited]
 

Definition at line 36 of file winGraphicsWindow.cxx.

Referenced by WinGraphicsWindow::update_cursor_window().

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

Definition at line 174 of file graphicsWindow.h.

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

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

TypeHandle wdxGraphicsWindow8::_type_handle [static, private]
 

Reimplemented from WinGraphicsWindow.

Definition at line 41 of file wdxGraphicsWindow8.cxx.

DXScreenData wdxGraphicsWindow8::_wcontext [private]
 

Definition at line 88 of file wdxGraphicsWindow8.h.

Referenced by do_fullscreen_resize(), and handle_reshape().

const char *const WinGraphicsWindow::_window_class_name = "WinGraphicsWindow" [static, protected, inherited]
 

Definition at line 37 of file winGraphicsWindow.cxx.

bool WinGraphicsWindow::_window_class_registered = false [static, protected, inherited]
 

Definition at line 38 of file winGraphicsWindow.cxx.


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