Panda3D
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
CallbackGraphicsWindow Class Reference

This special window object doesn't represent a window in its own right, but instead hooks into some third-party API for creating and rendering to windows via callbacks. More...

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

Classes

class  EventsCallbackData
 
class  PropertiesCallbackData
 
class  RenderCallbackData
 
class  WindowCallbackData
 

Public Types

enum  RenderCallbackType { RCT_begin_frame = 0, RCT_end_frame = 1, RCT_begin_flip = 2, RCT_end_flip = 3 }
 
- 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
}
 

Public Member Functions

 clearEventsCallback ()
 Removes the callback set by an earlier call to set_events_callback(). More...
 
 clearPropertiesCallback ()
 Removes the callback set by an earlier call to set_properties_callback(). More...
 
 clearRenderCallback ()
 Removes the callback set by an earlier call to set_render_callback(). More...
 
int createInputDevice (str name)
 Adds a new input device (mouse) to the window with the indicated name. More...
 
CallbackObject getEventsCallback ()
 Returns the CallbackObject set by set_events_callback(). More...
 
CallbackObject getPropertiesCallback ()
 Returns the CallbackObject set by set_properties_callback(). More...
 
CallbackObject getRenderCallback ()
 Returns the CallbackObject set by set_render_callback(). More...
 
 setEventsCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when this window is polled for window events, including mouse and keyboard events, as well as window resize events and other system-generated events. More...
 
 setPropertiesCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when this window receives a property change request from user code (e.g. More...
 
 setRenderCallback (CallbackObject object)
 Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to render its contents, and/or flip the graphics buffers. More...
 
- Public Member Functions inherited from GraphicsWindow
 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 GraphicsWindow
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...
 

Additional Inherited Members

- Public Attributes inherited from GraphicsWindow
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...
 

Detailed Description

This special window object doesn't represent a window in its own right, but instead hooks into some third-party API for creating and rendering to windows via callbacks.

This can be used to allow Panda to render into an already-created OpenGL context, for instance.

Member Enumeration Documentation

◆ RenderCallbackType

Enumerator
RCT_begin_frame 
RCT_end_frame 
RCT_begin_flip 
RCT_end_flip 

Member Function Documentation

◆ clearEventsCallback()

clearEventsCallback ( )

Removes the callback set by an earlier call to set_events_callback().

◆ clearPropertiesCallback()

clearPropertiesCallback ( )

Removes the callback set by an earlier call to set_properties_callback().

◆ clearRenderCallback()

clearRenderCallback ( )

Removes the callback set by an earlier call to set_render_callback().

◆ createInputDevice()

int createInputDevice ( str  name)

Adds a new input device (mouse) to the window with the indicated name.

Returns the index of the new device.

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ getEventsCallback()

CallbackObject getEventsCallback ( )

Returns the CallbackObject set by set_events_callback().

◆ getPropertiesCallback()

CallbackObject getPropertiesCallback ( )

Returns the CallbackObject set by set_properties_callback().

◆ getRenderCallback()

CallbackObject getRenderCallback ( )

Returns the CallbackObject set by set_render_callback().

◆ setEventsCallback()

setEventsCallback ( CallbackObject  object)

Sets the CallbackObject that will be notified when this window is polled for window events, including mouse and keyboard events, as well as window resize events and other system-generated events.

This callback will receive a CallbackGraphicsWindow::EventsCallbackData.

This callback should process any system-generated events, and call data->upcall() to process requested property change requests made via request_properties().

◆ setPropertiesCallback()

setPropertiesCallback ( CallbackObject  object)

Sets the CallbackObject that will be notified when this window receives a property change request from user code (e.g.

via request_properties).

This callback will receive a CallbackGraphicsWindow::PropertiesCallbackData, which provides a get_properties() method that returns a modifiable reference to a WindowsProperties object. This object will contain only those properties requested by user code. The callback should handle any of the requests it finds, including and especially set_open(), and remove them from the object when it has handled them. Any unhandled properties should be left unchanged in the properties object.

◆ setRenderCallback()

setRenderCallback ( CallbackObject  object)

Sets the CallbackObject that will be notified when this window is invoked (in the draw thread) to render its contents, and/or flip the graphics buffers.

This callback will actually serve several different functions. It receivces a RenderCallbackData, and you can query data->get_callback_type() to return the actual function of each particular callback.