GraphicsOutput

from panda3d.core import GraphicsOutput
class GraphicsOutput

Bases: GraphicsOutputBase, DrawableRegion

This is a base class for the various different classes that represent the result of a frame of rendering. The most common kind of GraphicsOutput is a GraphicsWindow, which is a real-time window on the desktop, but another example is GraphicsBuffer, which is an offscreen buffer.

The actual rendering, and anything associated with the graphics context itself, is managed by the associated GraphicsStateGuardian (which might output to multiple GraphicsOutput objects).

GraphicsOutputs are not actually writable to bam files, of course, but they may be passed as event parameters, so they inherit from TypedWritableReferenceCount instead of TypedReferenceCount for that convenience.

Inheritance diagram

Inheritance diagram of GraphicsOutput

FMParasite = 1
FMRefresh = 2
FMRender = 0
FM_parasite = 1
FM_refresh = 2
FM_render = 0
RTMBindLayered = 6
RTMBindOrCopy = 1
RTMCopyRam = 3
RTMCopyTexture = 2
RTMNone = 0
RTMTriggeredCopyRam = 5
RTMTriggeredCopyTexture = 4
RTM_bind_layered = 6
RTM_bind_or_copy = 1
RTM_copy_ram = 3
RTM_copy_texture = 2
RTM_none = 0
RTM_triggered_copy_ram = 5
RTM_triggered_copy_texture = 4
__init__(*args, **kwargs)
active
active_display_regions
addRenderTexture()

C++ Interface: add_render_texture(const GraphicsOutput self, Texture tex, int mode, int bitplane)

/**
  • 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.

*/

add_render_texture()

C++ Interface: add_render_texture(const GraphicsOutput self, Texture tex, int mode, int bitplane)

/**
  • 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.

*/

child_sort
clearChildSort()

C++ Interface: clear_child_sort(const GraphicsOutput self)

/**
  • Resets the sort value of future offscreen buffers created by

  • make_texture_sort() to the default value. See set_child_sort().

*/

clearDeleteFlag()

C++ Interface: clear_delete_flag(const GraphicsOutput self)

/**
  • Resets the delete flag, so the GraphicsOutput will not be automatically

  • deleted before the beginning of the next frame.

*/

clearRenderTextures()

C++ Interface: clear_render_textures(const GraphicsOutput self)

/**
  • If the GraphicsOutput is currently rendering to a texture, then all

  • textures are dissociated from the GraphicsOuput.

*/

clear_child_sort()

C++ Interface: clear_child_sort(const GraphicsOutput self)

/**
  • Resets the sort value of future offscreen buffers created by

  • make_texture_sort() to the default value. See set_child_sort().

*/

clear_delete_flag()

C++ Interface: clear_delete_flag(const GraphicsOutput self)

/**
  • Resets the delete flag, so the GraphicsOutput will not be automatically

  • deleted before the beginning of the next frame.

*/

clear_render_textures()

C++ Interface: clear_render_textures(const GraphicsOutput self)

/**
  • If the GraphicsOutput is currently rendering to a texture, then all

  • textures are dissociated from the GraphicsOuput.

*/

countTextures()

C++ Interface: count_textures(GraphicsOutput self)

/**
  • 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.

*/

count_textures()

C++ Interface: count_textures(GraphicsOutput self)

/**
  • 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.

*/

display_regions
engine
fb_size
flipReady()

C++ Interface: flip_ready(GraphicsOutput self)

// These are not intended to be called directly by the user, but they’re // published anyway since they might occasionally be useful for low-level // debugging.

/**
  • Returns true if a frame has been rendered and needs to be flipped, false

  • otherwise.

*/

flip_ready()

C++ Interface: flip_ready(GraphicsOutput self)

// These are not intended to be called directly by the user, but they’re // published anyway since they might occasionally be useful for low-level // debugging.

/**
  • Returns true if a frame has been rendered and needs to be flipped, false

  • otherwise.

*/

getActiveDisplayRegion()

C++ Interface: get_active_display_region(GraphicsOutput self, int n)

/**
  • 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().

*/

getActiveDisplayRegions()
getAsyncScreenshot()

C++ Interface: get_async_screenshot(const GraphicsOutput self)

/**
  • Used to obtain a new Texture object containing the previously rendered frame.

  • Unlike get_screenshot, this works asynchronously, meaning that the contents

  • are transferred in the background. Returns a future that can be awaited.

  • This captures the frame that was last submitted by the App stage to the

  • render_frame() call. This may not be the latest frame shown on the screen

  • if the multi-threaded pipeline is used, in which case the request may take

  • several frames extra to complete.

*/

getChildSort()

C++ Interface: get_child_sort(GraphicsOutput self)

/**
  • Returns the sort value of future offscreen buffers created by

  • make_texture_sort(). See set_child_sort().

*/

getClassType()

C++ Interface: get_class_type()

getDeleteFlag()

C++ Interface: get_delete_flag(GraphicsOutput self)

/**
  • 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.

*/

getDisplayRegion()

C++ Interface: get_display_region(GraphicsOutput self, int n)

/**
  • 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().

*/

getDisplayRegions()
getEngine()

C++ Interface: get_engine(GraphicsOutput self)

/**
  • 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.

*/

getFbProperties()

C++ Interface: get_fb_properties(GraphicsOutput self)

/**
  • Returns the framebuffer properties of the window.

*/

getFbSize()

C++ Interface: get_fb_size(GraphicsOutput self)

/**
  • Returns the internal size of the window or buffer. This is almost always

  • the same as get_size(), except when a pixel_zoom is in effect–see

  • set_pixel_zoom().

*/

getFbXSize()

C++ Interface: get_fb_x_size(GraphicsOutput self)

/**
  • 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().

*/

getFbYSize()

C++ Interface: get_fb_y_size(GraphicsOutput self)

/**
  • 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().

*/

getGsg()

C++ Interface: get_gsg(GraphicsOutput self)

/**
  • 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.

*/

getHost()

C++ Interface: get_host(const GraphicsOutput self)

/**
  • This is normally called only from within make_texture_buffer(). When

  • called on a ParasiteBuffer, it returns the host of that buffer; but when

  • called on some other buffer, it returns the buffer itself.

*/

getInverted()

C++ Interface: get_inverted(GraphicsOutput self)

/**
  • 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().

*/

getLeftEyeColorMask()

C++ Interface: get_left_eye_color_mask(GraphicsOutput self)

/**
  • 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().

*/

getName()

C++ Interface: get_name(GraphicsOutput self)

/**
  • Returns the name that was passed to the GraphicsOutput constructor.

*/

getNumActiveDisplayRegions()

C++ Interface: get_num_active_display_regions(GraphicsOutput self)

/**
  • Returns the number of active DisplayRegions that have been created within

  • the window.

*/

getNumDisplayRegions()

C++ Interface: get_num_display_regions(GraphicsOutput self)

/**
  • Returns the number of DisplayRegions that have been created within the

  • window, active or otherwise.

*/

getOneShot()

C++ Interface: get_one_shot(GraphicsOutput self)

/**
  • Returns the current setting of the one-shot flag. When this is true, the

  • GraphicsOutput will automatically set itself inactive after the next frame.

*/

getOverlayDisplayRegion()

C++ Interface: get_overlay_display_region(GraphicsOutput self)

/**
  • Returns the special “overlay” DisplayRegion that is created for each window

  • or buffer. This DisplayRegion covers the entire window, but cannot be used

  • for rendering. It is a placeholder only, to indicate the dimensions of the

  • window, and is usually used internally for purposes such as clearing the

  • window, or grabbing a screenshot of the window.

  • There are very few applications that require access to this DisplayRegion.

  • Normally, you should create your own DisplayRegion that covers the window,

  • if you want to render to the window.

*/

getPipe()

C++ Interface: get_pipe(GraphicsOutput self)

/**
  • 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.

*/

getRedBlueStereo()

C++ Interface: get_red_blue_stereo(GraphicsOutput self)

/**
  • Returns whether red-blue stereo mode is in effect for this particular

  • window. See set_red_blue_stereo().

*/

getRightEyeColorMask()

C++ Interface: get_right_eye_color_mask(GraphicsOutput self)

/**
  • 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().

*/

getRtmMode()

C++ Interface: get_rtm_mode(GraphicsOutput self, int i)

/**
  • Returns the RenderTextureMode associated with the nth render-texture.

  • Returns RTM_none if there is no such texture.

*/

getSbsLeftDimensions()

C++ Interface: get_sbs_left_dimensions(GraphicsOutput self)

/**
  • 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. See

  • set_side_by_side_stereo().

*/

getSbsLeftSize()

C++ Interface: get_sbs_left_size(GraphicsOutput self)

/**
  • 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(). If side-by-

  • side stereo is not enabled, this returns the same as get_size().

*/

getSbsLeftXSize()

C++ Interface: get_sbs_left_x_size(GraphicsOutput self)

/**
  • 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(). If side-

  • by-side stereo is not enabled, this returns the same as get_x_size().

*/

getSbsLeftYSize()

C++ Interface: get_sbs_left_y_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_y_size().

*/

getSbsRightDimensions()

C++ Interface: get_sbs_right_dimensions(GraphicsOutput self)

/**
  • 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. See

  • set_side_by_side_stereo().

*/

getSbsRightSize()

C++ Interface: get_sbs_right_size(GraphicsOutput self)

/**
  • 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(). If side-

  • by-side stereo is not enabled, this returns the same as get_size().

*/

getSbsRightXSize()

C++ Interface: get_sbs_right_x_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_x_size().

*/

getSbsRightYSize()

C++ Interface: get_sbs_right_y_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_y_size().

*/

getScreenshot()

C++ Interface: get_screenshot(const GraphicsOutput self) get_screenshot(const GraphicsOutput self, PNMImage image)

/**
  • Captures the most-recently rendered image from the framebuffer into the

  • indicated PNMImage. Returns true on success, false on failure.

*/

/**
  • Captures the most-recently rendered image from the framebuffer and returns

  • it as Texture, or NULL on failure.

*/

getSideBySideStereo()

C++ Interface: get_side_by_side_stereo(GraphicsOutput self)

/**
  • Returns whether side-by-side stereo mode is in effect for this particular

  • window. See set_side_by_side_stereo().

*/

getSize()

C++ Interface: get_size(GraphicsOutput self)

/**
  • Returns the visible size 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().

*/

getSort()

C++ Interface: get_sort(GraphicsOutput self)

/**
  • Returns the sorting order of this particular GraphicsOutput. The various

  • GraphicsOutputs within a particular thread will be rendered in the

  • indicated order.

*/

getSupportsRenderTexture()

C++ Interface: get_supports_render_texture(GraphicsOutput self)

/**
  • 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.

*/

getSwapEyes()

C++ Interface: get_swap_eyes(GraphicsOutput self)

/**
  • Returns the current setting of the “swap eyes” flag. See set_swap_eyes().

*/

getTexture()

C++ Interface: get_texture(GraphicsOutput self, int i)

/**
  • 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.

*/

getTextureCard()

C++ Interface: get_texture_card(const GraphicsOutput self)

/**
  • 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.

*/

getTexturePlane()

C++ Interface: get_texture_plane(GraphicsOutput self, int i)

/**
  • Returns the RenderTexturePlane associated with the nth render-texture.

  • Returns 0 if there is no such texture.

*/

getXSize()

C++ Interface: get_x_size(GraphicsOutput self)

/**
  • 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().

*/

getYSize()

C++ Interface: get_y_size(GraphicsOutput self)

/**
  • 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().

*/

get_active_display_region()

C++ Interface: get_active_display_region(GraphicsOutput self, int n)

/**
  • 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().

*/

get_active_display_regions()
get_async_screenshot()

C++ Interface: get_async_screenshot(const GraphicsOutput self)

/**
  • Used to obtain a new Texture object containing the previously rendered frame.

  • Unlike get_screenshot, this works asynchronously, meaning that the contents

  • are transferred in the background. Returns a future that can be awaited.

  • This captures the frame that was last submitted by the App stage to the

  • render_frame() call. This may not be the latest frame shown on the screen

  • if the multi-threaded pipeline is used, in which case the request may take

  • several frames extra to complete.

*/

get_child_sort()

C++ Interface: get_child_sort(GraphicsOutput self)

/**
  • Returns the sort value of future offscreen buffers created by

  • make_texture_sort(). See set_child_sort().

*/

get_class_type()

C++ Interface: get_class_type()

get_delete_flag()

C++ Interface: get_delete_flag(GraphicsOutput self)

/**
  • 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.

*/

get_display_region()

C++ Interface: get_display_region(GraphicsOutput self, int n)

/**
  • 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().

*/

get_display_regions()
get_engine()

C++ Interface: get_engine(GraphicsOutput self)

/**
  • 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.

*/

get_fb_properties()

C++ Interface: get_fb_properties(GraphicsOutput self)

/**
  • Returns the framebuffer properties of the window.

*/

get_fb_size()

C++ Interface: get_fb_size(GraphicsOutput self)

/**
  • Returns the internal size of the window or buffer. This is almost always

  • the same as get_size(), except when a pixel_zoom is in effect–see

  • set_pixel_zoom().

*/

get_fb_x_size()

C++ Interface: get_fb_x_size(GraphicsOutput self)

/**
  • 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().

*/

get_fb_y_size()

C++ Interface: get_fb_y_size(GraphicsOutput self)

/**
  • 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().

*/

get_gsg()

C++ Interface: get_gsg(GraphicsOutput self)

/**
  • 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.

*/

get_host()

C++ Interface: get_host(const GraphicsOutput self)

/**
  • This is normally called only from within make_texture_buffer(). When

  • called on a ParasiteBuffer, it returns the host of that buffer; but when

  • called on some other buffer, it returns the buffer itself.

*/

get_inverted()

C++ Interface: get_inverted(GraphicsOutput self)

/**
  • 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().

*/

get_left_eye_color_mask()

C++ Interface: get_left_eye_color_mask(GraphicsOutput self)

/**
  • 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().

*/

get_name()

C++ Interface: get_name(GraphicsOutput self)

/**
  • Returns the name that was passed to the GraphicsOutput constructor.

*/

get_num_active_display_regions()

C++ Interface: get_num_active_display_regions(GraphicsOutput self)

/**
  • Returns the number of active DisplayRegions that have been created within

  • the window.

*/

get_num_display_regions()

C++ Interface: get_num_display_regions(GraphicsOutput self)

/**
  • Returns the number of DisplayRegions that have been created within the

  • window, active or otherwise.

*/

get_one_shot()

C++ Interface: get_one_shot(GraphicsOutput self)

/**
  • Returns the current setting of the one-shot flag. When this is true, the

  • GraphicsOutput will automatically set itself inactive after the next frame.

*/

get_overlay_display_region()

C++ Interface: get_overlay_display_region(GraphicsOutput self)

/**
  • Returns the special “overlay” DisplayRegion that is created for each window

  • or buffer. This DisplayRegion covers the entire window, but cannot be used

  • for rendering. It is a placeholder only, to indicate the dimensions of the

  • window, and is usually used internally for purposes such as clearing the

  • window, or grabbing a screenshot of the window.

  • There are very few applications that require access to this DisplayRegion.

  • Normally, you should create your own DisplayRegion that covers the window,

  • if you want to render to the window.

*/

get_pipe()

C++ Interface: get_pipe(GraphicsOutput self)

/**
  • 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.

*/

get_red_blue_stereo()

C++ Interface: get_red_blue_stereo(GraphicsOutput self)

/**
  • Returns whether red-blue stereo mode is in effect for this particular

  • window. See set_red_blue_stereo().

*/

get_right_eye_color_mask()

C++ Interface: get_right_eye_color_mask(GraphicsOutput self)

/**
  • 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().

*/

get_rtm_mode()

C++ Interface: get_rtm_mode(GraphicsOutput self, int i)

/**
  • Returns the RenderTextureMode associated with the nth render-texture.

  • Returns RTM_none if there is no such texture.

*/

get_sbs_left_dimensions()

C++ Interface: get_sbs_left_dimensions(GraphicsOutput self)

/**
  • 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. See

  • set_side_by_side_stereo().

*/

get_sbs_left_size()

C++ Interface: get_sbs_left_size(GraphicsOutput self)

/**
  • 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(). If side-by-

  • side stereo is not enabled, this returns the same as get_size().

*/

get_sbs_left_x_size()

C++ Interface: get_sbs_left_x_size(GraphicsOutput self)

/**
  • 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(). If side-

  • by-side stereo is not enabled, this returns the same as get_x_size().

*/

get_sbs_left_y_size()

C++ Interface: get_sbs_left_y_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_y_size().

*/

get_sbs_right_dimensions()

C++ Interface: get_sbs_right_dimensions(GraphicsOutput self)

/**
  • 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. See

  • set_side_by_side_stereo().

*/

get_sbs_right_size()

C++ Interface: get_sbs_right_size(GraphicsOutput self)

/**
  • 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(). If side-

  • by-side stereo is not enabled, this returns the same as get_size().

*/

get_sbs_right_x_size()

C++ Interface: get_sbs_right_x_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_x_size().

*/

get_sbs_right_y_size()

C++ Interface: get_sbs_right_y_size(GraphicsOutput self)

/**
  • 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(). If

  • side-by-side stereo is not enabled, this returns the same as get_y_size().

*/

get_screenshot()

C++ Interface: get_screenshot(const GraphicsOutput self) get_screenshot(const GraphicsOutput self, PNMImage image)

/**
  • Captures the most-recently rendered image from the framebuffer into the

  • indicated PNMImage. Returns true on success, false on failure.

*/

/**
  • Captures the most-recently rendered image from the framebuffer and returns

  • it as Texture, or NULL on failure.

*/

get_side_by_side_stereo()

C++ Interface: get_side_by_side_stereo(GraphicsOutput self)

/**
  • Returns whether side-by-side stereo mode is in effect for this particular

  • window. See set_side_by_side_stereo().

*/

get_size()

C++ Interface: get_size(GraphicsOutput self)

/**
  • Returns the visible size 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().

*/

get_sort()

C++ Interface: get_sort(GraphicsOutput self)

/**
  • Returns the sorting order of this particular GraphicsOutput. The various

  • GraphicsOutputs within a particular thread will be rendered in the

  • indicated order.

*/

get_supports_render_texture()

C++ Interface: get_supports_render_texture(GraphicsOutput self)

/**
  • 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.

*/

get_swap_eyes()

C++ Interface: get_swap_eyes(GraphicsOutput self)

/**
  • Returns the current setting of the “swap eyes” flag. See set_swap_eyes().

*/

get_texture()

C++ Interface: get_texture(GraphicsOutput self, int i)

/**
  • 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.

*/

get_texture_card()

C++ Interface: get_texture_card(const GraphicsOutput self)

/**
  • 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.

*/

get_texture_plane()

C++ Interface: get_texture_plane(GraphicsOutput self, int i)

/**
  • Returns the RenderTexturePlane associated with the nth render-texture.

  • Returns 0 if there is no such texture.

*/

get_x_size()

C++ Interface: get_x_size(GraphicsOutput self)

/**
  • 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().

*/

get_y_size()

C++ Interface: get_y_size(GraphicsOutput self)

/**
  • 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().

*/

gsg
hasSize()

C++ Interface: has_size(GraphicsOutput self)

/**
  • 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.

*/

hasTexture()

C++ Interface: has_texture(GraphicsOutput self)

/**
  • Returns true if the GraphicsOutput is rendering into any textures at all.

*/

has_size()

C++ Interface: has_size(GraphicsOutput self)

/**
  • 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.

*/

has_texture()

C++ Interface: has_texture(GraphicsOutput self)

/**
  • Returns true if the GraphicsOutput is rendering into any textures at all.

*/

host
inverted
isActive()

C++ Interface: is_active(GraphicsOutput self)

/**
  • Returns true if the window is ready to be rendered into, false otherwise.

*/

isNonzeroSize()

C++ Interface: is_nonzero_size(GraphicsOutput self)

/**
  • Returns true if the output has a nonzero size in both X and Y, or false if

  • it is zero (and therefore invalid).

*/

isStereo()

C++ Interface: is_stereo(GraphicsOutput self)

/**
  • 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.

*/

isValid()

C++ Interface: is_valid(GraphicsOutput self)

/**
  • Returns true if the output is fully created and ready for rendering, false

  • otherwise.

*/

is_active()

C++ Interface: is_active(GraphicsOutput self)

/**
  • Returns true if the window is ready to be rendered into, false otherwise.

*/

is_nonzero_size()

C++ Interface: is_nonzero_size(GraphicsOutput self)

/**
  • Returns true if the output has a nonzero size in both X and Y, or false if

  • it is zero (and therefore invalid).

*/

is_stereo()

C++ Interface: is_stereo(GraphicsOutput self)

/**
  • 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.

*/

is_valid()

C++ Interface: is_valid(GraphicsOutput self)

/**
  • Returns true if the output is fully created and ready for rendering, false

  • otherwise.

*/

makeCubeMap()

C++ Interface: make_cube_map(const GraphicsOutput self, str name, int size, NodePath camera_rig, BitMask 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.

  • 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.

*/

makeDisplayRegion()

C++ Interface: make_display_region(const GraphicsOutput self) make_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • 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.

*/

/**
  • 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.

*/

/**
  • 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.

*/

makeMonoDisplayRegion()

C++ Interface: make_mono_display_region(const GraphicsOutput self) make_mono_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_mono_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

/**
  • Creates a new DisplayRegion that covers the indicated sub-rectangle within

  • the window. The range on all parameters is 0..1.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

makeScreenshotFilename()

C++ Interface: make_screenshot_filename(str prefix)

/**
  • 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().

*/

makeStereoDisplayRegion()

C++ Interface: make_stereo_display_region(const GraphicsOutput self) make_stereo_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_stereo_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This always returns a stereo DisplayRegion, even if is_stereo() is false.

*/

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This always returns a stereo DisplayRegion, even if is_stereo() is false.

*/

/**
  • 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.

*/

makeTextureBuffer()

C++ Interface: make_texture_buffer(const GraphicsOutput self, 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.

  • If you pass zero as the buffer size, the buffer will have the same size as

  • the host window, and will automatically be resized when the host window is.

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

*/

make_cube_map()

C++ Interface: make_cube_map(const GraphicsOutput self, str name, int size, NodePath camera_rig, BitMask 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.

  • 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.

*/

make_display_region()

C++ Interface: make_display_region(const GraphicsOutput self) make_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • 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.

*/

/**
  • 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.

*/

/**
  • 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.

*/

make_mono_display_region()

C++ Interface: make_mono_display_region(const GraphicsOutput self) make_mono_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_mono_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

/**
  • Creates a new DisplayRegion that covers the indicated sub-rectangle within

  • the window. The range on all parameters is 0..1.

  • This generally returns a mono DisplayRegion, even if is_stereo() is true.

  • However, if side-by-side stereo is enabled, this will return a

  • StereoDisplayRegion whose two eyes are both set to SC_mono. (This is

  • necessary because in side-by-side stereo mode, it is necessary to draw even

  • mono DisplayRegions twice).

*/

make_screenshot_filename()

C++ Interface: make_screenshot_filename(str prefix)

/**
  • 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().

*/

make_stereo_display_region()

C++ Interface: make_stereo_display_region(const GraphicsOutput self) make_stereo_display_region(const GraphicsOutput self, const LVecBase4f dimensions) make_stereo_display_region(const GraphicsOutput self, float l, float r, float b, float t)

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This always returns a stereo DisplayRegion, even if is_stereo() is false.

*/

/**
  • Creates a new DisplayRegion that covers the entire window.

  • This always returns a stereo DisplayRegion, even if is_stereo() is false.

*/

/**
  • 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.

*/

make_texture_buffer()

C++ Interface: make_texture_buffer(const GraphicsOutput self, 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.

  • If you pass zero as the buffer size, the buffer will have the same size as

  • the host window, and will automatically be resized when the host window is.

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

*/

name
one_shot
pipe
removeAllDisplayRegions()

C++ Interface: remove_all_display_regions(const GraphicsOutput self)

/**
  • Removes all display regions from the window, except the default one that is

  • created with the window.

*/

removeDisplayRegion()

C++ Interface: remove_display_region(const GraphicsOutput self, DisplayRegion display_region)

/**
  • 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.

*/

remove_all_display_regions()

C++ Interface: remove_all_display_regions(const GraphicsOutput self)

/**
  • Removes all display regions from the window, except the default one that is

  • created with the window.

*/

remove_display_region()

C++ Interface: remove_display_region(const GraphicsOutput self, DisplayRegion display_region)

/**
  • 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.

*/

saveAsyncScreenshot()

C++ Interface: save_async_screenshot(const GraphicsOutput self, const Filename filename, str image_comment)

/**
  • Like save_screenshot, but performs both the texture transfer and the saving

  • to disk in the background. Returns a future that can be awaited.

  • This captures the frame that was last submitted by the App stage to the

  • render_frame() call. This may not be the latest frame shown on the screen

  • if the multi-threaded pipeline is used, in which case the request may take

  • several frames extra to complete.

*/

saveScreenshot()

C++ Interface: save_screenshot(const GraphicsOutput self, const Filename filename, str image_comment)

/**
  • 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.

*/

saveScreenshotDefault()

C++ Interface: save_screenshot_default(const GraphicsOutput self, str prefix)

/**
  • 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().

*/

save_async_screenshot()

C++ Interface: save_async_screenshot(const GraphicsOutput self, const Filename filename, str image_comment)

/**
  • Like save_screenshot, but performs both the texture transfer and the saving

  • to disk in the background. Returns a future that can be awaited.

  • This captures the frame that was last submitted by the App stage to the

  • render_frame() call. This may not be the latest frame shown on the screen

  • if the multi-threaded pipeline is used, in which case the request may take

  • several frames extra to complete.

*/

save_screenshot()

C++ Interface: save_screenshot(const GraphicsOutput self, const Filename filename, str image_comment)

/**
  • 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.

*/

save_screenshot_default()

C++ Interface: save_screenshot_default(const GraphicsOutput self, str prefix)

/**
  • 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().

*/

sbs_left_size
sbs_right_size
setActive()

C++ Interface: set_active(const GraphicsOutput self, bool active)

/**
  • Sets the active flag associated with the GraphicsOutput. If the

  • GraphicsOutput is marked inactive, nothing is rendered.

*/

setChildSort()

C++ Interface: set_child_sort(const GraphicsOutput self, int child_sort)

/**
  • 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() -

*/

setInverted()

C++ Interface: set_inverted(const GraphicsOutput self, bool inverted)

/**
  • 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()

C++ Interface: set_one_shot(const GraphicsOutput self, bool one_shot)

/**
  • Changes the current setting of the one-shot flag. When this is true, the

  • GraphicsOutput will render the current 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.)

*/

setOverlayDisplayRegion()

C++ Interface: set_overlay_display_region(const GraphicsOutput self, DisplayRegion display_region)

/**
  • Replaces the special “overlay” DisplayRegion that is created for each

  • window or buffer. See get_overlay_display_region(). This must be a new

  • DisplayRegion that has already been created for this window, for instance

  • via a call to make_mono_display_region(). You are responsible for ensuring

  • that the new DisplayRegion covers the entire window. The previous overlay

  • display region is not automatically removed; you must explicitly call

  • remove_display_region() on it after replacing it with this method, if you

  • wish it to be removed.

  • Normally, there is no reason to change the overlay DisplayRegion, so this

  • method should be used only in very unusual circumstances.

*/

setRedBlueStereo()

C++ Interface: set_red_blue_stereo(const GraphicsOutput self, bool red_blue_stereo, int left_eye_color_mask, int right_eye_color_mask)

/**
  • 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.

*/

setSideBySideStereo()

C++ Interface: set_side_by_side_stereo(const GraphicsOutput self, bool side_by_side_stereo) set_side_by_side_stereo(const GraphicsOutput self, bool side_by_side_stereo, const LVecBase4f sbs_left_dimensions, const LVecBase4f sbs_right_dimensions)

/**
  • Enables side-by-side stereo mode on this particular window. When side-by-

  • side stereo mode is in effect, DisplayRegions that have the “left” channel

  • set will render on the part of the window specified by sbs_left_dimensions

  • (typically the left half: (0, 0.5, 0, 1)), while DisplayRegions that have

  • the “right” channel set will render on the part of the window specified by

  • sbs_right_dimensions (typically the right half: (0.5, 1, 0, 1)).

  • This is commonly used in a dual-monitor mode, where a window is opened that

  • spans two monitors, and each monitor represents a different eye.

*/

/**
  • Enables side-by-side stereo mode on this particular window. When side-by-

  • side stereo mode is in effect, DisplayRegions that have the “left” channel

  • set will render on the part of the window specified by sbs_left_dimensions

  • (typically the left half: (0, 0.5, 0, 1)), while DisplayRegions that have

  • the “right” channel set will render on the part of the window specified by

  • sbs_right_dimensions (typically the right half: (0.5, 1, 0, 1)).

  • This is commonly used in a dual-monitor mode, where a window is opened that

  • spans two monitors, and each monitor represents a different eye.

*/

setSort()

C++ Interface: set_sort(const GraphicsOutput self, int sort)

/**
  • Adjusts the sorting order of this particular GraphicsOutput, relative to

  • other GraphicsOutputs.

*/

setSwapEyes()

C++ Interface: set_swap_eyes(const GraphicsOutput self, bool swap_eyes)

/**
  • Changes the “swap eyes” flag. This flag is normally false. When it is

  • true, the left and right channels of a stereo DisplayRegion are sent to the

  • opposite channels in the rendering backend. This is meant to work around

  • hardware that inadvertently swaps the output channels, or hardware for

  • which it cannot be determined which channel is which until runtime.

*/

set_active()

C++ Interface: set_active(const GraphicsOutput self, bool active)

/**
  • Sets the active flag associated with the GraphicsOutput. If the

  • GraphicsOutput is marked inactive, nothing is rendered.

*/

set_child_sort()

C++ Interface: set_child_sort(const GraphicsOutput self, int child_sort)

/**
  • 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() -

*/

set_inverted()

C++ Interface: set_inverted(const GraphicsOutput self, bool inverted)

/**
  • 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.

*/

set_one_shot()

C++ Interface: set_one_shot(const GraphicsOutput self, bool one_shot)

/**
  • Changes the current setting of the one-shot flag. When this is true, the

  • GraphicsOutput will render the current 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.)

*/

set_overlay_display_region()

C++ Interface: set_overlay_display_region(const GraphicsOutput self, DisplayRegion display_region)

/**
  • Replaces the special “overlay” DisplayRegion that is created for each

  • window or buffer. See get_overlay_display_region(). This must be a new

  • DisplayRegion that has already been created for this window, for instance

  • via a call to make_mono_display_region(). You are responsible for ensuring

  • that the new DisplayRegion covers the entire window. The previous overlay

  • display region is not automatically removed; you must explicitly call

  • remove_display_region() on it after replacing it with this method, if you

  • wish it to be removed.

  • Normally, there is no reason to change the overlay DisplayRegion, so this

  • method should be used only in very unusual circumstances.

*/

set_red_blue_stereo()

C++ Interface: set_red_blue_stereo(const GraphicsOutput self, bool red_blue_stereo, int left_eye_color_mask, int right_eye_color_mask)

/**
  • 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.

*/

set_side_by_side_stereo()

C++ Interface: set_side_by_side_stereo(const GraphicsOutput self, bool side_by_side_stereo) set_side_by_side_stereo(const GraphicsOutput self, bool side_by_side_stereo, const LVecBase4f sbs_left_dimensions, const LVecBase4f sbs_right_dimensions)

/**
  • Enables side-by-side stereo mode on this particular window. When side-by-

  • side stereo mode is in effect, DisplayRegions that have the “left” channel

  • set will render on the part of the window specified by sbs_left_dimensions

  • (typically the left half: (0, 0.5, 0, 1)), while DisplayRegions that have

  • the “right” channel set will render on the part of the window specified by

  • sbs_right_dimensions (typically the right half: (0.5, 1, 0, 1)).

  • This is commonly used in a dual-monitor mode, where a window is opened that

  • spans two monitors, and each monitor represents a different eye.

*/

/**
  • Enables side-by-side stereo mode on this particular window. When side-by-

  • side stereo mode is in effect, DisplayRegions that have the “left” channel

  • set will render on the part of the window specified by sbs_left_dimensions

  • (typically the left half: (0, 0.5, 0, 1)), while DisplayRegions that have

  • the “right” channel set will render on the part of the window specified by

  • sbs_right_dimensions (typically the right half: (0.5, 1, 0, 1)).

  • This is commonly used in a dual-monitor mode, where a window is opened that

  • spans two monitors, and each monitor represents a different eye.

*/

set_sort()

C++ Interface: set_sort(const GraphicsOutput self, int sort)

/**
  • Adjusts the sorting order of this particular GraphicsOutput, relative to

  • other GraphicsOutputs.

*/

set_swap_eyes()

C++ Interface: set_swap_eyes(const GraphicsOutput self, bool swap_eyes)

/**
  • Changes the “swap eyes” flag. This flag is normally false. When it is

  • true, the left and right channels of a stereo DisplayRegion are sent to the

  • opposite channels in the rendering backend. This is meant to work around

  • hardware that inadvertently swaps the output channels, or hardware for

  • which it cannot be determined which channel is which until runtime.

*/

setupRenderTexture()

C++ Interface: setup_render_texture(const GraphicsOutput self, 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. From now on, use

  • clear_render_textures and add_render_texture instead.

  • @deprecated Use add_render_texture() instead.

*/

setup_render_texture()

C++ Interface: setup_render_texture(const GraphicsOutput self, 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. From now on, use

  • clear_render_textures and add_render_texture instead.

  • @deprecated Use add_render_texture() instead.

*/

shareDepthBuffer()

C++ Interface: share_depth_buffer(const GraphicsOutput self, GraphicsOutput graphics_output)

/**
  • Will attempt to use the depth buffer of the input graphics_output. The

  • buffer sizes must be exactly the same.

*/

share_depth_buffer()

C++ Interface: share_depth_buffer(const GraphicsOutput self, GraphicsOutput graphics_output)

/**
  • Will attempt to use the depth buffer of the input graphics_output. The

  • buffer sizes must be exactly the same.

*/

size
sort
supports_render_texture
swap_eyes
triggerCopy()

C++ Interface: trigger_copy(const GraphicsOutput self)

/**
  • When the GraphicsOutput is in triggered copy mode, this function triggers

  • the copy (at the end of the next frame).

  • @returns a future that can be awaited.

*/

trigger_copy()

C++ Interface: trigger_copy(const GraphicsOutput self)

/**
  • When the GraphicsOutput is in triggered copy mode, this function triggers

  • the copy (at the end of the next frame).

  • @returns a future that can be awaited.

*/

unshareDepthBuffer()

C++ Interface: unshare_depth_buffer(const GraphicsOutput self)

/**
  • Discontinue sharing the depth buffer.

*/

unshare_depth_buffer()

C++ Interface: unshare_depth_buffer(const GraphicsOutput self)

/**
  • Discontinue sharing the depth buffer.

*/

upcastToDrawableRegion()

C++ Interface: upcast_to_DrawableRegion(const GraphicsOutput self)

upcast from GraphicsOutput to DrawableRegion

upcastToGraphicsOutputBase()

C++ Interface: upcast_to_GraphicsOutputBase(const GraphicsOutput self)

upcast from GraphicsOutput to GraphicsOutputBase

upcast_to_DrawableRegion()

C++ Interface: upcast_to_DrawableRegion(const GraphicsOutput self)

upcast from GraphicsOutput to DrawableRegion

upcast_to_GraphicsOutputBase()

C++ Interface: upcast_to_GraphicsOutputBase(const GraphicsOutput self)

upcast from GraphicsOutput to GraphicsOutputBase