|
|
|
This is a base class for the various different classes that represent the result of a frame of rendering.
More...
#include "graphicsOutput.h"
List of all members.
Classes |
| class | CData |
| class | RenderTexture |
Public Types |
| enum | FrameMode { FM_render,
FM_parasite,
FM_refresh
} |
| enum | RenderTextureMode {
RTM_none,
RTM_bind_or_copy,
RTM_copy_texture,
RTM_copy_ram,
RTM_triggered_copy_texture,
RTM_triggered_copy_ram
} |
Public Member Functions |
| void | add_render_texture (Texture *tex, RenderTextureMode mode, RenderTexturePlane bitplane=RTP_COUNT) |
| | Creates a new Texture object, suitable for rendering the contents of this buffer into, and appends it to the list of render textures.
|
| virtual void | begin_flip () |
| | This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.
|
| virtual bool | begin_frame (FrameMode mode, Thread *current_thread) |
| | This function will be called within the draw thread before beginning rendering for a given frame.
|
| void | change_scenes (DisplayRegionPipelineReader *new_dr) |
| | Called by the GraphicsEngine when the window is about to change to another DisplayRegion.
|
| void | clear (Thread *current_thread) |
| | Clears the entire framebuffer before rendering, according to the settings of get_color_clear_active() and get_depth_clear_active() (inherited from DrawableRegion).
|
| void | clear_child_sort () |
| | Resets the sort value of future offscreen buffers created by make_texture_sort() to the default value.
|
| void | clear_delete_flag () |
| | Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame.
|
| virtual void | clear_pipe () |
| | Sets the window's _pipe pointer to NULL; this is generally called only as a precursor to deleting the window.
|
| void | clear_render_textures () |
| | If the GraphicsOutput is currently rendering to a texture, then all textures are dissociated from the GraphicsOuput.
|
| int | count_textures () const |
| | If the GraphicsOutput is set to render into a texture, returns the number of textures that are being rendered into.
|
| virtual void | end_flip () |
| | This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.
|
| virtual void | end_frame (FrameMode mode, Thread *current_thread) |
| | This function will be called within the draw thread after rendering is completed for a given frame.
|
| virtual bool | flip_ready () const |
| | Returns true if a frame has been rendered and needs to be flipped, false otherwise.
|
|
virtual TypeHandle | force_init_type () |
| int | get_child_sort () const |
| | Returns the sort value of future offscreen buffers created by make_texture_sort().
|
| PStatCollector & | get_cull_window_pcollector () |
| | Returns a PStatCollector for timing the cull operation for just this GraphicsOutput.
|
| bool | get_delete_flag () const |
| | Returns the current setting of the delete flag.
|
| PStatCollector & | get_draw_window_pcollector () |
| | Returns a PStatCollector for timing the draw operation for just this GraphicsOutput.
|
| GraphicsEngine * | get_engine () const |
| | Returns the graphics engine that created this output.
|
| const FrameBufferProperties & | get_fb_properties () const |
| | Returns the framebuffer properties of the window.
|
| int | get_fb_x_size () const |
| | Returns the internal width of the window or buffer.
|
| int | get_fb_y_size () const |
| | Returns the internal height of the window or buffer.
|
| GraphicsStateGuardian * | get_gsg () const |
| | Returns the GSG that is associated with this window.
|
| virtual GraphicsOutput * | get_host () |
| | This is normally called only from within make_texture_buffer().
|
| bool | get_inverted () const |
| | Returns the current setting of the inverted flag.
|
| unsigned int | get_left_eye_color_mask () const |
| | Returns the color mask in effect when rendering a left-eye view in red_blue stereo mode.
|
| const string & | get_name () const |
| | Returns the name that was passed to the GraphicsOutput constructor.
|
| int | get_num_active_display_regions () const |
| | Returns the number of active DisplayRegions that have been created within the window.
|
| int | get_num_display_regions () const |
| | Returns the number of DisplayRegions that have been created within the window, active or otherwise.
|
| bool | get_one_shot () const |
| | Returns the current setting of the one-shot flag.
|
| DisplayRegion * | get_overlay_display_region () const |
| | Returns the special "overlay" DisplayRegion that is created for each window or buffer.
|
| GraphicsPipe * | get_pipe () const |
| | Returns the GraphicsPipe that this window is associated with.
|
| bool | get_red_blue_stereo () const |
| | Returns whether red-blue stereo mode is in effect for this particular window.
|
| unsigned int | get_right_eye_color_mask () const |
| | Returns the color mask in effect when rendering a right-eye view in red_blue stereo mode.
|
| RenderTextureMode | get_rtm_mode (int i=0) const |
| | Returns the RenderTextureMode associated with the nth render-texture.
|
| const LVecBase4 & | get_sbs_left_dimensions () const |
| | 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.
|
| int | get_sbs_left_x_size () const |
| | 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().
|
| int | get_sbs_left_y_size () const |
| | 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().
|
| const LVecBase4 & | get_sbs_right_dimensions () const |
| | 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.
|
| int | get_sbs_right_x_size () const |
| | 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().
|
| int | get_sbs_right_y_size () const |
| | 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().
|
| bool | get_screenshot (PNMImage &image) |
| | Captures the most-recently rendered image from the framebuffer into the indicated PNMImage.
|
| bool | get_side_by_side_stereo () const |
| | Returns whether side-by-side stereo mode is in effect for this particular window.
|
| int | get_sort () const |
| | Returns the sorting order of this particular GraphicsOutput.
|
| virtual bool | get_supports_render_texture () const |
| | 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.
|
| bool | get_swap_eyes () const |
| | Returns the current setting of the "swap eyes" flag.
|
| virtual Texture * | get_texture (int i=0) const |
| | Returns the nth texture into which the GraphicsOutput renders.
|
| NodePath | get_texture_card () |
| | Returns a PandaNode containing a square polygon.
|
| RenderTexturePlane | get_texture_plane (int i=0) const |
| | Returns the RenderTexturePlane associated with the nth render-texture.
|
|
virtual TypeHandle | get_type () const |
| int | get_x_size () const |
| | Returns the visible width of the window or buffer, if it is known.
|
| int | get_y_size () const |
| | Returns the visible height of the window or buffer, if it is known.
|
| bool | has_size () const |
| | Returns true if the size of the window/frame buffer is known, false otherwise.
|
| bool | has_texture () const |
| | Returns true if the GraphicsOutput is rendering into any textures at all.
|
| virtual bool | is_active () const |
| | Returns true if the window is ready to be rendered into, false otherwise.
|
| bool | is_nonzero_size () const |
| | Returns true if the output has a nonzero size in both X and Y, or false if it is zero (and therefore invalid).
|
| bool | is_stereo () const |
| | 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 | is_valid () const |
| | Returns true if the output is fully created and ready for rendering, false otherwise.
|
| GraphicsOutput * | make_cube_map (const string &name, int size, NodePath &camera_rig, DrawMask camera_mask=PandaNode::get_all_camera_mask(), bool to_ram=false, FrameBufferProperties *fbp=NULL) |
| | 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 * | make_display_region () |
| | Creates a new DisplayRegion that covers the entire window.
|
| DisplayRegion * | make_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
| | Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
|
| DisplayRegion * | make_display_region (const LVecBase4 &dimensions) |
| | Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
|
| DisplayRegion * | make_mono_display_region () |
| | Creates a new DisplayRegion that covers the entire window.
|
| DisplayRegion * | make_mono_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
| | Creates a new DisplayRegion that covers the entire window.
|
| DisplayRegion * | make_mono_display_region (const LVecBase4 &dimensions) |
| | Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
|
|
| MAKE_SEQ (get_display_regions, get_num_display_regions, get_display_region) |
|
| MAKE_SEQ (get_active_display_regions, get_num_active_display_regions, get_active_display_region) |
| StereoDisplayRegion * | make_stereo_display_region () |
| | Creates a new DisplayRegion that covers the entire window.
|
| StereoDisplayRegion * | make_stereo_display_region (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
| | Creates a new DisplayRegion that covers the entire window.
|
| StereoDisplayRegion * | make_stereo_display_region (const LVecBase4 &dimensions) |
| | Creates a new DisplayRegion that covers the indicated sub-rectangle within the window.
|
| GraphicsOutput * | make_texture_buffer (const string &name, int x_size, int y_size, Texture *tex=NULL, bool to_ram=false, FrameBufferProperties *fbp=NULL) |
| | 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.
|
| bool | operator< (const GraphicsOutput &other) const |
| | The sorting operator is used to order the GraphicsOutput object in order by their sort number, so that they will render in the correct order in the GraphicsEngine.
|
| virtual void | process_events () |
| | Do whatever processing in the window thread is appropriate for this output object each frame.
|
|
| PT (DisplayRegion) get_display_region(int n) const |
|
| PT (DisplayRegion) get_active_display_region(int n) const |
|
| PT (Texture) get_screenshot() |
| virtual void | ready_flip () |
| | This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.
|
| void | remove_all_display_regions () |
| | Removes all display regions from the window, except the default one that is created with the window.
|
| bool | remove_display_region (DisplayRegion *display_region) |
| | Removes the indicated DisplayRegion from the window, and destructs it if there are no other references.
|
| virtual void | request_close () |
| | This is called by the GraphicsEngine to request that the window (or whatever) close itself or, in general, make itself invalid, at the next call to process_events().
|
| virtual void | request_open () |
| | This is called by the GraphicsEngine to request that the window (or whatever) open itself or, in general, make itself valid, at the next call to process_events().
|
| virtual void | reset_window (bool swapchain) |
| | Resets the window framebuffer from its derived children.
|
| bool | save_screenshot (const Filename &filename, const string &image_comment="") |
| | Saves a screenshot of the region to the indicated filename.
|
| Filename | save_screenshot_default (const string &prefix="screenshot") |
| | Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
|
| virtual void | select_cube_map (int cube_map_index) |
| | Called internally when the window is in render-to-a-texture mode and we are in the process of rendering the six faces of a cube map.
|
| void | set_active (bool active) |
| | Sets the active flag associated with the GraphicsOutput.
|
| void | set_child_sort (int child_sort) |
| | Specifies the sort value of future offscreen buffers created by make_texture_sort().
|
| virtual void | set_close_now () |
| | This is called by the GraphicsEngine to insist that the output be closed immediately.
|
| void | set_inverted (bool inverted) |
| | Changes the current setting of the inverted flag.
|
| void | set_one_shot (bool one_shot) |
| | Changes the current setting of the one-shot flag.
|
| void | set_overlay_display_region (DisplayRegion *display_region) |
| | Replaces the special "overlay" DisplayRegion that is created for each window or buffer.
|
| void | set_red_blue_stereo (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.
|
| void | set_side_by_side_stereo (bool side_by_side_stereo) |
| | Enables side-by-side stereo mode on this particular window.
|
| void | set_side_by_side_stereo (bool side_by_side_stereo, const LVecBase4 &sbs_left_dimensions, const LVecBase4 &sbs_right_dimensions) |
| | Enables side-by-side stereo mode on this particular window.
|
| void | set_size_and_recalc (int x, int y) |
| | Changes the x_size and y_size, then recalculates structures that depend on size.
|
| virtual void | set_sort (int sort) |
| | Adjusts the sorting order of this particular GraphicsOutput, relative to other GraphicsOutputs.
|
| void | set_swap_eyes (bool swap_eyes) |
| | Changes the "swap eyes" flag.
|
| void | setup_render_texture (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.
|
| virtual bool | share_depth_buffer (GraphicsOutput *graphics_output) |
| | Will attempt to use the depth buffer of the input graphics_output.
|
| void | trigger_copy () |
| | When the GraphicsOutput is in triggered copy mode, this function triggers the copy (at the end of the next frame).
|
| virtual void | unshare_depth_buffer () |
| | Discontinue sharing the depth buffer.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
| static Filename | make_screenshot_filename (const string &prefix="screenshot") |
| | Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed.
|
Protected Types |
|
typedef pvector< DisplayRegion * > | ActiveDisplayRegions |
typedef CycleDataLockedReader
< CData > | CDLockedReader |
|
typedef CycleDataReader< CData > | CDReader |
|
typedef CycleDataWriter< CData > | CDWriter |
|
typedef pvector< RenderTexture > | RenderTextures |
|
typedef pvector< PT(DisplayRegion) > | TotalDisplayRegions |
Protected Member Functions |
| | GraphicsOutput (GraphicsEngine *engine, GraphicsPipe *pipe, const string &name, const FrameBufferProperties &fb_prop, const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, bool default_stereo_flags) |
| | Normally, the GraphicsOutput constructor is not called directly; these are created instead via the GraphicsEngine::make_window() function.
|
| void | begin_frame_spam (FrameMode mode) |
| | Display the spam message associated with begin_frame.
|
| void | clear_cube_map_selection () |
| | Clear the variables that select a cube-map face.
|
| bool | copy_to_textures () |
| | For all textures marked RTM_copy_texture, RTM_copy_ram, RTM_triggered_copy_texture, or RTM_triggered_copy_ram, do the necessary copies.
|
| void | end_frame_spam (FrameMode mode) |
| | Display the spam message associated with end_frame.
|
| virtual void | pixel_factor_changed () |
| | Called internally when the pixel factor changes.
|
| void | prepare_for_deletion () |
| | Set the delete flag, and do the usual cleanup activities associated with that.
|
| void | promote_to_copy_texture () |
| | If any textures are marked RTM_bind_or_copy, change them to RTM_copy_texture.
|
|
| PT (GraphicsStateGuardian) _gsg |
|
| PT (GraphicsPipe) _pipe |
|
| PT (GraphicsOutput) _host |
|
| PT (Geom) _texture_card |
|
| PT (DisplayRegion) _overlay_display_region |
| void | trigger_flip () |
| | To be called at the end of the frame, after the window has successfully been drawn and is ready to be flipped (if appropriate).
|
Protected Attributes |
|
int | _creation_flags |
|
DisplayRegion * | _cube_map_dr |
|
int | _cube_map_index |
|
PStatCollector | _cull_window_pcollector |
|
PipelineCycler< CData > | _cycler |
|
bool | _delete_flag |
|
PStatCollector | _draw_window_pcollector |
|
GraphicsEngine * | _engine |
|
FrameBufferProperties | _fb_properties |
|
bool | _flip_ready |
|
bool | _has_size |
|
pvector< WPT(Texture)> | _hold_textures |
|
bool | _inverted |
|
bool | _is_nonzero_size |
|
bool | _is_valid |
|
unsigned int | _left_eye_color_mask |
|
LightMutex | _lock |
|
string | _name |
|
bool | _red_blue_stereo |
|
unsigned int | _right_eye_color_mask |
|
LVecBase4 | _sbs_left_dimensions |
|
LVecBase4 | _sbs_right_dimensions |
|
bool | _side_by_side_stereo |
|
bool | _stereo |
|
bool | _swap_eyes |
|
TotalDisplayRegions | _total_display_regions |
|
bool | _trigger_copy |
|
int | _x_size |
|
int | _y_size |
Static Protected Attributes |
|
static PStatCollector | _copy_texture_pcollector |
|
static PStatCollector | _cull_pcollector |
|
static PStatCollector | _draw_pcollector |
|
static PStatCollector | _make_current_pcollector |
Friends |
|
class | DisplayRegion |
|
class | GraphicsEngine |
|
class | GraphicsPipe |
Detailed Description
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.
Definition at line 68 of file graphicsOutput.h.
Constructor & Destructor Documentation
Normally, the GraphicsOutput constructor is not called directly; these are created instead via the GraphicsEngine::make_window() function.
Definition at line 71 of file graphicsOutput.cxx.
References ConfigVariable::get_num_words(), ConfigVariable::get_string_value(), ConfigVariableString::get_word(), WindowProperties::get_x_size(), WindowProperties::get_y_size(), WindowProperties::has_size(), make_mono_display_region(), DrawableRegion::set_clear_color(), DrawableRegion::set_clear_color_active(), DrawableRegion::set_clear_depth_active(), and DrawableRegion::set_clear_stencil_active().
Member Function Documentation
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.
Definition at line 300 of file graphicsOutput.cxx.
References Texture::clear_ram_image(), Texture::get_format(), get_name(), get_supports_render_texture(), get_x_size(), get_y_size(), Texture::set_compression(), Texture::set_format(), Texture::set_match_framebuffer_format(), Texture::set_render_to_texture(), and Texture::set_size_padded().
Referenced by make_texture_buffer(), and setup_render_texture().
This function will be called within the draw thread before beginning rendering for a given frame.
It should do whatever setup is required, and return true if the frame should be rendered, or false if it should be skipped.
Reimplemented in CallbackGraphicsWindow, ParasiteBuffer, wglGraphicsBuffer, AndroidGraphicsWindow, wdxGraphicsBuffer8, wdxGraphicsBuffer9, osxGraphicsWindow, x11GraphicsWindow, CocoaGraphicsWindow, wdxGraphicsWindow8, wdxGraphicsWindow9, eglGraphicsWindow, glxGraphicsPixmap, IPhoneGraphicsWindow, eglGraphicsPixmap, glxGraphicsWindow, OsMesaGraphicsBuffer, osxGraphicsBuffer, eglGraphicsBuffer, glxGraphicsBuffer, TinyGraphicsBuffer, and wglGraphicsWindow.
Definition at line 1299 of file graphicsOutput.cxx.
Display the spam message associated with begin_frame.
Definition at line 840 of file graphicsOutput.I.
References get_name().
Referenced by TinyGraphicsBuffer::begin_frame(), wglGraphicsWindow::begin_frame(), glxGraphicsBuffer::begin_frame(), eglGraphicsBuffer::begin_frame(), OsMesaGraphicsBuffer::begin_frame(), osxGraphicsBuffer::begin_frame(), eglGraphicsPixmap::begin_frame(), glxGraphicsWindow::begin_frame(), eglGraphicsWindow::begin_frame(), glxGraphicsPixmap::begin_frame(), wdxGraphicsWindow8::begin_frame(), wdxGraphicsWindow9::begin_frame(), x11GraphicsWindow::begin_frame(), wdxGraphicsBuffer8::begin_frame(), wdxGraphicsBuffer9::begin_frame(), AndroidGraphicsWindow::begin_frame(), wglGraphicsBuffer::begin_frame(), and ParasiteBuffer::begin_frame().
Clear the variables that select a cube-map face.
Definition at line 868 of file graphicsOutput.I.
Referenced by wglGraphicsWindow::begin_frame(), eglGraphicsBuffer::begin_frame(), glxGraphicsBuffer::begin_frame(), OsMesaGraphicsBuffer::begin_frame(), osxGraphicsBuffer::begin_frame(), eglGraphicsPixmap::begin_frame(), glxGraphicsWindow::begin_frame(), eglGraphicsWindow::begin_frame(), glxGraphicsPixmap::begin_frame(), wdxGraphicsWindow8::begin_frame(), wdxGraphicsWindow9::begin_frame(), x11GraphicsWindow::begin_frame(), wdxGraphicsBuffer8::begin_frame(), wdxGraphicsBuffer9::begin_frame(), AndroidGraphicsWindow::begin_frame(), wglGraphicsBuffer::begin_frame(), ParasiteBuffer::begin_frame(), wglGraphicsWindow::end_frame(), TinyGraphicsBuffer::end_frame(), glxGraphicsBuffer::end_frame(), eglGraphicsBuffer::end_frame(), osxGraphicsBuffer::end_frame(), OsMesaGraphicsBuffer::end_frame(), eglGraphicsPixmap::end_frame(), wdxGraphicsWindow8::end_frame(), glxGraphicsPixmap::end_frame(), wdxGraphicsWindow9::end_frame(), eglGraphicsWindow::end_frame(), x11GraphicsWindow::end_frame(), wdxGraphicsBuffer8::end_frame(), wdxGraphicsBuffer9::end_frame(), AndroidGraphicsWindow::end_frame(), wglGraphicsBuffer::end_frame(), ParasiteBuffer::end_frame(), and CallbackGraphicsWindow::end_frame().
Resets the delete flag, so the GraphicsOutput will not be automatically deleted before the beginning of the next frame.
Definition at line 490 of file graphicsOutput.I.
For all textures marked RTM_copy_texture, RTM_copy_ram, RTM_triggered_copy_texture, or RTM_triggered_copy_ram, do the necessary copies.
Returns true if all copies are successful, false otherwise.
Definition at line 1527 of file graphicsOutput.cxx.
References DrawableRegion::get_draw_buffer_type(), get_fb_properties(), get_name(), and DrawableRegion::get_renderbuffer_type().
Referenced by TinyGraphicsBuffer::end_frame(), wglGraphicsWindow::end_frame(), glxGraphicsBuffer::end_frame(), eglGraphicsBuffer::end_frame(), osxGraphicsBuffer::end_frame(), OsMesaGraphicsBuffer::end_frame(), eglGraphicsPixmap::end_frame(), eglGraphicsWindow::end_frame(), glxGraphicsPixmap::end_frame(), wdxGraphicsWindow8::end_frame(), wdxGraphicsWindow9::end_frame(), x11GraphicsWindow::end_frame(), wdxGraphicsBuffer8::end_frame(), wdxGraphicsBuffer9::end_frame(), AndroidGraphicsWindow::end_frame(), wglGraphicsBuffer::end_frame(), and ParasiteBuffer::end_frame().
This function will be called within the draw thread after begin_flip() has been called on all windows, to finish the exchange of the front and back buffers.
This should cause the window to wait for the flip, if necessary.
Reimplemented in CallbackGraphicsWindow, ParasiteBuffer, AndroidGraphicsWindow, osxGraphicsWindow, CocoaGraphicsWindow, IPhoneGraphicsWindow, wdxGraphicsWindow8, wdxGraphicsWindow9, eglGraphicsWindow, glxGraphicsWindow, and wglGraphicsWindow.
Definition at line 1428 of file graphicsOutput.cxx.
This function will be called within the draw thread after rendering is completed for a given frame.
It should do whatever finalization is required.
Reimplemented in CallbackGraphicsWindow, ParasiteBuffer, wglGraphicsBuffer, AndroidGraphicsWindow, wdxGraphicsBuffer8, wdxGraphicsBuffer9, osxGraphicsWindow, x11GraphicsWindow, CocoaGraphicsWindow, wdxGraphicsWindow8, wdxGraphicsWindow9, eglGraphicsWindow, glxGraphicsPixmap, IPhoneGraphicsWindow, eglGraphicsPixmap, OsMesaGraphicsBuffer, osxGraphicsBuffer, eglGraphicsBuffer, glxGraphicsBuffer, TinyGraphicsBuffer, and wglGraphicsWindow.
Definition at line 1311 of file graphicsOutput.cxx.
Display the spam message associated with end_frame.
Definition at line 854 of file graphicsOutput.I.
References get_name().
Referenced by TinyGraphicsBuffer::end_frame(), wglGraphicsWindow::end_frame(), glxGraphicsBuffer::end_frame(), eglGraphicsBuffer::end_frame(), osxGraphicsBuffer::end_frame(), OsMesaGraphicsBuffer::end_frame(), eglGraphicsPixmap::end_frame(), eglGraphicsWindow::end_frame(), glxGraphicsPixmap::end_frame(), wdxGraphicsWindow8::end_frame(), wdxGraphicsWindow9::end_frame(), x11GraphicsWindow::end_frame(), wdxGraphicsBuffer8::end_frame(), wdxGraphicsBuffer9::end_frame(), AndroidGraphicsWindow::end_frame(), wglGraphicsBuffer::end_frame(), and ParasiteBuffer::end_frame().
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.
Definition at line 57 of file graphicsOutput.I.
Returns the framebuffer properties of the window.
Definition at line 465 of file graphicsOutput.I.
Referenced by TinyGraphicsBuffer::begin_frame(), wglGraphicsWindow::begin_frame(), eglGraphicsBuffer::begin_frame(), glxGraphicsBuffer::begin_frame(), OsMesaGraphicsBuffer::begin_frame(), osxGraphicsBuffer::begin_frame(), eglGraphicsPixmap::begin_frame(), glxGraphicsWindow::begin_frame(), wdxGraphicsWindow8::begin_frame(), wdxGraphicsWindow9::begin_frame(), eglGraphicsWindow::begin_frame(), glxGraphicsPixmap::begin_frame(), x11GraphicsWindow::begin_frame(), wdxGraphicsBuffer9::begin_frame(), wdxGraphicsBuffer8::begin_frame(), AndroidGraphicsWindow::begin_frame(), wglGraphicsBuffer::begin_frame(), CallbackGraphicsWindow::begin_frame(), change_scenes(), copy_to_textures(), and GraphicsEngine::make_output().
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.
Definition at line 29 of file graphicsOutput.I.
Referenced by NonlinearImager::add_viewer(), GraphicsEngine::make_buffer(), make_cube_map(), GraphicsEngine::make_output(), GraphicsEngine::make_parasite(), make_texture_buffer(), ParasiteBuffer::ParasiteBuffer(), GraphicsEngine::remove_all_windows(), GraphicsEngine::remove_window(), DisplayRegionCullCallbackData::upcall(), and DisplayRegionDrawCallbackData::upcall().
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().
Definition at line 323 of file graphicsOutput.I.
Returns the number of DisplayRegions that have been created within the window, active or otherwise.
Definition at line 834 of file graphicsOutput.cxx.
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.
Definition at line 689 of file graphicsOutput.I.
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage.
Returns true on success, false on failure.
Definition at line 749 of file graphicsOutput.I.
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.
Definition at line 287 of file graphicsOutput.I.
Referenced by DisplayRegion::set_dimensions().
Returns true if the output has a nonzero size in both X and Y, or false if it is zero (and therefore invalid).
Definition at line 310 of file graphicsOutput.I.
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.
Definition at line 1000 of file graphicsOutput.cxx.
References NodePath::attach_new_node(), DrawableRegion::copy_clear_settings(), get_gsg(), GraphicsStateGuardian::get_max_cube_map_dimension(), GraphicsStateGuardian::get_supports_cube_map(), NodePath::look_at(), make_display_region(), make_texture_buffer(), NodePath::node(), DisplayRegion::set_camera(), DrawableRegion::set_clear_color_active(), DrawableRegion::set_clear_depth_active(), DrawableRegion::set_clear_stencil_active(), DisplayRegion::set_cube_map_index(), PandaNode::set_effect(), and Lens::set_fov().
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().
Definition at line 709 of file graphicsOutput.I.
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().
Definition at line 935 of file graphicsOutput.cxx.
References add_render_texture(), get_child_sort(), GraphicsStateGuardian::get_engine(), get_gsg(), get_host(), get_pipe(), GraphicsStateGuardian::get_prepared_objects(), Texture::get_texture_type(), and WindowProperties::size().
Referenced by MultitexReducer::flatten(), and make_cube_map().
| bool GraphicsOutput::operator< |
( |
const GraphicsOutput & |
other | ) |
const [inline] |
Do whatever processing in the window thread is appropriate for this output object each frame.
This function is called only within the window thread.
Reimplemented in CallbackGraphicsWindow, GraphicsWindow, WinGraphicsWindow, wglGraphicsBuffer, GraphicsBuffer, AndroidGraphicsWindow, wdxGraphicsBuffer8, wdxGraphicsBuffer9, osxGraphicsWindow, CocoaGraphicsWindow, x11GraphicsWindow, eglGraphicsWindow, and IPhoneGraphicsWindow.
Definition at line 1442 of file graphicsOutput.cxx.
This function will be called within the draw thread after end_frame() has been called on all windows, to initiate the exchange of the front and back buffers.
This should instruct the window to prepare for the flip when it is command but not actually flip
Reimplemented in ParasiteBuffer, and wglGraphicsWindow.
Definition at line 1414 of file graphicsOutput.cxx.
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.
Definition at line 737 of file graphicsOutput.I.
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.
Definition at line 527 of file graphicsOutput.I.
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.
Definition at line 522 of file graphicsOutput.cxx.
Referenced by ParasiteBuffer::ParasiteBuffer(), and GraphicsBuffer::process_events().
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.)
Definition at line 482 of file graphicsOutput.cxx.
References ClockObject::get_frame_count(), and ClockObject::get_global_clock().
Referenced by MultitexReducer::flatten().
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.
Definition at line 372 of file graphicsOutput.I.
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.
Definition at line 557 of file graphicsOutput.cxx.
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.
Definition at line 584 of file graphicsOutput.cxx.
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.
Definition at line 339 of file graphicsOutput.I.
To be called at the end of the frame, after the window has successfully been drawn and is ready to be flipped (if appropriate).
Reimplemented in WinGraphicsWindow.
Definition at line 881 of file graphicsOutput.I.
Referenced by TinyGraphicsBuffer::end_frame(), glxGraphicsBuffer::end_frame(), eglGraphicsBuffer::end_frame(), OsMesaGraphicsBuffer::end_frame(), osxGraphicsBuffer::end_frame(), eglGraphicsPixmap::end_frame(), glxGraphicsPixmap::end_frame(), eglGraphicsWindow::end_frame(), x11GraphicsWindow::end_frame(), wdxGraphicsBuffer8::end_frame(), wdxGraphicsBuffer9::end_frame(), AndroidGraphicsWindow::end_frame(), wglGraphicsBuffer::end_frame(), and CallbackGraphicsWindow::end_frame().
The documentation for this class was generated from the following files:
| | |