DrawableRegion
from panda3d.core import DrawableRegion
- class DrawableRegion
Bases:
DTOOL_SUPER_BASE
This is a base class for GraphicsWindow (actually, GraphicsOutput) and DisplayRegion, both of which are conceptually rectangular regions into which drawing commands may be issued. Sometimes you want to deal with a single display region, and sometimes you want to deal with the whole window at once, particularly for issuing clear commands and capturing screenshots.
Inheritance diagram
- RTPAuxFloat0 = 11
- RTPAuxFloat1 = 12
- RTPAuxFloat2 = 13
- RTPAuxFloat3 = 14
- RTPAuxHrgba0 = 7
- RTPAuxHrgba1 = 8
- RTPAuxHrgba2 = 9
- RTPAuxHrgba3 = 10
- RTPAuxRgba0 = 3
- RTPAuxRgba1 = 4
- RTPAuxRgba2 = 5
- RTPAuxRgba3 = 6
- RTPCOUNT = 16
- RTPColor = 2
- RTPDepth = 15
- RTPDepthStencil = 1
- RTPStencil = 0
- RTP_COUNT = 16
- RTP_aux_float_0 = 11
- RTP_aux_float_1 = 12
- RTP_aux_float_2 = 13
- RTP_aux_float_3 = 14
- RTP_aux_hrgba_0 = 7
- RTP_aux_hrgba_1 = 8
- RTP_aux_hrgba_2 = 9
- RTP_aux_hrgba_3 = 10
- RTP_aux_rgba_0 = 3
- RTP_aux_rgba_1 = 4
- RTP_aux_rgba_2 = 5
- RTP_aux_rgba_3 = 6
- RTP_color = 2
- RTP_depth = 15
- RTP_depth_stencil = 1
- RTP_stencil = 0
- __init__(*args, **kwargs)
- clear_color
- clear_depth
- clear_stencil
- disableClears()
C++ Interface: disable_clears(const DrawableRegion self)
- /**
Disables both the color and depth clear. See set_clear_color_active and
set_clear_depth_active.
*/
- disable_clears()
C++ Interface: disable_clears(const DrawableRegion self)
- /**
Disables both the color and depth clear. See set_clear_color_active and
set_clear_depth_active.
*/
- getClearActive()
C++ Interface: get_clear_active(DrawableRegion self, int n)
- /**
Gets the clear-active flag for any bitplane.
*/
- getClearColor()
C++ Interface: get_clear_color(DrawableRegion self)
- /**
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.
*/
- getClearColorActive()
C++ Interface: get_clear_color_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the color
buffer should be cleared every frame. See set_clear_color_active().
*/
- getClearDepth()
C++ Interface: get_clear_depth(DrawableRegion self)
- /**
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.
*/
- getClearDepthActive()
C++ Interface: get_clear_depth_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the depth
buffer should be cleared every frame. See set_clear_depth_active().
*/
- getClearStencil()
C++ Interface: get_clear_stencil(DrawableRegion self)
- /**
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.
*/
- getClearStencilActive()
C++ Interface: get_clear_stencil_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the color
buffer should be cleared every frame. See set_clear_stencil_active().
*/
- getClearValue()
C++ Interface: get_clear_value(DrawableRegion self, int n)
- /**
Returns the clear value for any bitplane.
*/
- getPixelFactor()
C++ Interface: get_pixel_factor(DrawableRegion self)
- /**
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).
*/
- getPixelZoom()
C++ Interface: get_pixel_zoom(DrawableRegion self)
- /**
Returns the value set by set_pixel_zoom(), regardless of whether it is
being respected or not. Also see get_pixel_factor().
*/
- getRenderbufferType()
C++ Interface: get_renderbuffer_type(int plane)
- /**
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane.
*/
- get_clear_active()
C++ Interface: get_clear_active(DrawableRegion self, int n)
- /**
Gets the clear-active flag for any bitplane.
*/
- get_clear_color()
C++ Interface: get_clear_color(DrawableRegion self)
- /**
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.
*/
- get_clear_color_active()
C++ Interface: get_clear_color_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the color
buffer should be cleared every frame. See set_clear_color_active().
*/
- get_clear_depth()
C++ Interface: get_clear_depth(DrawableRegion self)
- /**
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.
*/
- get_clear_depth_active()
C++ Interface: get_clear_depth_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the depth
buffer should be cleared every frame. See set_clear_depth_active().
*/
- get_clear_stencil()
C++ Interface: get_clear_stencil(DrawableRegion self)
- /**
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.
*/
- get_clear_stencil_active()
C++ Interface: get_clear_stencil_active(DrawableRegion self)
- /**
Returns the current setting of the flag that indicates whether the color
buffer should be cleared every frame. See set_clear_stencil_active().
*/
- get_clear_value()
C++ Interface: get_clear_value(DrawableRegion self, int n)
- /**
Returns the clear value for any bitplane.
*/
- get_pixel_factor()
C++ Interface: get_pixel_factor(DrawableRegion self)
- /**
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).
*/
- get_pixel_zoom()
C++ Interface: get_pixel_zoom(DrawableRegion self)
- /**
Returns the value set by set_pixel_zoom(), regardless of whether it is
being respected or not. Also see get_pixel_factor().
*/
- get_renderbuffer_type()
C++ Interface: get_renderbuffer_type(int plane)
- /**
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane.
*/
- isAnyClearActive()
C++ Interface: is_any_clear_active(DrawableRegion self)
- /**
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.
*/
- is_any_clear_active()
C++ Interface: is_any_clear_active(DrawableRegion self)
- /**
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.
*/
- pixel_factor
- pixel_zoom
- setClearActive()
C++ Interface: set_clear_active(const DrawableRegion self, int n, bool clear_aux_active)
- /**
Sets the clear-active flag for any bitplane.
*/
- setClearColor()
C++ Interface: set_clear_color(const DrawableRegion self, const LVecBase4f color)
- /**
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()
C++ Interface: set_clear_color_active(const DrawableRegion self, bool clear_color_active)
- /**
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()
C++ Interface: set_clear_depth(const DrawableRegion self, float depth)
- /**
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()
C++ Interface: set_clear_depth_active(const DrawableRegion self, bool clear_depth_active)
- /**
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()
C++ Interface: set_clear_stencil(const DrawableRegion self, int stencil)
- /**
Sets the clear stencil to the indicated value. This is the value that will
be used to clear the stencil buffer every frame, but only if
get_clear_color_active() returns true. If get_clear_stencil_active()
returns false, this is meaningless.
*/
- setClearStencilActive()
C++ Interface: set_clear_stencil_active(const DrawableRegion self, bool clear_stencil_active)
- /**
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.
*/
- setClearValue()
C++ Interface: set_clear_value(const DrawableRegion self, int n, const LVecBase4f clear_value)
- /**
Sets the clear value for any bitplane.
*/
- setPixelZoom()
C++ Interface: set_pixel_zoom(const DrawableRegion self, float pixel_zoom)
- /**
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.
*/
- set_clear_active()
C++ Interface: set_clear_active(const DrawableRegion self, int n, bool clear_aux_active)
- /**
Sets the clear-active flag for any bitplane.
*/
- set_clear_color()
C++ Interface: set_clear_color(const DrawableRegion self, const LVecBase4f color)
- /**
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.
*/
- set_clear_color_active()
C++ Interface: set_clear_color_active(const DrawableRegion self, bool clear_color_active)
- /**
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.
*/
- set_clear_depth()
C++ Interface: set_clear_depth(const DrawableRegion self, float depth)
- /**
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.
*/
- set_clear_depth_active()
C++ Interface: set_clear_depth_active(const DrawableRegion self, bool clear_depth_active)
- /**
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.
*/
- set_clear_stencil()
C++ Interface: set_clear_stencil(const DrawableRegion self, int stencil)
- /**
Sets the clear stencil to the indicated value. This is the value that will
be used to clear the stencil buffer every frame, but only if
get_clear_color_active() returns true. If get_clear_stencil_active()
returns false, this is meaningless.
*/
- set_clear_stencil_active()
C++ Interface: set_clear_stencil_active(const DrawableRegion self, bool clear_stencil_active)
- /**
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.
*/
- set_clear_value()
C++ Interface: set_clear_value(const DrawableRegion self, int n, const LVecBase4f clear_value)
- /**
Sets the clear value for any bitplane.
*/
- set_pixel_zoom()
C++ Interface: set_pixel_zoom(const DrawableRegion self, float pixel_zoom)
- /**
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.
*/
- supportsPixelZoom()
C++ Interface: supports_pixel_zoom(DrawableRegion self)
- /**
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.
*/
- supports_pixel_zoom()
C++ Interface: supports_pixel_zoom(DrawableRegion self)
- /**
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.
*/