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 () |
Returns a pointer to the left DisplayRegion managed by this stereo object. More... | |
DisplayRegion * | get_right_eye () |
Returns a pointer to the right DisplayRegion managed by this stereo object. More... | |
virtual TypeHandle | get_type () const |
virtual bool | is_stereo () const |
Returns true if this is a StereoDisplayRegion, false otherwise. More... | |
virtual void | output (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... | |
![]() | |
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 |
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More... | |
CallbackObject * | get_cull_callback () const |
Returns the CallbackObject set by set_cull_callback(). More... | |
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 () |
Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More... | |
void | get_dimensions (PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More... | |
void | get_dimensions (int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More... | |
LVecBase4 | get_dimensions (int i=0) const |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More... | |
CallbackObject * | get_draw_callback () const |
Returns the CallbackObject set by set_draw_callback(). More... | |
PStatCollector & | get_draw_region_pcollector () |
Returns a PStatCollector for timing the draw operation for just this DisplayRegion. More... | |
bool | get_incomplete_render () const |
Returns the incomplete_render flag. More... | |
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 |
Returns the specific lens of the associated Camera that will be used for rendering this scene. More... | |
int | get_num_regions () const |
Returns the number of regions, see set_num_regions. More... | |
GraphicsPipe * | get_pipe () const |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More... | |
int | get_pixel_height (int i=0) const |
Returns the height of the DisplayRegion in pixels. More... | |
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 |
Returns whether or not scissor testing is enabled for this region. More... | |
bool | get_screenshot (PNMImage &image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More... | |
int | get_sort () const |
Returns the sort value associated with the DisplayRegion. More... | |
Lens::StereoChannel | get_stereo_channel () const |
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... | |
int | get_target_tex_page () const |
Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More... | |
int | get_tex_view_offset () const |
Returns the current texture view offset for this DisplayRegion. More... | |
int | get_texture_reload_priority () const |
Returns the priority which is assigned to asynchronous texture reload requests. More... | |
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 |
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More... | |
bool | is_active () const |
Returns the active flag associated with the DisplayRegion. More... | |
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 string &image_comment="") |
Saves a screenshot of the region to the indicated filename. More... | |
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. More... | |
void | set_cube_map_index (int cube_map_index) |
Deprecated; replaced by set_target_tex_page(). More... | |
void | set_cull_callback (CallbackObject *object) |
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. More... | |
void | set_cull_result (CullResult *cull_result, 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) |
Changes the portion of the framebuffer this DisplayRegion corresponds to. More... | |
void | set_dimensions (int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
Changes the portion of the framebuffer this DisplayRegion corresponds to. More... | |
void | set_dimensions (const LVecBase4 &dimensions) |
Changes the portion of the framebuffer this DisplayRegion corresponds to. More... | |
void | set_draw_callback (CallbackObject *object) |
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. More... | |
void | set_lens_index (int index) |
Sets the lens index, allows for multiple lenses to be attached to a camera. More... | |
void | set_num_regions (int i) |
Sets the number of regions that this DisplayRegion indicates. More... | |
void | set_scissor_enabled (bool scissor_enabled) |
Sets whether or not scissor testing is enabled for this region. More... | |
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... | |
![]() | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
![]() | |
TypedObject (const TypedObject ©) | |
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... | |
void | operator= (const TypedObject ©) |
![]() | |
int | get_ref_count () const |
Returns the current reference count. More... | |
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 | 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... | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
![]() | |
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 |
Returns the current clear color value. More... | |
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 |
Returns the current clear depth value. More... | |
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 |
Returns the current clear stencil value. More... | |
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 |
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... | |
PN_stdfloat | get_pixel_zoom () const |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More... | |
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) |
Sets the clear color to the indicated value. More... | |
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) |
Sets the clear depth to the indicated value. More... | |
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) |
Sets the clear stencil to the indicated value. More... | |
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 TypeHandle | get_class_type () |
static void | init_type () |
static Filename | make_screenshot_filename (const string &prefix="screenshot") |
Synthesizes a suitable default filename for passing to save_screenshot(). More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
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 TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static int | get_renderbuffer_type (int plane) |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More... | |
Friends | |
class | DisplayRegionPipelineReader |
class | GraphicsOutput |
Additional Inherited Members | |
![]() | |
typedef epvector< Region > | Regions |
![]() | |
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 37 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 87 of file stereoDisplayRegion.cxx.
References DrawableRegion::disable_clears().
|
inline |
Returns a pointer to the left DisplayRegion managed by this stereo object.
Definition at line 23 of file stereoDisplayRegion.I.
Referenced by GraphicsOutput::make_mono_display_region(), and GraphicsOutput::remove_display_region().
|
inline |
Returns a pointer to the right DisplayRegion managed by this stereo object.
Definition at line 34 of file stereoDisplayRegion.I.
Referenced by GraphicsOutput::make_mono_display_region(), and GraphicsOutput::remove_display_region().
|
virtual |
Returns true if this is a StereoDisplayRegion, false otherwise.
Reimplemented from DisplayRegion.
Definition at line 125 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 149 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 136 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_camera().
|
virtual |
Sets the clear-active flag for any bitplane.
Reimplemented from DrawableRegion.
Definition at line 54 of file stereoDisplayRegion.cxx.
References DrawableRegion::set_clear_active().
|
virtual |
Sets the clear value for any bitplane.
Reimplemented from DrawableRegion.
Definition at line 74 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 288 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 112 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_dimensions().
|
virtual |
Sets the incomplete_render flag on both the left and right DisplayRegions to the indicated value.
Reimplemented from DisplayRegion.
Definition at line 262 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 99 of file stereoDisplayRegion.cxx.
References DrawableRegion::set_pixel_zoom().
|
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 169 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 201 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 301 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 249 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 275 of file stereoDisplayRegion.cxx.
References DisplayRegion::set_texture_reload_priority().