Panda3D
|
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display. More...
#include "graphicsWindow.h"
Public Member Functions | |
virtual void | add_window_proc (const GraphicsWindowProc *wnd_proc_object) |
void | clear_rejected_properties () |
Empties the set of failed properties that will be returned by get_rejected_properties(). More... | |
virtual void | clear_window_procs () |
virtual void | close_ime () |
Forces the ime window to close if any. More... | |
void | disable_pointer_events (int device) |
Turn off the generation of pointer events. More... | |
void | disable_pointer_mode (int device) |
See GraphicsWindowInputDevice::disable_pointer_mode. More... | |
void | enable_pointer_events (int device) |
Turn on the generation of pointer events. More... | |
void | enable_pointer_mode (int device, double speed) |
See GraphicsWindowInputDevice::enable_pointer_mode. More... | |
virtual TypeHandle | force_init_type () |
ButtonEvent | get_button_event (int device) |
Assuming a previous call to has_button_event() returned true, this returns the pending button event. More... | |
string | get_close_request_event () const |
Returns the name of the event set via set_close_request_event(). More... | |
string | get_input_device_name (int device) const |
Returns the name of the nth input device. More... | |
virtual ButtonMap * | get_keyboard_map () const |
Returns a ButtonMap containing the association between raw buttons and virtual buttons. More... | |
int | get_num_input_devices () const |
Returns the number of separate input devices associated with the window. More... | |
virtual int | get_num_touches () |
Returns the current number of touches on this window. More... | |
MouseData | get_pointer (int device) const |
Returns the MouseData associated with the nth input device's pointer. More... | |
const WindowProperties | get_properties () const |
Returns the current properties of the window. More... | |
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. More... | |
const WindowProperties | get_requested_properties () const |
Returns the properties of the window that are currently requested. More... | |
virtual TouchInfo | get_touch_info (int index) |
Returns the TouchInfo object describing the specified touch. More... | |
virtual TypeHandle | get_type () const |
bool | get_unexposed_draw () const |
See set_unexposed_draw(). More... | |
string | get_window_event () const |
Returns the name of the event that is generated when this window is modified externally, e.g. More... | |
WindowHandle * | get_window_handle () const |
Returns the WindowHandle corresponding to this window on the desktop. More... | |
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. More... | |
bool | has_keyboard (int device) const |
Returns true if the nth input device has a keyboard, false otherwise. More... | |
bool | has_pointer (int device) const |
Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise. More... | |
bool | has_pointer_event (int device) const |
Returns true if the indicated device has a pending pointer event (a mouse movement). More... | |
virtual bool | is_active () const |
Returns true if the window is ready to be rendered into, false otherwise. More... | |
bool | is_closed () const |
Returns true if the window has not yet been opened, or has been fully closed, false if it is open. More... | |
bool | is_fullscreen () const |
Returns true if the window has been opened as a fullscreen window, false otherwise. More... | |
virtual bool | is_touch_event (GraphicsWindowProcCallbackData *callbackData) |
Returns whether the specified event msg is a touch message. More... | |
MAKE_SEQ (get_input_device_names, get_num_input_devices, get_input_device_name) | |
virtual bool | move_pointer (int device, int x, int y) |
Forces the pointer to the indicated position within the window, if possible. More... | |
virtual void | process_events () |
Do whatever processing is necessary to ensure that the window responds to user events. More... | |
PT (PointerEventList) get_pointer_events(int device) | |
virtual void | remove_window_proc (const GraphicsWindowProc *wnd_proc_object) |
virtual void | request_close () |
This is called by the GraphicsEngine to request that the window (or whatever) close itself or, in general, make itself invalid, at the next call to process_events(). More... | |
virtual void | request_open () |
This is called by the GraphicsEngine to request that the window (or whatever) open itself or, in general, make itself valid, at the next call to process_events(). More... | |
void | request_properties (const WindowProperties &requested_properties) |
Requests a property change on the window. More... | |
virtual void | set_close_now () |
This is called by the GraphicsEngine to insist that the window be closed immediately. More... | |
void | set_close_request_event (const string &close_request_event) |
Sets the event that is triggered when the user requests to close the window, e.g. More... | |
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. More... | |
void | set_unexposed_draw (bool unexposed_draw) |
If this flag is false, the window is redrawn only after it has received a recent "unexpose" or "draw" event from the underlying windowing systme. More... | |
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. More... | |
virtual bool | supports_window_procs () const |
Returns whether this window supports adding of Windows proc handlers. More... | |
virtual int | verify_window_sizes (int numsizes, int *dimen) |
Determines which of the indicated window sizes are supported by available hardware (e.g. More... | |
![]() | |
void | add_render_texture (Texture *tex, RenderTextureMode mode, RenderTexturePlane bitplane=RTP_COUNT) |
Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures. More... | |
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. More... | |
virtual bool | begin_frame (FrameMode mode, Thread *current_thread) |
This function will be called within the draw thread before beginning rendering for a given frame. More... | |
void | change_scenes (DisplayRegionPipelineReader *new_dr) |
Called by the GraphicsEngine when the window is about to change to another DisplayRegion. More... | |
void | clear (Thread *current_thread) |
Clears the entire framebuffer before rendering, according to the settings of get_color_clear_active() and get_depth_clear_active() (inherited from DrawableRegion). More... | |
void | clear_child_sort () |
Resets the sort value of future offscreen buffers created by make_texture_sort() to the default value. More... | |
void | clear_delete_flag () |
Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame. More... | |
virtual void | clear_pipe () |
Sets the window's _pipe pointer to NULL; this is generally called only as a precursor to deleting the window. More... | |
void | clear_render_textures () |
If the GraphicsOutput is currently rendering to a texture, then all textures are dissociated from the GraphicsOuput. More... | |
int | count_textures () const |
If the GraphicsOutput is set to render into a texture, returns the number of textures that are being rendered into. More... | |
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. More... | |
virtual void | end_frame (FrameMode mode, Thread *current_thread) |
This function will be called within the draw thread after rendering is completed for a given frame. More... | |
virtual bool | flip_ready () const |
Returns true if a frame has been rendered and needs to be flipped, false otherwise. More... | |
int | get_child_sort () const |
Returns the sort value of future offscreen buffers created by make_texture_sort(). More... | |
PStatCollector & | get_cull_window_pcollector () |
Returns a PStatCollector for timing the cull operation for just this GraphicsOutput. More... | |
bool | get_delete_flag () const |
Returns the current setting of the delete flag. More... | |
PStatCollector & | get_draw_window_pcollector () |
Returns a PStatCollector for timing the draw operation for just this GraphicsOutput. More... | |
GraphicsEngine * | get_engine () const |
Returns the graphics engine that created this output. More... | |
const FrameBufferProperties & | get_fb_properties () const |
Returns the framebuffer properties of the window. More... | |
LVecBase2i | get_fb_size () const |
Returns the internal size of the window or buffer. More... | |
int | get_fb_x_size () const |
Returns the internal width of the window or buffer. More... | |
int | get_fb_y_size () const |
Returns the internal height of the window or buffer. More... | |
GraphicsStateGuardian * | get_gsg () const |
Returns the GSG that is associated with this window. More... | |
virtual GraphicsOutput * | get_host () |
This is normally called only from within make_texture_buffer(). More... | |
bool | get_inverted () const |
Returns the current setting of the inverted flag. More... | |
unsigned int | get_left_eye_color_mask () const |
Returns the color mask in effect when rendering a left-eye view in red_blue stereo mode. More... | |
const string & | get_name () const |
Returns the name that was passed to the GraphicsOutput constructor. More... | |
int | get_num_active_display_regions () const |
int | get_num_display_regions () const |
Returns the number of DisplayRegions that have been created within the window, active or otherwise. More... | |
bool | get_one_shot () const |
Returns the current setting of the one-shot flag. More... | |
DisplayRegion * | get_overlay_display_region () const |
Returns the special "overlay" DisplayRegion that is created for each window or buffer. More... | |
GraphicsPipe * | get_pipe () const |
Returns the GraphicsPipe that this window is associated with. More... | |
bool | get_red_blue_stereo () const |
Returns whether red-blue stereo mode is in effect for this particular window. More... | |
unsigned int | get_right_eye_color_mask () const |
Returns the color mask in effect when rendering a right-eye view in red_blue stereo mode. More... | |
RenderTextureMode | get_rtm_mode (int i=0) const |
Returns the RenderTextureMode associated with the nth render-texture. More... | |
const LVecBase4 & | get_sbs_left_dimensions () const |
Returns the effective sub-region of the window for displaying the left channel, if side-by-side stereo mode is in effect for the window. More... | |
LVecBase2i | get_sbs_left_size () const |
If side-by-side stereo is enabled, this returns the pixel size of the left eye, based on scaling get_size() by get_sbs_left_dimensions(). More... | |
int | get_sbs_left_x_size () const |
If side-by-side stereo is enabled, this returns the pixel width of the left eye, based on scaling get_x_size() by get_sbs_left_dimensions(). More... | |
int | get_sbs_left_y_size () const |
If side-by-side stereo is enabled, this returns the pixel height of the left eye, based on scaling get_y_size() by get_sbs_left_dimensions(). More... | |
const LVecBase4 & | get_sbs_right_dimensions () const |
Returns the effective sub-region of the window for displaying the right channel, if side-by-side stereo mode is in effect for the window. More... | |
LVecBase2i | get_sbs_right_size () const |
If side-by-side stereo is enabled, this returns the pixel size of the right eye, based on scaling get_size() by get_sbs_right_dimensions(). More... | |
int | get_sbs_right_x_size () const |
If side-by-side stereo is enabled, this returns the pixel width of the right eye, based on scaling get_x_size() by get_sbs_right_dimensions(). More... | |
int | get_sbs_right_y_size () const |
If side-by-side stereo is enabled, this returns the pixel height of the right eye, based on scaling get_y_size() by get_sbs_right_dimensions(). More... | |
bool | get_screenshot (PNMImage &image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More... | |
bool | get_side_by_side_stereo () const |
Returns whether side-by-side stereo mode is in effect for this particular window. More... | |
const LVecBase2i & | get_size () const |
Returns the visible size of the window or buffer, if it is known. More... | |
int | get_sort () const |
Returns the sorting order of this particular GraphicsOutput. More... | |
virtual bool | get_supports_render_texture () const |
Returns true if this particular GraphicsOutput can render directly into a texture, or false if it must always copy-to-texture at the end of each frame to achieve this effect. More... | |
bool | get_swap_eyes () const |
Returns the current setting of the "swap eyes" flag. More... | |
virtual Texture * | get_texture (int i=0) const |
Returns the nth texture into which the GraphicsOutput renders. More... | |
NodePath | get_texture_card () |
Returns a PandaNode containing a square polygon. More... | |
RenderTexturePlane | get_texture_plane (int i=0) const |
Returns the RenderTexturePlane associated with the nth render-texture. More... | |
int | get_x_size () const |
Returns the visible width of the window or buffer, if it is known. More... | |
int | get_y_size () const |
Returns the visible height of the window or buffer, if it is known. More... | |
bool | has_size () const |
Returns true if the size of the window/frame buffer is known, false otherwise. More... | |
bool | has_texture () const |
Returns true if the GraphicsOutput is rendering into any textures at all. More... | |
bool | is_nonzero_size () const |
Returns true if the output has a nonzero size in both X and Y, or false if it is zero (and therefore invalid). More... | |
bool | is_stereo () const |
Returns Returns true if this window can render stereo DisplayRegions, either through red-blue stereo (see set_red_blue_stereo()) or through true hardware stereo rendering. More... | |
bool | is_valid () const |
Returns true if the output is fully created and ready for rendering, false otherwise. More... | |
GraphicsOutput * | make_cube_map (const string &name, int size, NodePath &camera_rig, DrawMask camera_mask=PandaNode::get_all_camera_mask(), bool to_ram=false, FrameBufferProperties *fbp=NULL) |
This is similar to make_texture_buffer() in that it allocates a separate buffer suitable for rendering to a texture that can be assigned to geometry in this window, but in this case, the buffer is set up to render the six faces of a cube map. More... | |
DisplayRegion * | make_display_region () |
Creates a new DisplayRegion that covers the entire window. More... | |
DisplayRegion * | make_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More... | |
DisplayRegion * | make_display_region (const LVecBase4 &dimensions) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More... | |
DisplayRegion * | make_mono_display_region () |
Creates a new DisplayRegion that covers the entire window. More... | |
DisplayRegion * | make_mono_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
Creates a new DisplayRegion that covers the entire window. More... | |
DisplayRegion * | make_mono_display_region (const LVecBase4 &dimensions) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More... | |
MAKE_SEQ (get_display_regions, get_num_display_regions, get_display_region) | |
MAKE_SEQ (get_active_display_regions, get_num_active_display_regions, get_active_display_region) | |
StereoDisplayRegion * | make_stereo_display_region () |
Creates a new DisplayRegion that covers the entire window. More... | |
StereoDisplayRegion * | make_stereo_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
Creates a new DisplayRegion that covers the entire window. More... | |
StereoDisplayRegion * | make_stereo_display_region (const LVecBase4 &dimensions) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More... | |
GraphicsOutput * | make_texture_buffer (const string &name, int x_size, int y_size, Texture *tex=NULL, bool to_ram=false, FrameBufferProperties *fbp=NULL) |
bool | operator< (const GraphicsOutput &other) const |
The sorting operator is used to order the GraphicsOutput object in order by their sort number, so that they will render in the correct order in the GraphicsEngine. More... | |
PT (DisplayRegion) get_display_region(int n) const | |
PT (DisplayRegion) get_active_display_region(int n) const | |
PT (Texture) get_screenshot() | |
virtual void | ready_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. More... | |
void | remove_all_display_regions () |
Removes all display regions from the window, except the default one that is created with the window. More... | |
bool | remove_display_region (DisplayRegion *display_region) |
Removes the indicated DisplayRegion from the window, and destructs it if there are no other references. More... | |
bool | save_screenshot (const Filename &filename, const string &image_comment="") |
Saves a screenshot of the region to the indicated filename. More... | |
Filename | save_screenshot_default (const string &prefix="screenshot") |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More... | |
virtual void | select_target_tex_page (int page) |
Called internally when the window is in render-to-a-texture mode and we are in the process of rendering the six faces of a cube map, or any other multi-page texture. More... | |
void | set_active (bool active) |
Sets the active flag associated with the GraphicsOutput. More... | |
void | set_child_sort (int child_sort) |
Specifies the sort value of future offscreen buffers created by make_texture_sort(). More... | |
void | set_inverted (bool inverted) |
Changes the current setting of the inverted flag. More... | |
void | set_one_shot (bool one_shot) |
Changes the current setting of the one-shot flag. More... | |
void | set_overlay_display_region (DisplayRegion *display_region) |
Replaces the special "overlay" DisplayRegion that is created for each window or buffer. More... | |
void | set_red_blue_stereo (bool red_blue_stereo, unsigned int left_eye_color_mask, unsigned int right_eye_color_mask) |
Enables red-blue stereo mode on this particular window. More... | |
void | set_side_by_side_stereo (bool side_by_side_stereo) |
Enables side-by-side stereo mode on this particular window. More... | |
void | set_side_by_side_stereo (bool side_by_side_stereo, const LVecBase4 &sbs_left_dimensions, const LVecBase4 &sbs_right_dimensions) |
Enables side-by-side stereo mode on this particular window. More... | |
void | set_size_and_recalc (int x, int y) |
Changes the x_size and y_size, then recalculates structures that depend on size. More... | |
virtual void | set_sort (int sort) |
Adjusts the sorting order of this particular GraphicsOutput, relative to other GraphicsOutputs. More... | |
void | set_swap_eyes (bool swap_eyes) |
Changes the "swap eyes" flag. More... | |
void | setup_render_texture (Texture *tex, bool allow_bind, bool to_ram) |
This is a deprecated interface that made sense back when GraphicsOutputs could only render into one texture at a time. More... | |
virtual bool | share_depth_buffer (GraphicsOutput *graphics_output) |
Will attempt to use the depth buffer of the input graphics_output. More... | |
void | trigger_copy () |
When the GraphicsOutput is in triggered copy mode, this function triggers the copy (at the end of the next frame). More... | |
virtual void | unshare_depth_buffer () |
Discontinue sharing the depth buffer. More... | |
![]() | |
TypedWritableReferenceCount (const TypedWritableReferenceCount ©) | |
virtual ReferenceCount * | as_reference_count () |
Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More... | |
void | operator= (const TypedWritableReferenceCount ©) |
![]() | |
TypedWritable (const TypedWritable ©) | |
virtual int | complete_pointers (TypedWritable **p_list, BamReader *manager) |
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin(). More... | |
string | encode_to_bam_stream () const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. More... | |
bool | encode_to_bam_stream (string &data, BamWriter *writer=NULL) const |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More... | |
virtual void | fillin (DatagramIterator &scan, BamReader *manager) |
This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object. More... | |
virtual void | finalize (BamReader *manager) |
Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed. More... | |
UpdateSeq | get_bam_modified () const |
Returns the current bam_modified counter. More... | |
void | mark_bam_modified () |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More... | |
void | operator= (const TypedWritable ©) |
virtual bool | require_fully_complete () const |
Some objects require all of their nested pointers to have been completed before the objects themselves can be completed. More... | |
virtual void | update_bam_nested (BamWriter *manager) |
Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates. More... | |
virtual void | write_datagram (BamWriter *manager, Datagram &dg) |
Writes the contents of this object to the datagram for shipping out to a Bam file. More... | |
![]() | |
TypedObject (const TypedObject ©) | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
void | operator= (const TypedObject ©) |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
![]() | |
DrawableRegion (const DrawableRegion ©) | |
void | copy_clear_settings (const DrawableRegion ©) |
Copies only the clear settings from the other drawable region. More... | |
virtual void | disable_clears () |
Disables both the color and depth clear. More... | |
virtual bool | get_clear_active (int n) const |
Gets the clear-active flag for any bitplane. More... | |
const LColor & | get_clear_color () const |
Returns the current clear color value. More... | |
bool | get_clear_color_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
PN_stdfloat | get_clear_depth () const |
Returns the current clear depth value. More... | |
bool | get_clear_depth_active () const |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More... | |
unsigned int | get_clear_stencil () const |
Returns the current clear stencil value. More... | |
bool | get_clear_stencil_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
virtual const LColor & | get_clear_value (int n) const |
Returns the clear value for any bitplane. More... | |
int | get_draw_buffer_type () const |
Returns the RenderBuffer into which the GSG should issue draw commands. More... | |
PN_stdfloat | get_pixel_factor () const |
Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More... | |
PN_stdfloat | get_pixel_zoom () const |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More... | |
int | get_screenshot_buffer_type () const |
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion. More... | |
virtual 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. More... | |
void | operator= (const DrawableRegion ©) |
virtual void | set_clear_active (int n, bool clear_aux_active) |
Sets the clear-active flag for any bitplane. More... | |
void | set_clear_color (const LColor &color) |
Sets the clear color to the indicated value. More... | |
void | set_clear_color_active (bool clear_color_active) |
Toggles the flag that indicates whether the color buffer should be cleared every frame. More... | |
void | set_clear_depth (PN_stdfloat depth) |
Sets the clear depth to the indicated value. More... | |
void | set_clear_depth_active (bool clear_depth_active) |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. More... | |
void | set_clear_stencil (unsigned int stencil) |
Sets the clear stencil to the indicated value. More... | |
void | set_clear_stencil_active (bool clear_stencil_active) |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More... | |
virtual void | set_clear_value (int n, const LColor &clear_value) |
Sets the clear value for any bitplane. More... | |
virtual void | set_pixel_zoom (PN_stdfloat pixel_zoom) |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More... | |
virtual bool | supports_pixel_zoom () const |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
static Filename | make_screenshot_filename (const string &prefix="screenshot") |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data |
![]() | |
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string. More... | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static int | get_renderbuffer_type (int plane) |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More... | |
Friends | |
class | Extension< GraphicsWindow > |
class | GraphicsEngine |
Additional Inherited Members | |
![]() | |
enum | FrameMode { FM_render, FM_parasite, FM_refresh } |
enum | RenderTextureMode { RTM_none, RTM_bind_or_copy, RTM_copy_texture, RTM_copy_ram, RTM_triggered_copy_texture, RTM_triggered_copy_ram, RTM_bind_layered } |
![]() | |
enum | RenderTexturePlane { RTP_stencil =0, RTP_depth_stencil =1, RTP_color, RTP_aux_rgba_0, RTP_aux_rgba_1, RTP_aux_rgba_2, RTP_aux_rgba_3, RTP_aux_hrgba_0, RTP_aux_hrgba_1, RTP_aux_hrgba_2, RTP_aux_hrgba_3, RTP_aux_float_0, RTP_aux_float_1, RTP_aux_float_2, RTP_aux_float_3, RTP_depth, RTP_COUNT } |
![]() | |
static BamReader * | reader = NULL) |
![]() | |
static TypedWritable *const | Null = (TypedWritable*)0L |
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display.
Definition at line 43 of file graphicsWindow.h.
void GraphicsWindow::clear_rejected_properties | ( | ) |
Empties the set of failed properties that will be returned by get_rejected_properties().
Definition at line 128 of file graphicsWindow.cxx.
References get_rejected_properties().
Referenced by get_requested_properties().
|
virtual |
Forces the ime window to close if any.
Reimplemented in WinGraphicsWindow.
Definition at line 442 of file graphicsWindow.cxx.
References has_button_event().
Referenced by move_pointer().
void GraphicsWindow::disable_pointer_events | ( | int | device | ) |
Turn off the generation of pointer events.
Definition at line 371 of file graphicsWindow.cxx.
References enable_pointer_mode().
Referenced by enable_pointer_events().
void GraphicsWindow::disable_pointer_mode | ( | int | device | ) |
See GraphicsWindowInputDevice::disable_pointer_mode.
Definition at line 395 of file graphicsWindow.cxx.
References get_pointer().
Referenced by enable_pointer_mode().
void GraphicsWindow::enable_pointer_events | ( | int | device | ) |
Turn on the generation of pointer events.
Definition at line 359 of file graphicsWindow.cxx.
References disable_pointer_events().
Referenced by get_keyboard_map().
void GraphicsWindow::enable_pointer_mode | ( | int | device, |
double | speed | ||
) |
See GraphicsWindowInputDevice::enable_pointer_mode.
Definition at line 383 of file graphicsWindow.cxx.
References disable_pointer_mode().
Referenced by disable_pointer_events().
ButtonEvent GraphicsWindow::get_button_event | ( | int | device | ) |
Assuming a previous call to has_button_event() returned true, this returns the pending button event.
Definition at line 473 of file graphicsWindow.cxx.
References has_pointer_event().
Referenced by has_button_event().
string GraphicsWindow::get_close_request_event | ( | ) | const |
Returns the name of the event set via set_close_request_event().
If this string is nonempty, then when the user requests to close window, this event will be generated instead. See set_close_request_event().
Definition at line 264 of file graphicsWindow.cxx.
References get_num_input_devices().
Referenced by set_close_request_event(), and WinGraphicsWindow::window_proc().
string GraphicsWindow::get_input_device_name | ( | int | device | ) | const |
Returns the name of the nth input device.
Definition at line 297 of file graphicsWindow.cxx.
References has_pointer().
Referenced by get_num_input_devices().
|
virtual |
Returns a ButtonMap containing the association between raw buttons and virtual buttons.
Reimplemented in CocoaGraphicsWindow.
Definition at line 349 of file graphicsWindow.cxx.
References enable_pointer_events().
Referenced by has_keyboard().
int GraphicsWindow::get_num_input_devices | ( | ) | const |
Returns the number of separate input devices associated with the window.
Typically, a window will have exactly one input device: the keyboard/mouse pair. However, some windows may have no input devices, and others may add additional devices, for instance for a joystick.
Definition at line 282 of file graphicsWindow.cxx.
References get_input_device_name().
Referenced by get_close_request_event().
|
virtual |
Returns the current number of touches on this window.
Reimplemented in WinGraphicsWindow.
Definition at line 910 of file graphicsWindow.cxx.
References get_touch_info().
Referenced by GraphicsWindowProcCallbackData::get_num_touches(), and is_touch_event().
MouseData GraphicsWindow::get_pointer | ( | int | device | ) | const |
Returns the MouseData associated with the nth input device's pointer.
This is deprecated; use get_pointer_device().get_pointer() instead, or for raw mice, use the InputDeviceManager interface.
Definition at line 410 of file graphicsWindow.cxx.
References move_pointer().
Referenced by disable_pointer_mode().
const WindowProperties GraphicsWindow::get_properties | ( | ) | const |
Returns the current properties of the window.
Definition at line 94 of file graphicsWindow.cxx.
References get_requested_properties().
Referenced by AndroidGraphicsStateGuardian::choose_pixel_format(), WinGraphicsWindow::static_window_proc(), and wdxGraphicsWindow9::verify_window_sizes().
WindowProperties GraphicsWindow::get_rejected_properties | ( | ) | const |
Returns the set of properties that have recently been requested, but could not be applied to the window for some reason.
This set of properties will remain unchanged until they are changed by a new failed request, or clear_rejected_properties() is called.
Definition at line 143 of file graphicsWindow.cxx.
References request_properties().
Referenced by clear_rejected_properties().
const WindowProperties GraphicsWindow::get_requested_properties | ( | ) | const |
Returns the properties of the window that are currently requested.
These properties will be applied to the window (if valid) at the next execution of process_events().
Definition at line 112 of file graphicsWindow.cxx.
References clear_rejected_properties().
Referenced by get_properties().
|
virtual |
Returns the TouchInfo object describing the specified touch.
Reimplemented in WinGraphicsWindow.
Definition at line 921 of file graphicsWindow.cxx.
Referenced by get_num_touches(), and GraphicsWindowProcCallbackData::get_touch_info().
|
inline |
See set_unexposed_draw().
Definition at line 69 of file graphicsWindow.I.
References get_window_handle().
Referenced by wdxGraphicsWindow9::begin_frame(), WinGraphicsWindow::set_properties_now(), and set_unexposed_draw().
string GraphicsWindow::get_window_event | ( | ) | const |
Returns the name of the event that is generated when this window is modified externally, e.g.
to be resized or closed by the user. See set_window_event().
Definition at line 217 of file graphicsWindow.cxx.
References set_close_request_event().
Referenced by set_window_event().
|
inline |
Returns the WindowHandle corresponding to this window on the desktop.
This is mainly useful for communicating with external libraries. Use window_handle->get_os_handle()->get_handle(), or window_handle->get_string_handle(), to get the actual OS-specific window handle object, whatever type that might be.
Definition at line 85 of file graphicsWindow.I.
Referenced by get_unexposed_draw().
bool GraphicsWindow::has_button_event | ( | int | device | ) | const |
Returns true if the indicated device has a pending button event (a mouse button or keyboard button down/up), false otherwise.
If this returns true, the particular event may be extracted via get_button_event().
Definition at line 456 of file graphicsWindow.cxx.
References get_button_event().
Referenced by close_ime().
bool GraphicsWindow::has_keyboard | ( | int | device | ) | const |
Returns true if the nth input device has a keyboard, false otherwise.
Definition at line 332 of file graphicsWindow.cxx.
References get_keyboard_map().
Referenced by has_pointer().
bool GraphicsWindow::has_pointer | ( | int | device | ) | const |
Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise.
Definition at line 315 of file graphicsWindow.cxx.
References has_keyboard().
Referenced by get_input_device_name().
bool GraphicsWindow::has_pointer_event | ( | int | device | ) | const |
Returns true if the indicated device has a pending pointer event (a mouse movement).
If this returns true, the particular event may be extracted via get_pointer_events().
Definition at line 493 of file graphicsWindow.cxx.
References verify_window_sizes().
Referenced by get_button_event().
|
virtual |
Returns true if the window is ready to be rendered into, false otherwise.
Reimplemented from GraphicsOutput.
Definition at line 186 of file graphicsWindow.cxx.
References GraphicsOutput::is_active(), and set_window_event().
Referenced by wdxGraphicsWindow9::end_flip(), and request_properties().
|
inline |
Returns true if the window has not yet been opened, or has been fully closed, false if it is open.
The window is not opened immediately after GraphicsEngine::make_window() is called; nor is it closed immediately after GraphicsEngine::remove_window() is called. Either operation may take a frame or two.
Definition at line 28 of file graphicsWindow.I.
References WindowProperties::get_open(), and is_fullscreen().
|
inline |
Returns true if the window has been opened as a fullscreen window, false otherwise.
Definition at line 39 of file graphicsWindow.I.
References WindowProperties::get_fullscreen(), and set_unexposed_draw().
Referenced by is_closed(), WinGraphicsWindow::set_properties_now(), wdxGraphicsWindow9::verify_window_sizes(), and WinGraphicsWindow::window_proc().
|
virtual |
Returns whether the specified event msg is a touch message.
Reimplemented in WinGraphicsWindow.
Definition at line 899 of file graphicsWindow.cxx.
References get_num_touches().
Referenced by GraphicsWindowProcCallbackData::is_touch_event(), and set_properties_now().
|
virtual |
Forces the pointer to the indicated position within the window, if possible.
Returns true if successful, false on failure. This may fail if the mouse is not currently within the window, or if the API doesn't support this operation.
Reimplemented in WinGraphicsWindow, osxGraphicsWindow, x11GraphicsWindow, CocoaGraphicsWindow, and eglGraphicsWindow.
Definition at line 431 of file graphicsWindow.cxx.
References close_ime().
Referenced by get_pointer().
|
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 GraphicsOutput.
Reimplemented in CallbackGraphicsWindow, WinGraphicsWindow, AndroidGraphicsWindow, osxGraphicsWindow, CocoaGraphicsWindow, x11GraphicsWindow, eglGraphicsWindow, and IPhoneGraphicsWindow.
Definition at line 604 of file graphicsWindow.cxx.
References WindowProperties::add_properties(), WindowProperties::clear(), WindowProperties::is_any_specified(), and set_properties_now().
Referenced by eglGraphicsWindow::process_events(), x11GraphicsWindow::process_events(), AndroidGraphicsWindow::process_events(), WinGraphicsWindow::process_events(), CallbackGraphicsWindow::process_events(), and set_close_now().
|
virtual |
This is called by the GraphicsEngine to request that the window (or whatever) close itself or, in general, make itself invalid, at the next call to process_events().
By that time we promise the gsg pointer will be cleared.
Reimplemented from GraphicsOutput.
Definition at line 573 of file graphicsWindow.cxx.
References set_close_now(), and WindowProperties::set_open().
Referenced by request_open().
|
virtual |
This is called by the GraphicsEngine to request that the window (or whatever) open itself or, in general, make itself valid, at the next call to process_events().
Reimplemented from GraphicsOutput.
Definition at line 557 of file graphicsWindow.cxx.
References request_close(), and WindowProperties::set_open().
Referenced by verify_window_sizes().
void GraphicsWindow::request_properties | ( | const WindowProperties & | requested_properties | ) |
Requests a property change on the window.
For example, use this method to request a window change size or minimize or something.
The change is not made immediately; rather, the request is saved and will be applied the next time the window task is run (probably at the next frame).
Definition at line 164 of file graphicsWindow.cxx.
References is_active().
Referenced by get_rejected_properties().
|
virtual |
This is called by the GraphicsEngine to insist that the window be closed immediately.
This is only called from the window thread.
Reimplemented from GraphicsOutput.
Definition at line 587 of file graphicsWindow.cxx.
References process_events(), and WindowProperties::set_open().
Referenced by request_close().
void GraphicsWindow::set_close_request_event | ( | const string & | close_request_event | ) |
Sets the event that is triggered when the user requests to close the window, e.g.
via alt-F4, or clicking on the close box.
The default for each window is for this event to be the empty string, which means the window-close request is handled immediately by Panda (and the window will be closed without the app getting a chance to intervene). If you set this to a nonempty string, then the window is not closed, but instead the event is thrown. It is then up to the app to respond appropriately, for instance by presenting an "are you sure?" dialog box, and eventually calling close_window() when the user is sure.
It is considered poor form to set this string and then not handle the event. This can frustrate the user by making it difficult for him to cleanly shut down the application (and may force the user to hard-kill the app, or reboot the machine).
Definition at line 249 of file graphicsWindow.cxx.
References get_close_request_event().
Referenced by get_window_event().
|
virtual |
Applies the requested set of properties to the window, if possible, for instance to request a change in size or minimization status.
The window properties are applied immediately, rather than waiting until the next frame. This implies that this method may *only* be called from within the window thread.
The properties that have been applied are cleared from the structure by this function; so on return, whatever remains in the properties structure are those that were unchanged for some reason (probably because the underlying interface does not support changing that property on an open window).
Reimplemented in CallbackGraphicsWindow, WinGraphicsWindow, osxGraphicsWindow, AndroidGraphicsWindow, CocoaGraphicsWindow, x11GraphicsWindow, IPhoneGraphicsWindow, and eglGraphicsWindow.
Definition at line 646 of file graphicsWindow.cxx.
References WindowProperties::add_properties(), WindowProperties::clear(), WindowProperties::clear_fullscreen(), WindowProperties::clear_mouse_mode(), WindowProperties::clear_open(), WindowProperties::clear_origin(), WindowProperties::clear_size(), WindowProperties::get_fullscreen(), WindowProperties::get_mouse_mode(), WindowProperties::get_open(), WindowProperties::get_x_origin(), WindowProperties::get_x_size(), WindowProperties::get_y_origin(), WindowProperties::get_y_size(), WindowProperties::has_fullscreen(), WindowProperties::has_open(), WindowProperties::has_origin(), WindowProperties::has_size(), is_touch_event(), WindowProperties::set_origin(), and WindowProperties::set_size().
Referenced by process_events(), eglGraphicsWindow::set_properties_now(), x11GraphicsWindow::set_properties_now(), AndroidGraphicsWindow::set_properties_now(), WinGraphicsWindow::set_properties_now(), and CallbackGraphicsWindow::set_properties_now().
|
inline |
If this flag is false, the window is redrawn only after it has received a recent "unexpose" or "draw" event from the underlying windowing systme.
If this flag is true, the window is redrawn every frame regardless. Setting this false may prevent the window from redrawing unnecessarily when it is hidden, and may play nicer with other windows on the desktop, but may adversely affect frame rate even when the window is fully visible; setting it true will ensure that the window contents are always current.
Definition at line 58 of file graphicsWindow.I.
References get_unexposed_draw().
Referenced by is_fullscreen().
void GraphicsWindow::set_window_event | ( | const string & | window_event | ) |
Changes the name of the event that is generated when this window is modified externally, e.g.
to be resized or closed by the user.
By default, all windows have the same window event unless they are explicitly changed. When the event is generated, it includes one parameter: the window itself.
Definition at line 204 of file graphicsWindow.cxx.
References get_window_event().
Referenced by is_active().
|
virtual |
Returns whether this window supports adding of Windows proc handlers.
Reimplemented in WinGraphicsWindow.
Definition at line 931 of file graphicsWindow.cxx.
|
virtual |
Determines which of the indicated window sizes are supported by available hardware (e.g.
in fullscreen mode).
On entry, dimen is an array containing contiguous x,y pairs specifying possible display sizes; it is numsizes*2 words long. The function will zero out any invalid x,y size pairs. The return value is the number of valid sizes that were found.
Note this doesn't guarantee a resize attempt will work; you still need to check the return value.
(It might be better to implement some sort of query interface that returns an array of supported sizes, but this way is somewhat simpler and will do the job on most cards, assuming they handle the std sizes the app knows about.)
Reimplemented in wdxGraphicsWindow9.
Definition at line 544 of file graphicsWindow.cxx.
References request_open().
Referenced by has_pointer_event().