Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GraphicsWindow Class Reference

A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display. More...

Inheritance diagram for GraphicsWindow:
GraphicsOutput GraphicsOutputBase DrawableRegion TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject CallbackGraphicsWindow

Public Member Functions

 clearRejectedProperties ()
 Empties the set of failed properties that will be returned by get_rejected_properties(). More...
 
 closeIme ()
 Forces the ime window to close if any. More...
 
 disablePointerEvents (int device)
 Turn off the generation of pointer events. More...
 
 enablePointerEvents (int device)
 Turn on the generation of pointer events. More...
 
str getCloseRequestEvent ()
 Returns the name of the event set via set_close_request_event(). More...
 
InputDevice getInputDevice (int i)
 Returns the nth input device associated with the window. More...
 
str getInputDeviceName (int device)
 Returns the name of the nth input device. More...
 
list getInputDeviceNames ()
 
list getInputDevices ()
 
ButtonMap getKeyboardMap ()
 Returns a ButtonMap containing the association between raw buttons and virtual buttons. More...
 
int getNumInputDevices ()
 Returns the number of separate input devices associated with the window. More...
 
MouseData getPointer (int device)
 Returns the MouseData associated with the nth input device's pointer. More...
 
const WindowProperties getProperties ()
 Returns the current properties of the window. More...
 
WindowProperties getRejectedProperties ()
 Returns the set of properties that have recently been requested, but could not be applied to the window for some reason. More...
 
const WindowProperties getRequestedProperties ()
 Returns the properties of the window that are currently requested. More...
 
bool getUnexposedDraw ()
 See set_unexposed_draw(). More...
 
str getWindowEvent ()
 Returns the name of the event that is generated when this window is modified externally, e.g. More...
 
WindowHandle getWindowHandle ()
 Returns the WindowHandle corresponding to this window on the desktop. More...
 
bool hasKeyboard (int device)
 Returns true if the nth input device has a keyboard, false otherwise. More...
 
bool hasPointer (int device)
 Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise. More...
 
bool isClosed ()
 Returns true if the window has not yet been opened, or has been fully closed, false if it is open. More...
 
bool isFullscreen ()
 Returns true if the window has been opened as a fullscreen window, false otherwise. More...
 
bool movePointer (int device, int x, int y)
 Forces the pointer to the indicated position within the window, if possible. More...
 
 requestProperties (const WindowProperties requested_properties)
 Requests a property change on the window. More...
 
 setCloseRequestEvent (str close_request_event)
 Sets the event that is triggered when the user requests to close the window, e.g. More...
 
 setUnexposedDraw (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...
 
 setWindowEvent (str window_event)
 Changes the name of the event that is generated when this window is modified externally, e.g. More...
 
- Public Member Functions inherited from GraphicsOutput
 addRenderTexture (Texture tex, GraphicsOutput::RenderTextureMode mode, DrawableRegion::RenderTexturePlane bitplane)
 Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures. More...
 
 clearChildSort ()
 Resets the sort value of future offscreen buffers created by make_texture_sort() to the default value. More...
 
 clearDeleteFlag ()
 Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame. More...
 
 clearRenderTextures ()
 If the GraphicsOutput is currently rendering to a texture, then all textures are dissociated from the GraphicsOuput. More...
 
int countTextures ()
 If the GraphicsOutput is set to render into a texture, returns the number of textures that are being rendered into. More...
 
bool flipReady ()
 
DisplayRegion getActiveDisplayRegion (int n)
 Returns the nth active DisplayRegion of those that have been created within the window. More...
 
list getActiveDisplayRegions ()
 
int getChildSort ()
 Returns the sort value of future offscreen buffers created by make_texture_sort(). More...
 
bool getDeleteFlag ()
 Returns the current setting of the delete flag. More...
 
DisplayRegion getDisplayRegion (int n)
 Returns the nth DisplayRegion of those that have been created within the window. More...
 
list getDisplayRegions ()
 
GraphicsEngine getEngine ()
 Returns the graphics engine that created this output. More...
 
const FrameBufferProperties getFbProperties ()
 Returns the framebuffer properties of the window. More...
 
LVecBase2i getFbSize ()
 Returns the internal size of the window or buffer. More...
 
int getFbXSize ()
 Returns the internal width of the window or buffer. More...
 
int getFbYSize ()
 Returns the internal height of the window or buffer. More...
 
GraphicsStateGuardian getGsg ()
 Returns the GSG that is associated with this window. More...
 
GraphicsOutput getHost ()
 This is normally called only from within make_texture_buffer(). More...
 
bool getInverted ()
 Returns the current setting of the inverted flag. More...
 
unsigned int getLeftEyeColorMask ()
 Returns the color mask in effect when rendering a left-eye view in red_blue stereo mode. More...
 
str getName ()
 Returns the name that was passed to the GraphicsOutput constructor. More...
 
int getNumActiveDisplayRegions ()
 Returns the number of active DisplayRegions that have been created within the window. More...
 
int getNumDisplayRegions ()
 Returns the number of DisplayRegions that have been created within the window, active or otherwise. More...
 
bool getOneShot ()
 Returns the current setting of the one-shot flag. More...
 
DisplayRegion getOverlayDisplayRegion ()
 Returns the special "overlay" DisplayRegion that is created for each window or buffer. More...
 
GraphicsPipe getPipe ()
 Returns the GraphicsPipe that this window is associated with. More...
 
bool getRedBlueStereo ()
 Returns whether red-blue stereo mode is in effect for this particular window. More...
 
unsigned int getRightEyeColorMask ()
 Returns the color mask in effect when rendering a right-eye view in red_blue stereo mode. More...
 
GraphicsOutput::RenderTextureMode getRtmMode (int i)
 Returns the RenderTextureMode associated with the nth render-texture. More...
 
const LVecBase4 getSbsLeftDimensions ()
 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 getSbsLeftSize ()
 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 getSbsLeftXSize ()
 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 getSbsLeftYSize ()
 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 getSbsRightDimensions ()
 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 getSbsRightSize ()
 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 getSbsRightXSize ()
 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 getSbsRightYSize ()
 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...
 
Texture getScreenshot ()
 Captures the most-recently rendered image from the framebuffer and returns it as Texture, or NULL on failure. More...
 
bool getScreenshot (PNMImage image)
 Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More...
 
bool getSideBySideStereo ()
 Returns whether side-by-side stereo mode is in effect for this particular window. More...
 
const LVecBase2i getSize ()
 Returns the visible size of the window or buffer, if it is known. More...
 
int getSort ()
 Returns the sorting order of this particular GraphicsOutput. More...
 
bool getSupportsRenderTexture ()
 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 getSwapEyes ()
 Returns the current setting of the "swap eyes" flag. More...
 
Texture getTexture (int i)
 Returns the nth texture into which the GraphicsOutput renders. More...
 
NodePath getTextureCard ()
 Returns a PandaNode containing a square polygon. More...
 
DrawableRegion::RenderTexturePlane getTexturePlane (int i)
 Returns the RenderTexturePlane associated with the nth render-texture. More...
 
int getXSize ()
 Returns the visible width of the window or buffer, if it is known. More...
 
int getYSize ()
 Returns the visible height of the window or buffer, if it is known. More...
 
bool hasSize ()
 Returns true if the size of the window/frame buffer is known, false otherwise. More...
 
bool hasTexture ()
 Returns true if the GraphicsOutput is rendering into any textures at all. More...
 
bool isActive ()
 Returns true if the window is ready to be rendered into, false otherwise. More...
 
bool isNonzeroSize ()
 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 isStereo ()
 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 isValid ()
 Returns true if the output is fully created and ready for rendering, false otherwise. More...
 
GraphicsOutput makeCubeMap (str name, int size, NodePath camera_rig, DrawMask camera_mask, bool to_ram, FrameBufferProperties fbp)
 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 makeDisplayRegion ()
 Creates a new DisplayRegion that covers the entire window. More...
 
DisplayRegion makeDisplayRegion (const LVecBase4 dimensions)
 Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More...
 
DisplayRegion makeDisplayRegion (float l, float r, float b, float t)
 Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More...
 
DisplayRegion makeMonoDisplayRegion ()
 Creates a new DisplayRegion that covers the entire window. More...
 
DisplayRegion makeMonoDisplayRegion (const LVecBase4 dimensions)
 Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More...
 
DisplayRegion makeMonoDisplayRegion (float l, float r, float b, float t)
 Creates a new DisplayRegion that covers the entire window. More...
 
StereoDisplayRegion makeStereoDisplayRegion ()
 Creates a new DisplayRegion that covers the entire window. More...
 
StereoDisplayRegion makeStereoDisplayRegion (const LVecBase4 dimensions)
 Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. More...
 
StereoDisplayRegion makeStereoDisplayRegion (float l, float r, float b, float t)
 Creates a new DisplayRegion that covers the entire window. More...
 
GraphicsOutput makeTextureBuffer (str name, int x_size, int y_size, Texture tex, bool to_ram, FrameBufferProperties fbp)
 Creates and returns an offscreen buffer for rendering into, the result of which will be a texture suitable for applying to geometry within the scene rendered into this window. More...
 
 removeAllDisplayRegions ()
 Removes all display regions from the window, except the default one that is created with the window. More...
 
bool removeDisplayRegion (DisplayRegion display_region)
 Removes the indicated DisplayRegion from the window, and destructs it if there are no other references. More...
 
bool saveScreenshot (const Filename filename, str image_comment)
 Saves a screenshot of the region to the indicated filename. More...
 
Filename saveScreenshotDefault (str prefix)
 Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More...
 
 setActive (bool active)
 Sets the active flag associated with the GraphicsOutput. More...
 
 setChildSort (int child_sort)
 Specifies the sort value of future offscreen buffers created by make_texture_sort(). More...
 
 setInverted (bool inverted)
 Changes the current setting of the inverted flag. More...
 
 setOneShot (bool one_shot)
 Changes the current setting of the one-shot flag. More...
 
 setOverlayDisplayRegion (DisplayRegion display_region)
 Replaces the special "overlay" DisplayRegion that is created for each window or buffer. More...
 
 setRedBlueStereo (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...
 
 setSideBySideStereo (bool side_by_side_stereo)
 Enables side-by-side stereo mode on this particular window. More...
 
 setSideBySideStereo (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...
 
 setSort (int sort)
 Adjusts the sorting order of this particular GraphicsOutput, relative to other GraphicsOutputs. More...
 
 setSwapEyes (bool swap_eyes)
 Changes the "swap eyes" flag. More...
 
 setupRenderTexture (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...
 
bool shareDepthBuffer (GraphicsOutput graphics_output)
 Will attempt to use the depth buffer of the input graphics_output. More...
 
AsyncFuture triggerCopy ()
 When the GraphicsOutput is in triggered copy mode, this function triggers the copy (at the end of the next frame). More...
 
 unshareDepthBuffer ()
 Discontinue sharing the depth buffer. More...
 
- Public Member Functions inherited from GraphicsOutputBase
Texture getTexture (int i)
 
 setSort (int sort)
 
- Public Member Functions inherited from TypedWritable
object __reduce__ ()
 
object __reduce_persist__ (object pickler)
 
VectorUchar encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object. More...
 
bool encodeToBamStream (VectorUchar data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. More...
 
 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...
 
UpdateSeq getBamModified ()
 Returns the current bam_modified counter. More...
 
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
bool unref ()
 Explicitly decrements the reference count. More...
 
- Public Member Functions inherited from DrawableRegion
 disableClears ()
 Disables both the color and depth clear. More...
 
bool getClearActive (int n)
 Gets the clear-active flag for any bitplane. More...
 
const LColor getClearColor ()
 Returns the current clear color value. More...
 
bool getClearColorActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
float getClearDepth ()
 Returns the current clear depth value. More...
 
bool getClearDepthActive ()
 Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More...
 
unsigned int getClearStencil ()
 Returns the current clear stencil value. More...
 
bool getClearStencilActive ()
 Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More...
 
const LColor getClearValue (int n)
 Returns the clear value for any bitplane. More...
 
float getPixelFactor ()
 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...
 
float getPixelZoom ()
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More...
 
bool isAnyClearActive ()
 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...
 
 setClearActive (int n, bool clear_aux_active)
 Sets the clear-active flag for any bitplane. More...
 
 setClearColor (const LColor color)
 Sets the clear color to the indicated value. More...
 
 setClearColorActive (bool clear_color_active)
 Toggles the flag that indicates whether the color buffer should be cleared every frame. More...
 
 setClearDepth (float depth)
 Sets the clear depth to the indicated value. More...
 
 setClearDepthActive (bool clear_depth_active)
 Toggles the flag that indicates whether the depth buffer should be cleared every frame. More...
 
 setClearStencil (unsigned int stencil)
 
 setClearStencilActive (bool clear_stencil_active)
 Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More...
 
 setClearValue (int n, const LColor clear_value)
 Sets the clear value for any bitplane. More...
 
 setPixelZoom (float pixel_zoom)
 Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More...
 
bool supportsPixelZoom ()
 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 getClassType ()
 
- Static Public Member Functions inherited from GraphicsOutput
static TypeHandle getClassType ()
 
static Filename makeScreenshotFilename (str prefix)
 Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More...
 
- Static Public Member Functions inherited from GraphicsOutputBase
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypedWritableReferenceCount decodeFromBamStream (VectorUchar data, BamReader reader)
 Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on those bytes. More...
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritable
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from DrawableRegion
static int getRenderbufferType (int plane)
 Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More...
 

Public Attributes

String close_request_event
 Returns the name of the event set via set_close_request_event(). More...
 
bool closed
 Returns true if the window has not yet been opened, or has been fully closed, false if it is open. More...
 
WindowProperties properties
 Returns the current properties of the window. More...
 
WindowProperties rejected_properties
 Returns the set of properties that have recently been requested, but could not be applied to the window for some reason. More...
 
WindowProperties requested_properties
 Returns the properties of the window that are currently requested. More...
 
bool unexposed_draw
 See set_unexposed_draw(). More...
 
String window_event
 Returns the name of the event that is generated when this window is modified externally, e.g. More...
 
WindowHandle window_handle
 Returns the WindowHandle corresponding to this window on the desktop. More...
 
- Public Attributes inherited from GraphicsOutput
bool active
 Returns true if the window is ready to be rendered into, false otherwise. More...
 
PointerToDisplayRegion active_display_regions []
 
int child_sort
 Returns the sort value of future offscreen buffers created by make_texture_sort(). More...
 
PointerToDisplayRegion display_regions []
 
GraphicsEngine engine
 Returns the graphics engine that created this output. More...
 
LVecBase2i fb_size
 Returns the internal size of the window or buffer. More...
 
GraphicsStateGuardian gsg
 Returns the GSG that is associated with this window. More...
 
bool inverted
 Returns the current setting of the inverted flag. More...
 
const String name
 Returns the name that was passed to the GraphicsOutput constructor. More...
 
bool one_shot
 Returns the current setting of the one-shot flag. More...
 
GraphicsPipe pipe
 Returns the GraphicsPipe that this window is associated with. More...
 
LVecBase2i sbs_left_size
 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...
 
LVecBase2i sbs_right_size
 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...
 
const LVecBase2i size
 Returns the visible size of the window or buffer, if it is known. More...
 
int sort
 Returns the sorting order of this particular GraphicsOutput. More...
 
bool supports_render_texture
 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 swap_eyes
 Returns the current setting of the "swap eyes" flag. More...
 
- Public Attributes inherited from TypedObject
TypeHandle type
 Returns the TypeHandle representing this object's type. More...
 
- Public Attributes inherited from ReferenceCount
int ref_count
 The current reference count. More...
 
- Public Attributes inherited from DrawableRegion
const LColor clear_color
 Returns the current clear color value. More...
 
float clear_depth
 Returns the current clear depth value. More...
 
unsigned int clear_stencil
 Returns the current clear stencil value. More...
 
float pixel_factor
 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...
 
float pixel_zoom
 Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More...
 

Additional Inherited Members

- Public Types inherited from GraphicsOutput
enum  FrameMode { FM_render = 0, FM_parasite = 1, FM_refresh = 2 }
 
enum  RenderTextureMode {
  RTM_none = 0, RTM_bind_or_copy = 1, RTM_copy_texture = 2, RTM_copy_ram = 3,
  RTM_triggered_copy_texture = 4, RTM_triggered_copy_ram = 5, RTM_bind_layered = 6
}
 
- Public Types inherited from DrawableRegion
enum  RenderTexturePlane {
  RTP_stencil = 0, RTP_depth_stencil = 1, RTP_color = 2, RTP_aux_rgba_0 = 3,
  RTP_aux_rgba_1 = 4, RTP_aux_rgba_2 = 5, RTP_aux_rgba_3 = 6, RTP_aux_hrgba_0 = 7,
  RTP_aux_hrgba_1 = 8, RTP_aux_hrgba_2 = 9, RTP_aux_hrgba_3 = 10, RTP_aux_float_0 = 11,
  RTP_aux_float_1 = 12, RTP_aux_float_2 = 13, RTP_aux_float_3 = 14, RTP_depth = 15,
  RTP_COUNT = 16
}
 

Detailed Description

A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display.

Member Function Documentation

◆ clearRejectedProperties()

clearRejectedProperties ( )

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

◆ closeIme()

closeIme ( )

Forces the ime window to close if any.

◆ disablePointerEvents()

disablePointerEvents ( int  device)

Turn off the generation of pointer events.

◆ enablePointerEvents()

enablePointerEvents ( int  device)

Turn on the generation of pointer events.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getCloseRequestEvent()

str getCloseRequestEvent ( )

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

◆ getInputDevice()

InputDevice getInputDevice ( int  i)

Returns the nth input device associated with the window.

Typically, a window will have exactly one input device: the keyboard/mouse pair.

◆ getInputDeviceName()

str getInputDeviceName ( int  device)

Returns the name of the nth input device.

◆ getInputDeviceNames()

list getInputDeviceNames ( )

◆ getInputDevices()

list getInputDevices ( )

◆ getKeyboardMap()

ButtonMap getKeyboardMap ( )

Returns a ButtonMap containing the association between raw buttons and virtual buttons.

◆ getNumInputDevices()

int getNumInputDevices ( )

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.

◆ getPointer()

MouseData getPointer ( int  device)

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.

◆ getProperties()

const WindowProperties getProperties ( )

Returns the current properties of the window.

◆ getRejectedProperties()

WindowProperties getRejectedProperties ( )

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.

◆ getRequestedProperties()

const WindowProperties getRequestedProperties ( )

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

◆ getUnexposedDraw()

bool getUnexposedDraw ( )

See set_unexposed_draw().

◆ getWindowEvent()

str getWindowEvent ( )

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

◆ getWindowHandle()

WindowHandle getWindowHandle ( )

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.

◆ hasKeyboard()

bool hasKeyboard ( int  device)

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

◆ hasPointer()

bool hasPointer ( int  device)

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

◆ isClosed()

bool isClosed ( )

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.

◆ isFullscreen()

bool isFullscreen ( )

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

◆ movePointer()

bool movePointer ( int  device,
int  x,
int  y 
)

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.

◆ requestProperties()

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

◆ setCloseRequestEvent()

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

◆ setUnexposedDraw()

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

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.

◆ setWindowEvent()

setWindowEvent ( str  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.

Member Data Documentation

◆ close_request_event

String close_request_event

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

◆ closed

bool closed

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.

◆ properties

WindowProperties properties

Returns the current properties of the window.

◆ rejected_properties

WindowProperties rejected_properties

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.

◆ requested_properties

WindowProperties requested_properties

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

◆ unexposed_draw

bool unexposed_draw

See set_unexposed_draw().

◆ window_event

String window_event

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

◆ window_handle

WindowHandle window_handle

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.