Panda3D
|
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display. More...
Public Types | |
enum | FrameMode { FMRender = 0, FMParasite = 1, FMRefresh = 2 } |
enum | RenderTextureMode { RTMNone = 0, RTMBindOrCopy = 1, RTMCopyTexture = 2, RTMCopyRam = 3, RTMTriggeredCopyTexture = 4, RTMTriggeredCopyRam = 5 } |
enum | RenderTexturePlane { RTPStencil = 0, RTPDepthStencil = 1, RTPColor = 2, RTPAuxRgba0 = 3, RTPAuxRgba1 = 4, RTPAuxRgba2 = 5, RTPAuxRgba3 = 6, RTPAuxHrgba0 = 7, RTPAuxHrgba1 = 8, RTPAuxHrgba2 = 9, RTPAuxHrgba3 = 10, RTPAuxFloat0 = 11, RTPAuxFloat1 = 12, RTPAuxFloat2 = 13, RTPAuxFloat3 = 14, RTPDepth = 15, RTPCOUNT = 16 } |
Public Member Functions | |
addRenderTexture (Texture tex, RenderTextureMode mode, 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. | |
addRenderTexture (Texture tex, RenderTextureMode mode) | |
Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures. | |
clearChildSort () | |
Resets the sort value of future offscreen buffers created by make_texture_sort() to the default value. | |
clearDeleteFlag () | |
Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame. | |
clearRejectedProperties () | |
Empties the set of failed properties that will be returned by get_rejected_properties(). | |
clearRenderTextures () | |
If the GraphicsOutput is currently rendering to a texture, then all textures are dissociated from the GraphicsOuput. | |
closeIme () | |
Forces the ime window to close if any. | |
int | countTextures () |
If the GraphicsOutput is set to render into a texture, returns the number of textures that are being rendered into. | |
disableClears () | |
Disables both the color and depth clear. | |
disablePointerEvents (int device) | |
Turn off the generation of pointer events. | |
disablePointerMode (int device) | |
See GraphicsWindowInputDevice.disable_pointer_mode. | |
enablePointerEvents (int device) | |
Turn on the generation of pointer events. | |
enablePointerMode (int device, double speed) | |
See GraphicsWindowInputDevice.enable_pointer_mode. | |
string | encodeToBamStream () |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. | |
bool | encodeToBamStream (basic_stringchar data, BamWriter writer) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
bool | encodeToBamStream (basic_stringchar data) |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. | |
DisplayRegion | getActiveDisplayRegion (int n) |
Returns the nth active DisplayRegion of those that have been created within the window. | |
list | getActiveDisplayRegions () |
UpdateSeq | getBamModified () |
Returns the current bam_modified counter. | |
int | getChildSort () |
Returns the sort value of future offscreen buffers created by make_texture_sort(). | |
bool | getClearActive (int n) |
Gets the clear-active flag for any bitplane. | |
VBase4 const | getClearColor () |
Returns the current clear color value. | |
bool | getClearColorActive () |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. | |
float | getClearDepth () |
Returns the current clear depth value. | |
bool | getClearDepthActive () |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. | |
unsigned int | getClearStencil () |
Returns the current clear stencil value. | |
bool | getClearStencilActive () |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. | |
VBase4 const | getClearValue (int n) |
Returns the clear value for any bitplane. | |
string | getCloseRequestEvent () |
Returns the name of the event set via set_close_request_event(). | |
bool | getDeleteFlag () |
Returns the current setting of the delete flag. | |
DisplayRegion | getDisplayRegion (int n) |
Returns the nth DisplayRegion of those that have been created within the window. | |
list | getDisplayRegions () |
GraphicsEngine | getEngine () |
Returns the graphics engine that created this output. | |
FrameBufferProperties const | getFbProperties () |
Returns the framebuffer properties of the window. | |
int | getFbXSize () |
Returns the internal width of the window or buffer. | |
int | getFbYSize () |
Returns the internal height of the window or buffer. | |
GraphicsStateGuardian | getGsg () |
Returns the GSG that is associated with this window. | |
string | getInputDeviceName (int device) |
Returns the name of the nth input device. | |
list | getInputDeviceNames () |
bool | getInverted () |
Returns the current setting of the inverted flag. | |
unsigned int | getLeftEyeColorMask () |
Returns the color mask in effect when rendering a left-eye view in red_blue stereo mode. | |
string | getName () |
Returns the name that was passed to the GraphicsOutput constructor. | |
int | getNumActiveDisplayRegions () |
Returns the number of active DisplayRegions that have been created within the window. | |
int | getNumDisplayRegions () |
Returns the number of DisplayRegions that have been created within the window, active or otherwise. | |
int | getNumInputDevices () |
Returns the number of separate input devices associated with the window. | |
bool | getOneShot () |
Returns the current setting of the one-shot flag. | |
GraphicsPipe | getPipe () |
Returns the GraphicsPipe that this window is associated with. | |
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(). | |
float | getPixelZoom () |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. | |
MouseData | getPointer (int device) |
Returns the MouseData associated with the nth input device's pointer. | |
WindowProperties const | getProperties () |
Returns the current properties of the window. | |
bool | getRedBlueStereo () |
Returns whether red-blue stereo mode is in effect for this particular window. | |
int | getRefCount () |
Returns the current reference count. | |
WindowProperties | getRejectedProperties () |
Returns the set of properties that have recently been requested, but could not be applied to the window for some reason. | |
WindowProperties const | getRequestedProperties () |
Returns the properties of the window that are currently requested. | |
unsigned int | getRightEyeColorMask () |
Returns the color mask in effect when rendering a right-eye view in red_blue stereo mode. | |
RenderTextureMode | getRtmMode (int i) |
Returns the RenderTextureMode associated with the nth render-texture. | |
RenderTextureMode | getRtmMode () |
Returns the RenderTextureMode associated with the nth render-texture. | |
bool | getScreenshot (PNMImage image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. | |
int | getSort () |
Returns the sorting order of this particular GraphicsOutput. | |
Texture | getTexture () |
Returns the nth texture into which the GraphicsOutput renders. | |
Texture | getTexture (int i) |
Returns the nth texture into which the GraphicsOutput renders. | |
NodePath | getTextureCard () |
Returns a PandaNode containing a square polygon. | |
RenderTexturePlane | getTexturePlane () |
Returns the RenderTexturePlane associated with the nth render-texture. | |
RenderTexturePlane | getTexturePlane (int i) |
Returns the RenderTexturePlane associated with the nth render-texture. | |
TypeHandle | getType () |
int | getTypeIndex () |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
string | getWindowEvent () |
Returns the name of the event that is generated when this window is modified externally, e.g. | |
WindowHandle | getWindowHandle () |
Returns the WindowHandle corresponding to this window on the desktop. | |
int | getXSize () |
Returns the visible width of the window or buffer, if it is known. | |
int | getYSize () |
Returns the visible height of the window or buffer, if it is known. | |
bool | hasKeyboard (int device) |
Returns true if the nth input device has a keyboard, false otherwise. | |
bool | hasPointer (int device) |
Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise. | |
bool | hasSize () |
Returns true if the size of the window/frame buffer is known, false otherwise. | |
bool | hasTexture () |
Returns true if the GraphicsOutput is rendering into any textures at all. | |
bool | isActive () |
Returns true if the window is ready to be rendered into, false otherwise. | |
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. | |
bool | isClosed () |
Returns true if the window has not yet been opened, or has been fully closed, false if it is open. | |
bool | isExactType (TypeHandle handle) |
Returns true if the current object is the indicated type exactly. | |
bool | isFullscreen () |
Returns true if the window has been opened as a fullscreen window, false otherwise. | |
bool | isOfType (TypeHandle handle) |
Returns true if the current object is or derives from the indicated type. | |
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. | |
bool | isValid () |
Returns true if the output is fully created and ready for rendering, false otherwise. | |
GraphicsOutput | makeCubeMap (string name, int size, NodePath camera_rig, BitMaskunsigned int, 32 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. | |
GraphicsOutput | makeCubeMap (string name, int size, NodePath camera_rig, BitMaskunsigned int, 32 camera_mask, bool to_ram) |
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. | |
GraphicsOutput | makeCubeMap (string name, int size, NodePath camera_rig) |
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. | |
GraphicsOutput | makeCubeMap (string name, int size, NodePath camera_rig, BitMaskunsigned int, 32 camera_mask) |
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. | |
DisplayRegion | makeDisplayRegion () |
Creates a new DisplayRegion that covers the entire window. | |
DisplayRegion | makeDisplayRegion (float l, float r, float b, float t) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. | |
DisplayRegion | makeMonoDisplayRegion () |
Creates a new DisplayRegion that covers the entire window. | |
DisplayRegion | makeMonoDisplayRegion (float l, float r, float b, float t) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. | |
StereoDisplayRegion | makeStereoDisplayRegion (float l, float r, float b, float t) |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window. | |
StereoDisplayRegion | makeStereoDisplayRegion () |
Creates a new DisplayRegion that covers the entire window. | |
GraphicsOutput | makeTextureBuffer (string name, int x_size, int y_size, Texture tex) |
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. | |
GraphicsOutput | makeTextureBuffer (string 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. | |
GraphicsOutput | makeTextureBuffer (string name, int x_size, int y_size, Texture tex, bool to_ram) |
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. | |
GraphicsOutput | makeTextureBuffer (string name, int x_size, int y_size) |
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. | |
markBamModified () | |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. | |
bool | movePointer (int device, int x, int y) |
Forces the pointer to the indicated position within the window, if possible. | |
PyObject | reduce (PyObject self) |
This special Python method is implement to provide support for the pickle module. | |
PyObject | reducePersist (PyObject self, PyObject pickler) |
This special Python method is implement to provide support for the pickle module. | |
ref () | |
Explicitly increments the reference count. | |
removeAllDisplayRegions () | |
Removes all display regions from the window, except the default one that is created with the window. | |
bool | removeDisplayRegion (DisplayRegion display_region) |
Removes the indicated DisplayRegion from the window, and destructs it if there are no other references. | |
requestProperties (WindowProperties const requested_properties) | |
Requests a property change on the window. | |
bool | saveScreenshot (Filename const filename) |
Saves a screenshot of the region to the indicated filename. | |
bool | saveScreenshot (Filename const filename, string image_comment) |
Saves a screenshot of the region to the indicated filename. | |
Filename | saveScreenshotDefault () |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. | |
Filename | saveScreenshotDefault (string prefix) |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. | |
setActive (bool active) | |
Sets the active flag associated with the GraphicsOutput. | |
setChildSort (int child_sort) | |
Specifies the sort value of future offscreen buffers created by make_texture_sort(). | |
setClearActive (int n, bool clear_aux_active) | |
Sets the clear-active flag for any bitplane. | |
setClearColor (VBase4 const color) | |
Sets the clear color to the indicated value. | |
setClearColorActive (bool clear_color_active) | |
Toggles the flag that indicates whether the color buffer should be cleared every frame. | |
setClearDepth (float depth) | |
Sets the clear depth to the indicated value. | |
setClearDepthActive (bool clear_depth_active) | |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. | |
setClearStencil (unsigned int stencil) | |
setClearStencilActive (bool clear_stencil_active) | |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame. | |
setClearValue (int n, VBase4 const clear_value) | |
Sets the clear value for any bitplane. | |
setCloseRequestEvent (string close_request_event) | |
Sets the event that is triggered when the user requests to close the window, e.g. | |
setInverted (bool inverted) | |
Changes the current setting of the inverted flag. | |
setOneShot (bool one_shot) | |
Changes the current setting of the one-shot flag. | |
setPixelZoom (float pixel_zoom) | |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally. | |
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. | |
setSort (int sort) | |
Adjusts the sorting order of this particular GraphicsOutput, relative to other GraphicsOutputs. | |
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. | |
setWindowEvent (string window_event) | |
Changes the name of the event that is generated when this window is modified externally, e.g. | |
bool | shareDepthBuffer (GraphicsOutput graphics_output) |
Will attempt to use the depth buffer of the input graphics_output. | |
bool | supportsPixelZoom () |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. | |
bool | testRefCountIntegrity () |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | testRefCountNonzero () |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
triggerCopy () | |
When the GraphicsOutput is in triggered copy mode, this function triggers the copy (at the end of the next frame). | |
bool | unref () |
Explicitly decrements the reference count. | |
unshareDepthBuffer () | |
Discontinue sharing the depth buffer. | |
Static Public Member Functions | |
static TypedWritableReferenceCount | decodeFromBamStream (string data, BamReader reader) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypedWritableReferenceCount | decodeFromBamStream (string data) |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. | |
static TypeHandle | getClassType () |
static int | getRenderbufferType (int plane) |
Returns the RenderBuffer.Type that corresponds to a RenderTexturePlane. | |
static Filename | makeScreenshotFilename (string prefix) |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. | |
static Filename | makeScreenshotFilename () |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. |
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive display.
enum FrameMode [inherited] |
enum RenderTextureMode [inherited] |
enum RenderTexturePlane [inherited] |
addRenderTexture | ( | Texture | tex, |
RenderTextureMode | mode, | ||
RenderTexturePlane | bitplane | ||
) | [inherited] |
Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created, in which case you may call get_texture() to retrieve the new texture pointer.
You can specify a bitplane to attach the texture to. the legal choices are:
RTP_depth RTP_depth_stencil RTP_color RTP_aux_rgba_0 RTP_aux_rgba_1 RTP_aux_rgba_2 RTP_aux_rgba_3
If you do not specify a bitplane to attach the texture to, this routine will use a default based on the texture's format:
F_depth_component attaches to RTP_depth F_depth_stencil attaches to RTP_depth_stencil all other formats attach to RTP_color.
The texture's format will be changed to match the format of the bitplane to which it is attached. For example, if you pass in an F_rgba texture and order that it be attached to RTP_depth_stencil, it will turn into an F_depth_stencil texture.
Also see make_texture_buffer(), which is a higher-level interface for preparing render-to-a-texture mode.
addRenderTexture | ( | Texture | tex, |
RenderTextureMode | mode | ||
) | [inherited] |
Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created, in which case you may call get_texture() to retrieve the new texture pointer.
You can specify a bitplane to attach the texture to. the legal choices are:
RTP_depth RTP_depth_stencil RTP_color RTP_aux_rgba_0 RTP_aux_rgba_1 RTP_aux_rgba_2 RTP_aux_rgba_3
If you do not specify a bitplane to attach the texture to, this routine will use a default based on the texture's format:
F_depth_component attaches to RTP_depth F_depth_stencil attaches to RTP_depth_stencil all other formats attach to RTP_color.
The texture's format will be changed to match the format of the bitplane to which it is attached. For example, if you pass in an F_rgba texture and order that it be attached to RTP_depth_stencil, it will turn into an F_depth_stencil texture.
Also see make_texture_buffer(), which is a higher-level interface for preparing render-to-a-texture mode.
clearChildSort | ( | ) | [inherited] |
Resets the sort value of future offscreen buffers created by make_texture_sort() to the default value.
See set_child_sort().
clearDeleteFlag | ( | ) | [inherited] |
Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame.
clearRejectedProperties | ( | ) |
Empties the set of failed properties that will be returned by get_rejected_properties().
clearRenderTextures | ( | ) | [inherited] |
If the GraphicsOutput is currently rendering to a texture, then all textures are dissociated from the GraphicsOuput.
closeIme | ( | ) |
Forces the ime window to close if any.
int countTextures | ( | ) | [inherited] |
If the GraphicsOutput is set to render into a texture, returns the number of textures that are being rendered into.
Normally, the textures would be associated with different buffers - a color texture, a depth texture, and a stencil texture.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data, |
BamReader | reader | ||
) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
static TypedWritableReferenceCount decodeFromBamStream | ( | string | data | ) | [static, inherited] |
Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
Returns NULL on error.
This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.
disableClears | ( | ) | [inherited] |
Disables both the color and depth clear.
See set_clear_color_active and set_clear_depth_active.
disablePointerEvents | ( | int | device | ) |
Turn off the generation of pointer events.
disablePointerMode | ( | int | device | ) |
See GraphicsWindowInputDevice.disable_pointer_mode.
enablePointerEvents | ( | int | device | ) |
Turn on the generation of pointer events.
enablePointerMode | ( | int | device, |
double | speed | ||
) |
See GraphicsWindowInputDevice.enable_pointer_mode.
string encodeToBamStream | ( | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
Returns empty string on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data, |
BamWriter | writer | ||
) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
bool encodeToBamStream | ( | basic_stringchar | data | ) | [inherited] |
Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
Returns true on success, false on failure.
This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.
DisplayRegion getActiveDisplayRegion | ( | int | n | ) | [inherited] |
Returns the nth active DisplayRegion of those that have been created within the window.
This may return NULL if n is out of bounds; particularly likely if the number of display regions has changed since the last call to get_num_active_display_regions().
list getActiveDisplayRegions | ( | ) | [inherited] |
UpdateSeq getBamModified | ( | ) | [inherited] |
Returns the current bam_modified counter.
This counter is normally incremented automatically whenever the object is modified.
int getChildSort | ( | ) | [inherited] |
Returns the sort value of future offscreen buffers created by make_texture_sort().
See set_child_sort().
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from GraphicsOutput.
bool getClearActive | ( | int | n | ) | [inherited] |
Gets the clear-active flag for any bitplane.
VBase4 const getClearColor | ( | ) | [inherited] |
Returns the current clear color value.
This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.
bool getClearColorActive | ( | ) | [inherited] |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.
See set_clear_color_active().
float getClearDepth | ( | ) | [inherited] |
Returns the current clear depth value.
This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.
bool getClearDepthActive | ( | ) | [inherited] |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame.
See set_clear_depth_active().
unsigned int getClearStencil | ( | ) | [inherited] |
Returns the current clear stencil value.
This is the value that will be used to clear the stencil buffer every frame, but only if get_clear_stencil_active() returns true. If get_clear_stencil_active() returns false, this is meaningless.
bool getClearStencilActive | ( | ) | [inherited] |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.
See set_clear_stencil_active().
string 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().
bool getDeleteFlag | ( | ) | [inherited] |
Returns the current setting of the delete flag.
When this is true, the GraphicsOutput will automatically be removed before the beginning of the next frame by the GraphicsEngine.
DisplayRegion getDisplayRegion | ( | int | n | ) | [inherited] |
Returns the nth DisplayRegion of those that have been created within the window.
This may return NULL if n is out of bounds; particularly likely if the number of display regions has changed since the last call to get_num_display_regions().
list getDisplayRegions | ( | ) | [inherited] |
GraphicsEngine getEngine | ( | ) | [inherited] |
Returns the graphics engine that created this output.
Since there is normally only one GraphicsEngine object in an application, this is usually the same as the global GraphicsEngine.
FrameBufferProperties const getFbProperties | ( | ) | [inherited] |
Returns the framebuffer properties of the window.
int getFbXSize | ( | ) | [inherited] |
Returns the internal width of the window or buffer.
This is almost always the same as get_x_size(), except when a pixel_zoom is in effect--see set_pixel_zoom().
int getFbYSize | ( | ) | [inherited] |
Returns the internal height of the window or buffer.
This is almost always the same as get_y_size(), except when a pixel_zoom is in effect--see set_pixel_zoom().
GraphicsStateGuardian getGsg | ( | ) | [inherited] |
Returns the GSG that is associated with this window.
There is a one-to-one association between windows and GSG's.
This may return NULL if the graphics context has not yet been created for the window, e.g. before the first frame has rendered; or after the window has been closed.
string getInputDeviceName | ( | int | device | ) |
Returns the name of the nth input device.
list getInputDeviceNames | ( | ) |
bool getInverted | ( | ) | [inherited] |
Returns the current setting of the inverted flag.
When this is true, the scene is rendered into the window upside-down, flipped like a mirror along the X axis. See set_inverted().
unsigned int getLeftEyeColorMask | ( | ) | [inherited] |
Returns the color mask in effect when rendering a left-eye view in red_blue stereo mode.
This is one or more bits defined in ColorWriteAttrib.Channels. See set_red_blue_stereo().
string getName | ( | ) | [inherited] |
Returns the name that was passed to the GraphicsOutput constructor.
int getNumActiveDisplayRegions | ( | ) | [inherited] |
Returns the number of active DisplayRegions that have been created within the window.
int getNumDisplayRegions | ( | ) | [inherited] |
Returns the number of DisplayRegions that have been created within the window, active or otherwise.
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.
bool getOneShot | ( | ) | [inherited] |
Returns the current setting of the one-shot flag.
When this is true, the GraphicsOutput will automatically detach its texture (if it has one) and remove itself from the GraphicsEngine after it renders the next frame.
GraphicsPipe getPipe | ( | ) | [inherited] |
Returns the GraphicsPipe that this window is associated with.
It is possible that the GraphicsPipe might have been deleted while an outstanding PT(GraphicsOutput) prevented all of its children windows from also being deleted; in this unlikely case, get_pipe() may return NULL.
float getPixelFactor | ( | ) | [inherited] |
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().
This will return 1.0 if the pixel_zoom was not set or if it is not being respected (for instance, because the underlying renderer doesn't support it--see supports_pixel_zoom).
float getPixelZoom | ( | ) | [inherited] |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not.
Also see get_pixel_factor().
Returns the MouseData associated with the nth input device's pointer.
WindowProperties const getProperties | ( | ) |
Returns the current properties of the window.
bool getRedBlueStereo | ( | ) | [inherited] |
Returns whether red-blue stereo mode is in effect for this particular window.
See set_red_blue_stereo().
int getRefCount | ( | ) | [inherited] |
Returns the current reference count.
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.
Returns the RenderBuffer.Type that corresponds to a RenderTexturePlane.
WindowProperties const 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().
unsigned int getRightEyeColorMask | ( | ) | [inherited] |
Returns the color mask in effect when rendering a right-eye view in red_blue stereo mode.
This is one or more bits defined in ColorWriteAttrib.Channels. See set_red_blue_stereo().
RenderTextureMode getRtmMode | ( | int | i | ) | [inherited] |
Returns the RenderTextureMode associated with the nth render-texture.
Returns RTM_none if there is no such texture.
RenderTextureMode getRtmMode | ( | ) | [inherited] |
Returns the RenderTextureMode associated with the nth render-texture.
Returns RTM_none if there is no such texture.
bool getScreenshot | ( | PNMImage | image | ) | [inherited] |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage.
Returns true on success, false on failure.
int getSort | ( | ) | [inherited] |
Returns the sorting order of this particular GraphicsOutput.
The various GraphicsOutputs within a particular thread will be rendered in the indicated order.
Returns the nth texture into which the GraphicsOutput renders.
Returns NULL if there is no such texture.
If the texture is non-NULL, it may be applied to geometry to be rendered for any other windows or outputs that share the same GSG as this GraphicsOutput. The effect is undefined for windows that share a different GSG; usually in these cases the texture will be invalid.
Reimplemented from GraphicsOutputBase.
Texture getTexture | ( | ) | [inherited] |
Returns the nth texture into which the GraphicsOutput renders.
Returns NULL if there is no such texture.
If the texture is non-NULL, it may be applied to geometry to be rendered for any other windows or outputs that share the same GSG as this GraphicsOutput. The effect is undefined for windows that share a different GSG; usually in these cases the texture will be invalid.
Reimplemented from GraphicsOutputBase.
NodePath getTextureCard | ( | ) | [inherited] |
Returns a PandaNode containing a square polygon.
The dimensions are (-1,0,-1) to (1,0,1). The texture coordinates are such that the texture of this GraphicsOutput is aligned properly to the polygon. The GraphicsOutput promises to surgically update the Geom inside the PandaNode if necessary to maintain this invariant.
Each invocation of this function returns a freshly- allocated PandaNode. You can therefore safely modify the RenderAttribs of the PandaNode. The PandaNode is initially textured with the texture of this GraphicOutput.
RenderTexturePlane getTexturePlane | ( | int | i | ) | [inherited] |
Returns the RenderTexturePlane associated with the nth render-texture.
Returns 0 if there is no such texture.
RenderTexturePlane getTexturePlane | ( | ) | [inherited] |
Returns the RenderTexturePlane associated with the nth render-texture.
Returns 0 if there is no such texture.
TypeHandle getType | ( | ) | [inherited] |
Reimplemented in AnimChannelBase.
int getTypeIndex | ( | ) | [inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
string 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().
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.
int getXSize | ( | ) | [inherited] |
Returns the visible width of the window or buffer, if it is known.
In certain cases (e.g. fullscreen windows), the size may not be known until after the object has been fully created. Check has_size() first.
Certain objects (like windows) may change size spontaneously; this method is not thread-safe. To get the size of a window in a thread-safe manner, query get_properties().
int getYSize | ( | ) | [inherited] |
Returns the visible height of the window or buffer, if it is known.
In certain cases (e.g. fullscreen windows), the size may not be known until after the object has been fully created. Check has_size() first.
Certain objects (like windows) may change size spontaneously; this method is not thread-safe. To get the size of a window in a thread-safe manner, query get_properties().
bool hasKeyboard | ( | int | device | ) |
Returns true if the nth input device has a keyboard, false otherwise.
bool hasPointer | ( | int | device | ) |
Returns true if the nth input device has a screen-space pointer (for instance, a mouse), false otherwise.
bool hasSize | ( | ) | [inherited] |
Returns true if the size of the window/frame buffer is known, false otherwise.
In certain cases the size may not be known until after the object has been fully created. Also, certain objects (like windows) may change size spontaneously.
bool hasTexture | ( | ) | [inherited] |
Returns true if the GraphicsOutput is rendering into any textures at all.
bool isActive | ( | ) | [inherited] |
Returns true if the window is ready to be rendered into, false otherwise.
bool isAnyClearActive | ( | ) | [inherited] |
Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear.
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.
bool isExactType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is the indicated type exactly.
bool isFullscreen | ( | ) |
Returns true if the window has been opened as a fullscreen window, false otherwise.
bool isOfType | ( | TypeHandle | handle | ) | [inherited] |
Returns true if the current object is or derives from the indicated type.
bool isStereo | ( | ) | [inherited] |
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.
bool isValid | ( | ) | [inherited] |
Returns true if the output is fully created and ready for rendering, false otherwise.
GraphicsOutput makeCubeMap | ( | string | name, |
int | size, | ||
NodePath | camera_rig, | ||
BitMaskunsigned | int, | ||
32 | camera_mask, | ||
bool | to_ram | ||
) | [inherited] |
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.
The buffer is automatically set up with six display regions and six cameras, each of which are assigned the indicated draw_mask and parented to the given camera_rig node (which you should then put in your scene to render the cube map from the appropriate point of view).
You may take the texture associated with the buffer and apply it to geometry, particularly with TexGenAttrib.M_world_cube_map also in effect, to apply a reflection of everything seen by the camera rig.
GraphicsOutput makeCubeMap | ( | string | name, |
int | size, | ||
NodePath | camera_rig, | ||
BitMaskunsigned | int, | ||
32 | camera_mask, | ||
bool | to_ram, | ||
FrameBufferProperties | fbp | ||
) | [inherited] |
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.
The buffer is automatically set up with six display regions and six cameras, each of which are assigned the indicated draw_mask and parented to the given camera_rig node (which you should then put in your scene to render the cube map from the appropriate point of view).
You may take the texture associated with the buffer and apply it to geometry, particularly with TexGenAttrib.M_world_cube_map also in effect, to apply a reflection of everything seen by the camera rig.
GraphicsOutput makeCubeMap | ( | string | name, |
int | size, | ||
NodePath | camera_rig, | ||
BitMaskunsigned | int, | ||
32 | camera_mask | ||
) | [inherited] |
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.
The buffer is automatically set up with six display regions and six cameras, each of which are assigned the indicated draw_mask and parented to the given camera_rig node (which you should then put in your scene to render the cube map from the appropriate point of view).
You may take the texture associated with the buffer and apply it to geometry, particularly with TexGenAttrib.M_world_cube_map also in effect, to apply a reflection of everything seen by the camera rig.
GraphicsOutput makeCubeMap | ( | string | name, |
int | size, | ||
NodePath | camera_rig | ||
) | [inherited] |
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.
The buffer is automatically set up with six display regions and six cameras, each of which are assigned the indicated draw_mask and parented to the given camera_rig node (which you should then put in your scene to render the cube map from the appropriate point of view).
You may take the texture associated with the buffer and apply it to geometry, particularly with TexGenAttrib.M_world_cube_map also in effect, to apply a reflection of everything seen by the camera rig.
DisplayRegion makeDisplayRegion | ( | float | l, |
float | r, | ||
float | b, | ||
float | t | ||
) | [inherited] |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
The range on all parameters is 0..1.
If is_stereo() is true for this window, and default-stereo-camera is configured true, this actually makes a StereoDisplayRegion. Call make_mono_display_region() or make_stereo_display_region() if you want to insist on one or the other.
DisplayRegion makeDisplayRegion | ( | ) | [inherited] |
Creates a new DisplayRegion that covers the entire window.
If is_stereo() is true for this window, and default-stereo-camera is configured true, this actually makes a StereoDisplayRegion. Call make_mono_display_region() or make_stereo_display_region() if you want to insist on one or the other.
DisplayRegion makeMonoDisplayRegion | ( | float | l, |
float | r, | ||
float | b, | ||
float | t | ||
) | [inherited] |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
The range on all parameters is 0..1.
This always returns a mono DisplayRegion, even if is_stereo() is true.
DisplayRegion makeMonoDisplayRegion | ( | ) | [inherited] |
Creates a new DisplayRegion that covers the entire window.
This always returns a mono DisplayRegion, even if is_stereo() is true.
static Filename makeScreenshotFilename | ( | string | prefix | ) | [static, inherited] |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
The default filename is generated from the supplied prefix and from the Config variable screenshot-filename, which contains the following strings:
~p - the supplied prefix ~f - the frame count ~e - the value of screenshot-extension All other % strings in strftime().
static Filename makeScreenshotFilename | ( | ) | [static, inherited] |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
The default filename is generated from the supplied prefix and from the Config variable screenshot-filename, which contains the following strings:
~p - the supplied prefix ~f - the frame count ~e - the value of screenshot-extension All other % strings in strftime().
StereoDisplayRegion makeStereoDisplayRegion | ( | ) | [inherited] |
Creates a new DisplayRegion that covers the entire window.
This always returns a stereo DisplayRegion, even if is_stereo() is false.
StereoDisplayRegion makeStereoDisplayRegion | ( | float | l, |
float | r, | ||
float | b, | ||
float | t | ||
) | [inherited] |
Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
The range on all parameters is 0..1.
This always returns a stereo DisplayRegion, even if is_stereo() is false.
GraphicsOutput makeTextureBuffer | ( | string | name, |
int | x_size, | ||
int | y_size | ||
) | [inherited] |
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.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created. In either case, the target texture can be retrieved from the return value with buffer->get_texture() (assuming the return value is not NULL).
If to_ram is true, the buffer will be set up to download its contents to the system RAM memory associated with the Texture object, instead of keeping it strictly within texture memory; this is much slower, but it allows using the texture with any GSG.
This will attempt to be smart about maximizing render performance while minimizing framebuffer waste. It might return a GraphicsBuffer set to render directly into a texture, if possible; or it might return a ParasiteBuffer that renders into this window. The return value is NULL if the buffer could not be created for some reason.
When you are done using the buffer, you should remove it with a call to GraphicsEngine.remove_window() (or set the one_shot flag so it removes itself after one frame).
GraphicsOutput makeTextureBuffer | ( | string | name, |
int | x_size, | ||
int | y_size, | ||
Texture | tex, | ||
bool | to_ram, | ||
FrameBufferProperties | fbp | ||
) | [inherited] |
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.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created. In either case, the target texture can be retrieved from the return value with buffer->get_texture() (assuming the return value is not NULL).
If to_ram is true, the buffer will be set up to download its contents to the system RAM memory associated with the Texture object, instead of keeping it strictly within texture memory; this is much slower, but it allows using the texture with any GSG.
This will attempt to be smart about maximizing render performance while minimizing framebuffer waste. It might return a GraphicsBuffer set to render directly into a texture, if possible; or it might return a ParasiteBuffer that renders into this window. The return value is NULL if the buffer could not be created for some reason.
When you are done using the buffer, you should remove it with a call to GraphicsEngine.remove_window() (or set the one_shot flag so it removes itself after one frame).
GraphicsOutput makeTextureBuffer | ( | string | name, |
int | x_size, | ||
int | y_size, | ||
Texture | tex, | ||
bool | to_ram | ||
) | [inherited] |
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.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created. In either case, the target texture can be retrieved from the return value with buffer->get_texture() (assuming the return value is not NULL).
If to_ram is true, the buffer will be set up to download its contents to the system RAM memory associated with the Texture object, instead of keeping it strictly within texture memory; this is much slower, but it allows using the texture with any GSG.
This will attempt to be smart about maximizing render performance while minimizing framebuffer waste. It might return a GraphicsBuffer set to render directly into a texture, if possible; or it might return a ParasiteBuffer that renders into this window. The return value is NULL if the buffer could not be created for some reason.
When you are done using the buffer, you should remove it with a call to GraphicsEngine.remove_window() (or set the one_shot flag so it removes itself after one frame).
GraphicsOutput makeTextureBuffer | ( | string | name, |
int | x_size, | ||
int | y_size, | ||
Texture | tex | ||
) | [inherited] |
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.
If tex is not NULL, it is the texture that will be set up for rendering into; otherwise, a new Texture object will be created. In either case, the target texture can be retrieved from the return value with buffer->get_texture() (assuming the return value is not NULL).
If to_ram is true, the buffer will be set up to download its contents to the system RAM memory associated with the Texture object, instead of keeping it strictly within texture memory; this is much slower, but it allows using the texture with any GSG.
This will attempt to be smart about maximizing render performance while minimizing framebuffer waste. It might return a GraphicsBuffer set to render directly into a texture, if possible; or it might return a ParasiteBuffer that renders into this window. The return value is NULL if the buffer could not be created for some reason.
When you are done using the buffer, you should remove it with a call to GraphicsEngine.remove_window() (or set the one_shot flag so it removes itself after one frame).
markBamModified | ( | ) | [inherited] |
Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients.
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.
PyObject reduce | ( | PyObject | self | ) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.
PyObject reducePersist | ( | PyObject | self, |
PyObject | pickler | ||
) | [inherited] |
This special Python method is implement to provide support for the pickle module.
This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.
ref | ( | ) | [inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
removeAllDisplayRegions | ( | ) | [inherited] |
Removes all display regions from the window, except the default one that is created with the window.
bool removeDisplayRegion | ( | DisplayRegion | display_region | ) | [inherited] |
Removes the indicated DisplayRegion from the window, and destructs it if there are no other references.
Returns true if the DisplayRegion is found and removed, false if it was not a part of the window.
requestProperties | ( | WindowProperties const | 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).
bool saveScreenshot | ( | Filename const | filename, |
string | image_comment | ||
) | [inherited] |
Saves a screenshot of the region to the indicated filename.
The image comment is an optional user readable string that will be saved with the header of the image (if the file format supports embedded data; for example jpg allows comments). Returns true on success, false on failure.
bool saveScreenshot | ( | Filename const | filename | ) | [inherited] |
Saves a screenshot of the region to the indicated filename.
The image comment is an optional user readable string that will be saved with the header of the image (if the file format supports embedded data; for example jpg allows comments). Returns true on success, false on failure.
Filename saveScreenshotDefault | ( | ) | [inherited] |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
The filename is generated by make_screenshot_filename().
Filename saveScreenshotDefault | ( | string | prefix | ) | [inherited] |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
The filename is generated by make_screenshot_filename().
setActive | ( | bool | active | ) | [inherited] |
Sets the active flag associated with the GraphicsOutput.
If the GraphicsOutput is marked inactive, nothing is rendered.
setChildSort | ( | int | child_sort | ) | [inherited] |
Specifies the sort value of future offscreen buffers created by make_texture_sort().
The purpose of this method is to allow the user to limit the sort value chosen for a buffer created via make_texture_buffer(). Normally, this buffer will be assigned a value of get_sort() - 1, so that it will be rendered before this window is rendered; but sometimes this isn't sufficiently early, especially if other buffers also have a view into the same scene.
If you specify a value here, then new buffers created via make_texture_buffer() will be given that sort value instead of get_sort() - 1.
setClearActive | ( | int | n, |
bool | clear_aux_active | ||
) | [inherited] |
Sets the clear-active flag for any bitplane.
setClearColor | ( | VBase4 const | color | ) | [inherited] |
Sets the clear color to the indicated value.
This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.
setClearColorActive | ( | bool | clear_color_active | ) | [inherited] |
Toggles the flag that indicates whether the color buffer should be cleared every frame.
If this is true, the color buffer will be cleared to the color indicated by set_clear_color(); otherwise, it will be left alone.
setClearDepth | ( | float | depth | ) | [inherited] |
Sets the clear depth to the indicated value.
This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.
setClearDepthActive | ( | bool | clear_depth_active | ) | [inherited] |
Toggles the flag that indicates whether the depth buffer should be cleared every frame.
If this is true, the depth buffer will be cleared to the depth value indicated by set_clear_depth(); otherwise, it will be left alone.
setClearStencil | ( | unsigned int | stencil | ) | [inherited] |
setClearStencilActive | ( | bool | clear_stencil_active | ) | [inherited] |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame.
If this is true, the stencil buffer will be cleared to the value indicated by set_clear_stencil(); otherwise, it will be left alone.
Sets the clear value for any bitplane.
setCloseRequestEvent | ( | 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).
setInverted | ( | bool | inverted | ) | [inherited] |
Changes the current setting of the inverted flag.
When this is true, the scene is rendered into the window upside-down and backwards, that is, inverted as if viewed through a mirror placed on the floor.
This is primarily intended to support DirectX (and a few buggy OpenGL graphics drivers) that perform a framebuffer-to-texture copy upside-down from the usual OpenGL (and Panda) convention. Panda will automatically set this flag for offscreen buffers on hardware that is known to do this, to compensate when rendering offscreen into a texture.
setOneShot | ( | bool | one_shot | ) | [inherited] |
Changes the current setting of the one-shot flag.
When this is true, the GraphicsOutput will render one frame and then automatically set itself inactive. This is particularly useful for buffers that are created for the purposes of render-to-texture, for static textures that don't need to be continually re-rendered once they have been rendered the first time.
Setting the buffer inactive is not the same thing as destroying it. You are still responsible for passing this buffer to GraphicsEngine.remove_window() when you no longer need the texture, in order to clean up fully. (However, you should not call remove_window() on this buffer while the texture is still needed, because depending on the render-to-texture mechanism in use, this may invalidate the texture contents.)
setPixelZoom | ( | float | pixel_zoom | ) | [inherited] |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally.
Setting this number larger makes the pixels blockier, but may make the rendering faster, particularly for software renderers. Setting this number to 2.0 reduces the number of pixels that have to be filled by the renderer by a factor of 2.0. It doesn't make sense to set this lower than 1.0.
It is possible to set this on either individual DisplayRegions or on overall GraphicsWindows, but you will get better performance for setting it on the window rather than its individual DisplayRegions. Also, you may not set it on a DisplayRegion that doesn't have both clear_color() and clear_depth() enabled.
This property is only supported on renderers for which it is particularly useful--currently, this is the tinydisplay software renderer. Other kinds of renderers allow you to set this property, but ignore it.
setRedBlueStereo | ( | bool | red_blue_stereo, |
unsigned int | left_eye_color_mask, | ||
unsigned int | right_eye_color_mask | ||
) | [inherited] |
Enables red-blue stereo mode on this particular window.
When red-blue stereo mode is in effect, DisplayRegions that have the "left" channel set will render in the red (or specified) channel only, while DisplayRegions that have the "right" channel set will render in the blue (or specified) channel only.
The remaining two parameters specify the particular color channel(s) to associate with each eye. Use the bits defined in ColorWriteAttrib.Channels.
This can be used to achieve a cheesy stereo mode in the absence of hardware-supported stereo.
setSort | ( | int | sort | ) | [inherited] |
Adjusts the sorting order of this particular GraphicsOutput, relative to other GraphicsOutputs.
Reimplemented from GraphicsOutputBase.
setupRenderTexture | ( | Texture | tex, |
bool | allow_bind, | ||
bool | to_ram | ||
) | [inherited] |
This is a deprecated interface that made sense back when GraphicsOutputs could only render into one texture at a time.
From now on, use clear_render_textures and add_render_texture instead.
setWindowEvent | ( | 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.
bool shareDepthBuffer | ( | GraphicsOutput | graphics_output | ) | [inherited] |
Will attempt to use the depth buffer of the input graphics_output.
The buffer sizes must be exactly the same.
bool supportsPixelZoom | ( | ) | [inherited] |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored.
If this returns false, then get_pixel_factor() will always return 1.0, regardless of what value you specify for set_pixel_zoom().
This may return false if the underlying renderer doesn't support pixel zooming, or if you have called this on a DisplayRegion that doesn't have both set_clear_color() and set_clear_depth() enabled.
bool testRefCountIntegrity | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
bool testRefCountNonzero | ( | ) | [inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
triggerCopy | ( | ) | [inherited] |
When the GraphicsOutput is in triggered copy mode, this function triggers the copy (at the end of the next frame).
bool unref | ( | ) | [inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.
unshareDepthBuffer | ( | ) | [inherited] |
Discontinue sharing the depth buffer.