This is a special DisplayRegion wrapper that actually includes a pair of DisplayRegions internally: the left and right eyes. More...
#include "stereoDisplayRegion.h"
Public Member Functions | |
virtual void | disable_clears () |
Disables both the color and depth clear. More... | |
virtual TypeHandle | force_init_type () |
DisplayRegion * | get_left_eye () |
DisplayRegion * | get_right_eye () |
virtual TypeHandle | get_type () const |
virtual bool | is_stereo () const |
Returns true if this is a StereoDisplayRegion, false otherwise. More... | |
virtual void | output (std::ostream &out) const |
virtual | PT (PandaNode) make_cull_result_graph() |
virtual void | set_active (bool active) |
Sets the active flag on both the left and right DisplayRegions to the indicated value. More... | |
virtual void | set_camera (const NodePath &camera) |
Sets both the left and right DisplayRegions to the indicated camera. More... | |
virtual void | set_clear_active (int n, bool clear_aux_active) |
Sets the clear-active flag for any bitplane. More... | |
virtual void | set_clear_value (int n, const LColor &clear_value) |
Sets the clear value for any bitplane. More... | |
virtual void | set_cull_traverser (CullTraverser *trav) |
Sets the CullTraverser for both the left and right DisplayRegions. More... | |
virtual void | set_dimensions (int i, const LVecBase4 &dimensions) |
Sets both the left and right DisplayRegions to the indicated dimensions. More... | |
virtual void | set_incomplete_render (bool incomplete_render) |
Sets the incomplete_render flag on both the left and right DisplayRegions to the indicated value. More... | |
virtual void | set_pixel_zoom (PN_stdfloat pixel_zoom) |
Sets the pixel_zoom for left and right eyes. More... | |
virtual void | set_sort (int sort) |
Sets the indicated sort value on the overall DisplayRegion, the indicated sort value + 1 on the left eye, and the indicated sort value + 2 on the right eye. More... | |
virtual void | set_stereo_channel (Lens::StereoChannel stereo_channel) |
Sets the stereo channels on the left and right eyes, and also sets the active flags independently on both eyes. More... | |
virtual void | set_target_tex_page (int page) |
Sets the page and view on both the left and right DisplayRegions to the indicated value. More... | |
virtual void | set_tex_view_offset (int tex_view_offset) |
Sets the current texture view offset for this DisplayRegion. More... | |
virtual void | set_texture_reload_priority (int texture_reload_priority) |
Sets the texture_reload_priority on both the left and right DisplayRegions to the indicated value. More... | |
Public Member Functions inherited from DisplayRegion | |
void | cleanup () |
Cleans up some pointers associated with the DisplayRegion to help reduce the chance of memory leaks due to circular reference counts. More... | |
void | clear_cull_callback () |
Removes the callback set by an earlier call to set_cull_callback(). More... | |
void | clear_draw_callback () |
Removes the callback set by an earlier call to set_draw_callback(). More... | |
void | compute_pixels () |
Computes the pixel locations of the DisplayRegion within its window. More... | |
void | compute_pixels (int x_size, int y_size) |
Computes the pixel locations of the DisplayRegion within its window, given the size of the window in pixels. More... | |
void | compute_pixels_all_stages () |
Computes the pixel locations of the DisplayRegion within its window. More... | |
void | compute_pixels_all_stages (int x_size, int y_size) |
Performs a compute_pixels() operation for all stages of the pipeline. More... | |
PN_stdfloat | get_bottom (int i=0) const |
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. More... | |
NodePath | get_camera (Thread *current_thread=Thread::get_current_thread()) const |
CallbackObject * | get_cull_callback () const |
PStatCollector & | get_cull_region_pcollector () |
Returns a PStatCollector for timing the cull operation for just this DisplayRegion. More... | |
CullResult * | get_cull_result (Thread *current_thread) const |
Returns the CullResult value that was stored on this DisplayRegion, presumably by the last successful cull operation. More... | |
CullTraverser * | get_cull_traverser () |
const std::string & | get_debug_name () const |
Returns a unique name used for debugging. More... | |
void | get_dimensions (PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
void | get_dimensions (int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
LVecBase4 | get_dimensions (int i=0) const |
CallbackObject * | get_draw_callback () const |
PStatCollector & | get_draw_region_pcollector () |
Returns a PStatCollector for timing the draw operation for just this DisplayRegion. More... | |
bool | get_incomplete_render () const |
PN_stdfloat | get_left (int i=0) const |
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. More... | |
int | get_lens_index () const |
int | get_num_regions () const |
Returns the number of regions, see set_num_regions. More... | |
GraphicsPipe * | get_pipe () const |
int | get_pixel_height (int i=0) const |
Returns the height of the DisplayRegion in pixels. More... | |
LVecBase2i | get_pixel_size (int i=0) const |
int | get_pixel_width (int i=0) const |
Returns the width of the DisplayRegion in pixels. More... | |
void | get_pixels (int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its window, in pixels. More... | |
void | get_pixels (int i, int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its window, in pixels. More... | |
void | get_region_pixels (int &xo, int &yo, int &w, int &h) const |
Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More... | |
void | get_region_pixels (int i, int &xo, int &yo, int &w, int &h) const |
Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More... | |
void | get_region_pixels_i (int &xo, int &yo, int &w, int &h) const |
Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More... | |
void | get_region_pixels_i (int i, int &xo, int &yo, int &w, int &h) const |
Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More... | |
PN_stdfloat | get_right (int i=0) const |
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. More... | |
SceneSetup * | get_scene_setup (Thread *current_thread) const |
Returns the SceneSetup value that was stored on this DisplayRegion, presumably by the last successful cull operation. More... | |
bool | get_scissor_enabled () const |
bool | get_screenshot (PNMImage &image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More... | |
int | get_sort () const |
Lens::StereoChannel | get_stereo_channel () const |
int | get_target_tex_page () const |
int | get_tex_view_offset () const |
int | get_texture_reload_priority () const |
PN_stdfloat | get_top (int i=0) const |
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. More... | |
GraphicsOutput * | get_window () const |
bool | is_active () const |
bool | operator< (const DisplayRegion &other) const |
Returns true if this DisplayRegion should be sorted before the other one, false otherwise. More... | |
PT (Texture) get_screenshot() | |
bool | save_screenshot (const Filename &filename, const std::string &image_comment="") |
Saves a screenshot of the region to the indicated filename. More... | |
Filename | save_screenshot_default (const std::string &prefix="screenshot") |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More... | |
void | set_cube_map_index (int cube_map_index) |
Deprecated; replaced by set_target_tex_page(). More... | |
void | set_cull_callback (CallbackObject *object) |
void | set_cull_result (PT(CullResult) cull_result, PT(SceneSetup) scene_setup, Thread *current_thread) |
Stores the result of performing a cull operation on this DisplayRegion. More... | |
void | set_dimensions (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
void | set_dimensions (int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
void | set_dimensions (const LVecBase4 &dimensions) |
void | set_draw_callback (CallbackObject *object) |
void | set_lens_index (int index) |
void | set_num_regions (int i) |
Sets the number of regions that this DisplayRegion indicates. More... | |
void | set_scissor_enabled (bool scissor_enabled) |
virtual bool | supports_pixel_zoom () const |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. More... | |
Public Member Functions inherited from TypedReferenceCount | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
Public Member Functions inherited from TypedObject | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Public Member Functions inherited from DrawableRegion | |
DrawableRegion (const DrawableRegion ©) | |
void | copy_clear_settings (const DrawableRegion ©) |
Copies only the clear settings from the other drawable region. More... | |
virtual bool | get_clear_active (int n) const |
Gets the clear-active flag for any bitplane. More... | |
const LColor & | get_clear_color () const |
bool | get_clear_color_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
PN_stdfloat | get_clear_depth () const |
bool | get_clear_depth_active () const |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More... | |
unsigned int | get_clear_stencil () const |
bool | get_clear_stencil_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
virtual const LColor & | get_clear_value (int n) const |
Returns the clear value for any bitplane. More... | |
int | get_draw_buffer_type () const |
Returns the RenderBuffer into which the GSG should issue draw commands. More... | |
PN_stdfloat | get_pixel_factor () const |
PN_stdfloat | get_pixel_zoom () const |
int | get_screenshot_buffer_type () const |
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion. More... | |
virtual bool | is_any_clear_active () const |
Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear. More... | |
void | operator= (const DrawableRegion ©) |
void | set_clear_color (const LColor &color) |
void | set_clear_color_active (bool clear_color_active) |
Toggles the flag that indicates whether the color buffer should be cleared every frame. More... | |
void | set_clear_depth (PN_stdfloat depth) |
void | set_clear_depth_active (bool clear_depth_active) |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. More... | |
void | set_clear_stencil (unsigned int stencil) |
void | set_clear_stencil_active (bool clear_stencil_active) |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from DisplayRegion | |
static TypeHandle | get_class_type () |
static void | init_type () |
static Filename | make_screenshot_filename (const std::string &prefix="screenshot") |
Synthesizes a suitable default filename for passing to save_screenshot(). More... | |
Static Public Member Functions inherited from TypedReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TypedObject | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from DrawableRegion | |
static int | get_renderbuffer_type (int plane) |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More... | |
Public Attributes | |
get_left_eye | |
Returns a pointer to the left DisplayRegion managed by this stereo object. More... | |
get_right_eye | |
Returns a pointer to the right DisplayRegion managed by this stereo object. More... | |
Public Attributes inherited from DisplayRegion | |
get_camera | |
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More... | |
get_cull_callback | |
Returns the CallbackObject set by set_cull_callback(). More... | |
get_cull_traverser | |
Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More... | |
get_dimensions | |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More... | |
get_draw_callback | |
Returns the CallbackObject set by set_draw_callback(). More... | |
get_incomplete_render | |
Returns the incomplete_render flag. More... | |
get_lens_index | |
Returns the specific lens of the associated Camera that will be used for rendering this scene. More... | |
get_pipe | |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More... | |
get_pixel_size | |
Returns the size of the DisplayRegion in pixels. More... | |
get_scissor_enabled | |
Returns whether or not scissor testing is enabled for this region. More... | |
get_sort | |
Returns the sort value associated with the DisplayRegion. More... | |
get_stereo_channel | |
Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image. More... | |
get_target_tex_page | |
Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More... | |
get_tex_view_offset | |
Returns the current texture view offset for this DisplayRegion. More... | |
get_texture_reload_priority | |
Returns the priority which is assigned to asynchronous texture reload requests. More... | |
get_window | |
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More... | |
is_active | |
Returns the active flag associated with the DisplayRegion. More... | |
is_stereo | |
Returns true if this is a StereoDisplayRegion, false otherwise. More... | |
set_active | |
Sets the active flag associated with the DisplayRegion. More... | |
set_camera | |
Sets the camera that is associated with this DisplayRegion. More... | |
set_cull_callback | |
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. More... | |
set_cull_traverser | |
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. More... | |
set_dimensions | |
Changes the portion of the framebuffer this DisplayRegion corresponds to. More... | |
set_draw_callback | |
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. More... | |
set_incomplete_render | |
Sets the incomplete_render flag. More... | |
set_lens_index | |
Sets the lens index, allows for multiple lenses to be attached to a camera. More... | |
set_scissor_enabled | |
Sets whether or not scissor testing is enabled for this region. More... | |
set_sort | |
Sets the sort value associated with the DisplayRegion. More... | |
set_stereo_channel | |
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. More... | |
set_target_tex_page | |
This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture. More... | |
set_tex_view_offset | |
Sets the current texture view offset for this DisplayRegion. More... | |
set_texture_reload_priority | |
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. More... | |
Public Attributes inherited from TypedObject | |
get_type | |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
Public Attributes inherited from DrawableRegion | |
get_clear_color | |
Returns the current clear color value. More... | |
get_clear_depth | |
Returns the current clear depth value. More... | |
get_clear_stencil | |
Returns the current clear stencil value. More... | |
get_pixel_factor | |
Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More... | |
get_pixel_zoom | |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More... | |
set_clear_color | |
Sets the clear color to the indicated value. More... | |
set_clear_depth | |
Sets the clear depth to the indicated value. More... | |
set_clear_stencil | |
Sets the clear stencil to the indicated value. More... | |
set_pixel_zoom | |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More... | |
Friends | |
class | DisplayRegionPipelineReader |
class | GraphicsOutput |
Additional Inherited Members | |
Public Types inherited from DisplayRegion | |
typedef epvector< Region > | Regions |
Public Types inherited from DrawableRegion | |
enum | RenderTexturePlane { RTP_stencil =0, RTP_depth_stencil =1, RTP_color, RTP_aux_rgba_0, RTP_aux_rgba_1, RTP_aux_rgba_2, RTP_aux_rgba_3, RTP_aux_hrgba_0, RTP_aux_hrgba_1, RTP_aux_hrgba_2, RTP_aux_hrgba_3, RTP_aux_float_0, RTP_aux_float_1, RTP_aux_float_2, RTP_aux_float_3, RTP_depth, RTP_COUNT } |
This is a special DisplayRegion wrapper that actually includes a pair of DisplayRegions internally: the left and right eyes.
The DisplayRegion represented here does not have a physical association with the window, but it pretends it does. Instead, it maintains a pointer to the left and right DisplayRegions separately.
Operations on the StereoDisplayRegion object affect both left and right eyes together. To access the left or right eyes independently, use get_left_eye() and get_right_eye().
Definition at line 32 of file stereoDisplayRegion.h.
|
virtual |
Disables both the color and depth clear.
See set_clear_color_active and set_clear_depth_active.
Reimplemented from DrawableRegion.
Definition at line 75 of file stereoDisplayRegion.cxx.
References DrawableRegion::disable_clears().
|
virtual |
Returns true if this is a StereoDisplayRegion, false otherwise.
Reimplemented from DisplayRegion.
Definition at line 105 of file stereoDisplayRegion.cxx.
|
virtual |
Sets the active flag on both the left and right DisplayRegions to the indicated value.
Reimplemented from DisplayRegion.
Definition at line 124 of file stereoDisplayRegion.cxx.
References DisplayRegion::get_stereo_channel, DisplayRegion::set_active, and set_stereo_channel().
|
virtual |
Sets both the left and right DisplayRegions to the indicated camera.
Reimplemented from DisplayRegion.
Definition at line 113 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_camera.
|
virtual |
Sets the clear-active flag for any bitplane.
Reimplemented from DrawableRegion.
Definition at line 47 of file stereoDisplayRegion.cxx.
References DrawableRegion::set_clear_active().
|
virtual |
Sets the clear value for any bitplane.
Reimplemented from DrawableRegion.
Definition at line 64 of file stereoDisplayRegion.cxx.
References DrawableRegion::set_clear_value().
|
virtual |
Sets the CullTraverser for both the left and right DisplayRegions.
Reimplemented from DisplayRegion.
Definition at line 244 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_cull_traverser.
|
virtual |
Sets both the left and right DisplayRegions to the indicated dimensions.
Reimplemented from DisplayRegion.
Definition at line 95 of file stereoDisplayRegion.cxx.
|
virtual |
Sets the incomplete_render flag on both the left and right DisplayRegions to the indicated value.
Reimplemented from DisplayRegion.
Definition at line 223 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_incomplete_render.
|
virtual |
Sets the pixel_zoom for left and right eyes.
Reimplemented from DrawableRegion.
Definition at line 85 of file stereoDisplayRegion.cxx.
|
virtual |
Sets the indicated sort value on the overall DisplayRegion, the indicated sort value + 1 on the left eye, and the indicated sort value + 2 on the right eye.
Reimplemented from DisplayRegion.
Definition at line 140 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_sort.
|
virtual |
Sets the stereo channels on the left and right eyes, and also sets the active flags independently on both eyes.
For a StereoDisplayRegion, a different action is performed for each different value:
SC_stereo - the left eye is set to SC_left, the right eye to SC_right, and both eyes are activated.
SC_left - the left eye is set to SC_left and activated; the right eye is deactivated.
SC_right - the right eye is set to SC_right and activated; the left eye is deactivated.
SC_mono - the left eye is set to SC_mono and activated; the right eye is deactivated.
This call also resets tex_view_offset to its default value, which is 0 for the left eye or 1 for the right eye of a stereo display region, or 0 for a mono display region.
Reimplemented from DisplayRegion.
Definition at line 168 of file stereoDisplayRegion.cxx.
References DisplayRegion::is_active, and DisplayRegion::set_stereo_channel.
Referenced by set_active().
|
virtual |
Sets the page and view on both the left and right DisplayRegions to the indicated value.
Reimplemented from DisplayRegion.
Definition at line 255 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_target_tex_page.
|
virtual |
Sets the current texture view offset for this DisplayRegion.
This is normally set to zero. If nonzero, it is used to select a particular view of any multiview textures that are rendered within this DisplayRegion.
When you call this on a StereoDisplayRegion, it automatically sets the specified value on the left eye, and the specified value + 1 on the right eye.
Reimplemented from DisplayRegion.
Definition at line 212 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_tex_view_offset.
|
virtual |
Sets the texture_reload_priority on both the left and right DisplayRegions to the indicated value.
Reimplemented from DisplayRegion.
Definition at line 234 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_texture_reload_priority.
|
inline |
Returns a pointer to the left DisplayRegion managed by this stereo object.
Definition at line 66 of file stereoDisplayRegion.h.
Referenced by GraphicsOutput::make_mono_display_region().
|
inline |
Returns a pointer to the right DisplayRegion managed by this stereo object.
Definition at line 67 of file stereoDisplayRegion.h.
Referenced by GraphicsOutput::make_mono_display_region().