Panda3D
|
A rectangular subregion within a window for rendering into. More...
#include "displayRegion.h"
Classes | |
class | CData |
class | CDataCull |
Public Types | |
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 } |
Public Member Functions | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. | |
void | cleanup () |
Cleans up some pointers associated with the DisplayRegion to help reduce the chance of memory leaks due to circular reference counts. | |
void | clear_cull_callback () |
Removes the callback set by an earlier call to set_cull_callback(). | |
void | clear_draw_callback () |
Removes the callback set by an earlier call to set_draw_callback(). | |
void | compute_pixels () |
Computes the pixel locations of the DisplayRegion within its window. | |
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. | |
void | compute_pixels_all_stages () |
Computes the pixel locations of the DisplayRegion within its window. | |
void | compute_pixels_all_stages (int x_size, int y_size) |
Performs a compute_pixels() operation for all stages of the pipeline. | |
void | copy_clear_settings (const DrawableRegion ©) |
Copies only the clear settings from the other drawable region. | |
virtual void | disable_clears () |
Disables both the color and depth clear. | |
virtual TypeHandle | force_init_type () |
int | get_best_parent_from_Set (const std::set< int > &) const |
float | get_bottom () const |
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. | |
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. | |
virtual bool | get_clear_active (int n) const |
Gets the clear-active flag for any bitplane. | |
const Colorf & | get_clear_color () const |
Returns the current clear color value. | |
bool | get_clear_color_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. | |
float | get_clear_depth () const |
Returns the current clear depth value. | |
bool | get_clear_depth_active () const |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. | |
unsigned int | get_clear_stencil () const |
Returns the current clear stencil value. | |
bool | get_clear_stencil_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. | |
virtual const Colorf & | get_clear_value (int n) const |
Returns the clear value for any bitplane. | |
int | get_cube_map_index () const |
Returns the cube map face index associated with this particular DisplayRegion, or -1 if it is not associated with a cube map. | |
CallbackObject * | get_cull_callback () const |
Returns the CallbackObject set by set_cull_callback(). | |
PStatCollector & | get_cull_region_pcollector () |
Returns a PStatCollector for timing the cull operation for just this DisplayRegion. | |
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. | |
CullTraverser * | get_cull_traverser () |
Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. | |
void | get_dimensions (float &l, float &r, float &b, float &t) const |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. | |
int | get_draw_buffer_type () const |
Returns the RenderBuffer into which the GSG should issue draw commands. | |
CallbackObject * | get_draw_callback () const |
Returns the CallbackObject set by set_draw_callback(). | |
PStatCollector & | get_draw_region_pcollector () |
Returns a PStatCollector for timing the draw operation for just this DisplayRegion. | |
bool | get_incomplete_render () const |
Returns the incomplete_render flag. | |
float | get_left () const |
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. | |
int | get_lens_index () const |
Returns the specific lens of the associated Camera that will be used for rendering this scene. | |
GraphicsPipe * | get_pipe () const |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. | |
float | 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(). | |
int | get_pixel_height () const |
Returns the height of the DisplayRegion in pixels. | |
int | get_pixel_width () const |
Returns the width of the DisplayRegion in pixels. | |
float | get_pixel_zoom () const |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. | |
void | get_pixels (int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its window, in pixels. | |
int | get_ref_count () const |
Returns the current reference count. | |
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. | |
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. | |
float | get_right () const |
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. | |
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. | |
bool | get_screenshot (PNMImage &image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. | |
int | get_screenshot_buffer_type () const |
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion. | |
int | get_sort () const |
Returns the sort value associated with the DisplayRegion. | |
Lens::StereoChannel | 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. | |
int | get_texture_reload_priority () const |
Returns the priority which is assigned to asynchronous texture reload requests. | |
float | get_top () const |
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. | |
virtual TypeHandle | get_type () const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. | |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. | |
GraphicsOutput * | get_window () const |
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. | |
bool | is_active () const |
Returns the active flag associated with the DisplayRegion. | |
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. | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. | |
virtual bool | is_stereo () const |
Returns true if this is a StereoDisplayRegion, false otherwise. | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *, void *) |
void | operator delete[] (void *, void *) |
void * | operator new (size_t size) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size, void *ptr) |
void * | operator new (size_t size) |
void * | operator new[] (size_t size) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size, void *ptr) |
void * | operator new[] (size_t size) |
bool | operator< (const DisplayRegion &other) const |
Returns true if this DisplayRegion should be sorted before the other one, false otherwise. | |
virtual void | output (ostream &out) const |
virtual | PT (PandaNode) make_cull_result_graph() |
void | ref () const |
Explicitly increments the reference count. | |
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 | set_active (bool active) |
Sets the active flag associated with the DisplayRegion. | |
virtual void | set_camera (const NodePath &camera) |
Sets the camera that is associated with this DisplayRegion. | |
virtual void | set_clear_active (int n, bool clear_aux_active) |
Sets the clear-active flag for any bitplane. | |
void | set_clear_color (const Colorf &color) |
Sets the clear color to the indicated value. | |
void | set_clear_color_active (bool clear_color_active) |
Toggles the flag that indicates whether the color buffer should be cleared every frame. | |
void | set_clear_depth (float depth) |
Sets the clear depth to the indicated value. | |
void | set_clear_depth_active (bool clear_depth_active) |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. | |
void | set_clear_stencil (unsigned int stencil) |
Sets the clear stencil to the indicated value. | |
void | set_clear_stencil_active (bool clear_stencil_active) |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame. | |
virtual void | set_clear_value (int n, const Colorf &clear_value) |
Sets the clear value for any bitplane. | |
virtual void | set_cube_map_index (int cube_map_index) |
This is a special parameter that is only used when rendering the faces of a cube map. | |
void | set_cull_callback (CallbackObject *object) |
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. | |
void | set_cull_result (CullResult *cull_result, SceneSetup *scene_setup, Thread *current_thread) |
Stores the result of performing a cull operation on this DisplayRegion. | |
virtual void | set_cull_traverser (CullTraverser *trav) |
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. | |
virtual void | set_dimensions (float l, float r, float b, float t) |
Changes the portion of the framebuffer this DisplayRegion corresponds to. | |
void | set_draw_callback (CallbackObject *object) |
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. | |
virtual void | set_incomplete_render (bool incomplete_render) |
Sets the incomplete_render flag. | |
void | set_lens_index (int index) |
Sets the lens index, allows for multiple lenses to be attached to a camera. | |
virtual void | set_pixel_zoom (float pixel_zoom) |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally. | |
virtual void | set_sort (int sort) |
Sets the sort value associated with the DisplayRegion. | |
virtual void | set_stereo_channel (Lens::StereoChannel stereo_channel) |
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. | |
virtual void | set_texture_reload_priority (int texture_reload_priority) |
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. | |
virtual bool | supports_pixel_zoom () const |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. | |
virtual bool | unref () const |
Explicitly decrements the reference count. | |
void | weak_ref (WeakPointerToVoid *ptv) |
Adds the indicated PointerToVoid as a weak reference to this object. | |
void | weak_unref (WeakPointerToVoid *ptv) |
Removes the indicated PointerToVoid as a weak reference to this object. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static int | get_renderbuffer_type (int plane) |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. | |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
static Filename | make_screenshot_filename (const string &prefix="screenshot") |
Synthesizes a suitable default filename for passing to save_screenshot(). | |
Protected Member Functions | |
DisplayRegion (GraphicsOutput *window, float l, float r, float b, float t) | |
bool | do_test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
bool | do_test_ref_count_nonzero () const |
Returns true if the reference count is nonzero, false otherwise. | |
virtual void | pixel_factor_changed () |
Called internally when the pixel factor changes. | |
PT (CullTraverser) _trav | |
void | update_pixel_factor () |
Internal function to reset pixel_factor after it may have changed. | |
Protected Attributes | |
int | _draw_buffer_type |
bool | _incomplete_render |
int | _screenshot_buffer_type |
int | _texture_reload_priority |
GraphicsOutput * | _window |
Friends | |
class | DisplayRegionPipelineReader |
class | GraphicsOutput |
A rectangular subregion within a window for rendering into.
Typically, there is one DisplayRegion that covers the whole window, but you may also create smaller DisplayRegions for having different regions within the window that represent different scenes. You may also stack up DisplayRegions like panes of glass, usually for layering 2-d interfaces on top of a 3-d scene.
Definition at line 59 of file displayRegion.h.
TypedObject * TypedObject::as_typed_object | ( | ) | [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 99 of file typedObject.I.
const TypedObject * TypedObject::as_typed_object | ( | ) | const [inline, inherited] |
Returns the object, upcast (if necessary) to a TypedObject pointer.
Definition at line 110 of file typedObject.I.
void DisplayRegion::cleanup | ( | ) |
Cleans up some pointers associated with the DisplayRegion to help reduce the chance of memory leaks due to circular reference counts.
Definition at line 94 of file displayRegion.cxx.
References set_camera().
Referenced by GraphicsOutput::remove_all_display_regions().
void DisplayRegion::clear_cull_callback | ( | ) | [inline] |
Removes the callback set by an earlier call to set_cull_callback().
Definition at line 251 of file displayRegion.I.
References set_cull_callback().
void DisplayRegion::clear_draw_callback | ( | ) | [inline] |
Removes the callback set by an earlier call to set_draw_callback().
Definition at line 313 of file displayRegion.I.
References set_draw_callback().
void DisplayRegion::compute_pixels | ( | ) |
Computes the pixel locations of the DisplayRegion within its window.
The DisplayRegion will request the size from the window.
Definition at line 583 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage(), GraphicsOutput::get_fb_x_size(), and GraphicsOutput::get_fb_y_size().
void DisplayRegion::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.
Definition at line 624 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage().
void DisplayRegion::compute_pixels_all_stages | ( | ) |
Computes the pixel locations of the DisplayRegion within its window.
The DisplayRegion will request the size from the window.
Definition at line 602 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage(), GraphicsOutput::get_fb_x_size(), and GraphicsOutput::get_fb_y_size().
void DisplayRegion::compute_pixels_all_stages | ( | int | x_size, |
int | y_size | ||
) |
Performs a compute_pixels() operation for all stages of the pipeline.
This is appropriate, for instance, when a window changes sizes, since this is a global operation; and you want the new window size to be immediately available even to the downstream stages.
Definition at line 641 of file displayRegion.cxx.
void DrawableRegion::copy_clear_settings | ( | const DrawableRegion & | copy | ) | [inline, inherited] |
Copies only the clear settings from the other drawable region.
Definition at line 77 of file drawableRegion.I.
References DrawableRegion::update_pixel_factor().
Referenced by GraphicsOutput::make_cube_map().
void DrawableRegion::disable_clears | ( | ) | [virtual, inherited] |
Disables both the color and depth clear.
See set_clear_color_active and set_clear_depth_active.
Reimplemented in StereoDisplayRegion.
Definition at line 80 of file drawableRegion.cxx.
References DrawableRegion::update_pixel_factor().
bool ReferenceCount::do_test_ref_count_integrity | ( | ) | const [protected, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 29 of file referenceCount.cxx.
Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().
bool ReferenceCount::do_test_ref_count_nonzero | ( | ) | const [protected, inherited] |
Returns true if the reference count is nonzero, false otherwise.
Definition at line 56 of file referenceCount.cxx.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by ReferenceCount::test_ref_count_nonzero().
float DisplayRegion::get_bottom | ( | ) | const [inline] |
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput.
This number will be in the range [0..1].
Definition at line 91 of file displayRegion.I.
NodePath DisplayRegion::get_camera | ( | Thread * | current_thread = Thread::get_current_thread() | ) | const [inline] |
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated.
Definition at line 129 of file displayRegion.I.
Referenced by NonlinearImager::add_viewer(), and GraphicsEngine::render_frame().
bool DrawableRegion::get_clear_active | ( | int | n | ) | const [virtual, inherited] |
Gets the clear-active flag for any bitplane.
Definition at line 45 of file drawableRegion.cxx.
Referenced by DrawableRegion::get_clear_color_active(), DrawableRegion::get_clear_depth_active(), DrawableRegion::get_clear_stencil_active(), and DrawableRegion::is_any_clear_active().
const Colorf & DrawableRegion::get_clear_color | ( | ) | const [inline, inherited] |
Returns the current clear color value.
This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.
Definition at line 187 of file drawableRegion.I.
References DrawableRegion::get_clear_value().
bool DrawableRegion::get_clear_color_active | ( | ) | const [inline, inherited] |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.
Definition at line 107 of file drawableRegion.I.
References DrawableRegion::get_clear_active().
Referenced by supports_pixel_zoom().
float DrawableRegion::get_clear_depth | ( | ) | const [inline, inherited] |
Returns the current clear depth value.
This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.
Definition at line 215 of file drawableRegion.I.
References DrawableRegion::get_clear_value().
bool DrawableRegion::get_clear_depth_active | ( | ) | const [inline, inherited] |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame.
Definition at line 133 of file drawableRegion.I.
References DrawableRegion::get_clear_active().
Referenced by supports_pixel_zoom().
unsigned int DrawableRegion::get_clear_stencil | ( | ) | const [inline, inherited] |
Returns the current clear stencil value.
This is the value that will be used to clear the stencil buffer every frame, but only if get_clear_stencil_active() returns true. If get_clear_stencil_active() returns false, this is meaningless.
Definition at line 242 of file drawableRegion.I.
References DrawableRegion::get_clear_value().
bool DrawableRegion::get_clear_stencil_active | ( | ) | const [inline, inherited] |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame.
See set_clear_stencil_active().
Definition at line 159 of file drawableRegion.I.
References DrawableRegion::get_clear_active().
const Colorf & DrawableRegion::get_clear_value | ( | int | n | ) | const [virtual, inherited] |
Returns the clear value for any bitplane.
Definition at line 67 of file drawableRegion.cxx.
Referenced by DrawableRegion::get_clear_color(), DrawableRegion::get_clear_depth(), and DrawableRegion::get_clear_stencil().
int DisplayRegion::get_cube_map_index | ( | ) | const [inline] |
Returns the cube map face index associated with this particular DisplayRegion, or -1 if it is not associated with a cube map.
See set_cube_map_index().
Definition at line 204 of file displayRegion.I.
CallbackObject * DisplayRegion::get_cull_callback | ( | ) | const [inline] |
Returns the CallbackObject set by set_cull_callback().
Definition at line 261 of file displayRegion.I.
PStatCollector & DisplayRegion::get_cull_region_pcollector | ( | ) | [inline] |
Returns a PStatCollector for timing the cull operation for just this DisplayRegion.
Definition at line 454 of file displayRegion.I.
Referenced by GraphicsEngine::do_cull().
CullResult * DisplayRegion::get_cull_result | ( | Thread * | current_thread | ) | const [inline] |
Returns the CullResult value that was stored on this DisplayRegion, presumably by the last successful cull operation.
This method is for the benefit of the GraphicsEngine; normally you shouldn't call this directly.
Definition at line 427 of file displayRegion.I.
CullTraverser * DisplayRegion::get_cull_traverser | ( | ) |
Returns the CullTraverser that will be used to draw the contents of this DisplayRegion.
Definition at line 351 of file displayRegion.cxx.
Referenced by GraphicsEngine::do_cull().
void DisplayRegion::get_dimensions | ( | float & | l, |
float & | r, | ||
float & | b, | ||
float & | t | ||
) | const [inline] |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput.
These numbers will be in the range [0..1].
Definition at line 49 of file displayRegion.I.
int DrawableRegion::get_draw_buffer_type | ( | ) | const [inline, inherited] |
Returns the RenderBuffer into which the GSG should issue draw commands.
Normally, this is the back buffer for double-buffered windows, and the front buffer for single-buffered windows.
Definition at line 295 of file drawableRegion.I.
Referenced by GraphicsOutput::change_scenes(), and GraphicsOutput::copy_to_textures().
CallbackObject * DisplayRegion::get_draw_callback | ( | ) | const [inline] |
Returns the CallbackObject set by set_draw_callback().
Definition at line 323 of file displayRegion.I.
PStatCollector & DisplayRegion::get_draw_region_pcollector | ( | ) | [inline] |
Returns a PStatCollector for timing the draw operation for just this DisplayRegion.
Definition at line 465 of file displayRegion.I.
bool DisplayRegion::get_incomplete_render | ( | ) | const [inline] |
Returns the incomplete_render flag.
Definition at line 179 of file displayRegion.I.
Referenced by GraphicsEngine::do_cull().
float DisplayRegion::get_left | ( | ) | const [inline] |
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.
This number will be in the range [0..1].
Definition at line 65 of file displayRegion.I.
int DisplayRegion::get_lens_index | ( | ) | const [inline] |
Returns the specific lens of the associated Camera that will be used for rendering this scene.
Most Cameras hold only one lens, but for multiple lenses this method may be used to selected between them.
Definition at line 36 of file displayRegion.I.
GraphicsPipe * DisplayRegion::get_pipe | ( | ) | const |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated.
Definition at line 150 of file displayRegion.cxx.
References GraphicsOutput::get_pipe().
float DrawableRegion::get_pixel_factor | ( | ) | const [inline, inherited] |
Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom().
This will return 1.0 if the pixel_zoom was not set or if it is not being respected (for instance, because the underlying renderer doesn't support it--see supports_pixel_zoom).
Definition at line 270 of file drawableRegion.I.
Referenced by GraphicsOutput::get_fb_x_size(), and GraphicsOutput::get_fb_y_size().
int DisplayRegion::get_pixel_height | ( | ) | const [inline] |
Returns the height of the DisplayRegion in pixels.
Definition at line 345 of file displayRegion.I.
int DisplayRegion::get_pixel_width | ( | ) | const [inline] |
Returns the width of the DisplayRegion in pixels.
Definition at line 334 of file displayRegion.I.
float DrawableRegion::get_pixel_zoom | ( | ) | const [inline, inherited] |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not.
Also see get_pixel_factor().
Definition at line 254 of file drawableRegion.I.
void DisplayRegion::get_pixels | ( | int & | pl, |
int & | pr, | ||
int & | pb, | ||
int & | pt | ||
) | const [inline] |
Retrieves the coordinates of the DisplayRegion within its window, in pixels.
Definition at line 357 of file displayRegion.I.
int ReferenceCount::get_ref_count | ( | ) | const [inline, inherited] |
Returns the current reference count.
Definition at line 155 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by TransformState::clear_cache(), RenderState::clear_cache(), RenderState::finalize(), RenderEffects::finalize(), RenderEffect::finalize(), RenderAttrib::finalize(), InternalName::finalize(), TransformState::get_num_unused_states(), RenderState::get_num_unused_states(), TransformState::list_cycles(), RenderState::list_cycles(), GeomVertexFormat::remove_column(), TransformState::unref(), RenderState::unref(), RenderState::~RenderState(), and TransformState::~TransformState().
void DisplayRegion::get_region_pixels | ( | int & | xo, |
int & | yo, | ||
int & | w, | ||
int & | h | ||
) | const [inline] |
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.
Definition at line 373 of file displayRegion.I.
void DisplayRegion::get_region_pixels_i | ( | int & | xo, |
int & | yo, | ||
int & | w, | ||
int & | h | ||
) | const [inline] |
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.
Definition at line 390 of file displayRegion.I.
Referenced by DXGraphicsStateGuardian8::do_framebuffer_copy_to_ram(), DXGraphicsStateGuardian9::do_framebuffer_copy_to_ram(), TinyGraphicsStateGuardian::framebuffer_copy_to_ram(), TinyGraphicsStateGuardian::framebuffer_copy_to_texture(), DXGraphicsStateGuardian9::framebuffer_copy_to_texture(), and DXGraphicsStateGuardian8::framebuffer_copy_to_texture().
int DrawableRegion::get_renderbuffer_type | ( | int | plane | ) | [static, inherited] |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane.
Definition at line 163 of file drawableRegion.cxx.
Referenced by GraphicsOutput::copy_to_textures().
float DisplayRegion::get_right | ( | ) | const [inline] |
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput.
This number will be in the range [0..1].
Definition at line 78 of file displayRegion.I.
SceneSetup * DisplayRegion::get_scene_setup | ( | Thread * | current_thread | ) | const [inline] |
Returns the SceneSetup value that was stored on this DisplayRegion, presumably by the last successful cull operation.
This method is for the benefit of the GraphicsEngine; normally you shouldn't call this directly.
Definition at line 442 of file displayRegion.I.
bool DisplayRegion::get_screenshot | ( | PNMImage & | image | ) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage.
Returns true on success, false on failure.
Definition at line 514 of file displayRegion.cxx.
References GraphicsOutput::begin_frame(), GraphicsOutput::end_frame(), GraphicsStateGuardian::framebuffer_copy_to_ram(), Thread::get_current_thread(), GraphicsOutput::get_fb_properties(), GraphicsOutput::get_gsg(), GraphicsStateGuardian::get_render_buffer(), DrawableRegion::get_screenshot_buffer_type(), and get_window().
Referenced by save_screenshot().
int DrawableRegion::get_screenshot_buffer_type | ( | ) | const [inline, inherited] |
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion.
Definition at line 282 of file drawableRegion.I.
Referenced by get_screenshot().
int DisplayRegion::get_sort | ( | ) | const [inline] |
Returns the sort value associated with the DisplayRegion.
Definition at line 153 of file displayRegion.I.
Referenced by operator<().
Lens::StereoChannel DisplayRegion::get_stereo_channel | ( | ) | [inline] |
Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair, or whether it is a normal, monocular image.
See set_stereo_channel().
Definition at line 167 of file displayRegion.I.
Referenced by StereoDisplayRegion::set_active().
int DisplayRegion::get_texture_reload_priority | ( | ) | const [inline] |
Returns the priority which is assigned to asynchronous texture reload requests.
See set_texture_reload_priority().
Definition at line 191 of file displayRegion.I.
float DisplayRegion::get_top | ( | ) | const [inline] |
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput.
This number will be in the range [0..1].
Definition at line 104 of file displayRegion.I.
int TypedObject::get_type_index | ( | ) | const [inline, inherited] |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
This is equivalent to get_type().get_index().
Definition at line 52 of file typedObject.I.
References TypeHandle::get_index().
WeakReferenceList * ReferenceCount::get_weak_list | ( | ) | const [inline, inherited] |
Returns the WeakReferenceList associated with this ReferenceCount object.
If there has never been a WeakReferenceList associated with this object, creates one now.
Definition at line 307 of file referenceCount.I.
Referenced by ReferenceCount::weak_ref().
GraphicsOutput * DisplayRegion::get_window | ( | ) | const [inline] |
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated.
Definition at line 117 of file displayRegion.I.
Referenced by NonlinearImager::add_viewer(), get_screenshot(), WindowFramework::split_window(), DisplayRegionDrawCallbackData::upcall(), and DisplayRegionCullCallbackData::upcall().
bool ReferenceCount::has_weak_list | ( | ) | const [inline, inherited] |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).
Definition at line 294 of file referenceCount.I.
Referenced by ReferenceCount::weak_unref().
static void DisplayRegion::init_type | ( | ) | [inline, static] |
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from DisplayRegionBase.
Reimplemented in StereoDisplayRegion.
Definition at line 248 of file displayRegion.h.
References DisplayRegionBase::init_type().
Referenced by StereoDisplayRegion::init_type().
bool DisplayRegion::is_active | ( | ) | const [inline] |
Returns the active flag associated with the DisplayRegion.
Definition at line 141 of file displayRegion.I.
Referenced by StereoDisplayRegion::set_stereo_channel().
bool DrawableRegion::is_any_clear_active | ( | ) | const [virtual, inherited] |
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.
Definition at line 96 of file drawableRegion.cxx.
References DrawableRegion::get_clear_active().
Referenced by GraphicsOutput::clear().
bool TypedObject::is_exact_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is the indicated type exactly.
Definition at line 74 of file typedObject.I.
References TypeHandle::get_name().
Referenced by GraphicsStateGuardian::async_reload_texture(), PortalNode::combine_with(), PandaNode::combine_with(), GeomNode::combine_with(), CollisionNode::combine_with(), Character::combine_with(), PGItem::cull_callback(), FactoryParams::get_param_of_type(), CollisionHandlerPusher::handle_entries(), SceneGraphReducer::r_flatten(), ConnectionWriter::send(), FltToEggLevelState::set_transform(), and VirtualFileSystem::unmount().
bool TypedObject::is_of_type | ( | TypeHandle | handle | ) | const [inline, inherited] |
Returns true if the current object is or derives from the indicated type.
Definition at line 63 of file typedObject.I.
References TypeHandle::is_derived_from().
Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().
bool DisplayRegion::is_stereo | ( | ) | const [virtual] |
Returns true if this is a StereoDisplayRegion, false otherwise.
Reimplemented in StereoDisplayRegion.
Definition at line 161 of file displayRegion.cxx.
Referenced by GraphicsOutput::remove_display_region(), set_stereo_channel(), and DisplayRegionDrawCallbackData::upcall().
void ReferenceCount::local_object | ( | ) | [inline, inherited] |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.
Definition at line 276 of file referenceCount.I.
Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().
Filename DisplayRegion::make_screenshot_filename | ( | const string & | prefix = "screenshot" | ) | [static] |
Synthesizes a suitable default filename for passing to save_screenshot().
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 408 of file displayRegion.cxx.
References ClockObject::get_frame_count(), and ClockObject::get_global_clock().
Referenced by save_screenshot_default().
bool DisplayRegion::operator< | ( | const DisplayRegion & | other | ) | const [inline] |
Returns true if this DisplayRegion should be sorted before the other one, false otherwise.
Definition at line 23 of file displayRegion.I.
References get_sort().
void DrawableRegion::pixel_factor_changed | ( | ) | [protected, virtual, inherited] |
Called internally when the pixel factor changes.
Reimplemented in GraphicsOutput.
Definition at line 193 of file drawableRegion.cxx.
Referenced by DrawableRegion::update_pixel_factor().
void ReferenceCount::ref | ( | ) | const [inline, inherited] |
Explicitly increments the reference count.
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
Definition at line 179 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().
bool DisplayRegion::save_screenshot | ( | const Filename & | filename, |
const string & | image_comment = "" |
||
) |
Saves a screenshot of the region to the indicated filename.
Returns true on success, false on failure.
Definition at line 493 of file displayRegion.cxx.
References get_screenshot(), PNMImageHeader::set_comment(), and PNMImage::write().
Referenced by save_screenshot_default().
Filename DisplayRegion::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.
The filename is generated by make_screenshot_filename().
Definition at line 478 of file displayRegion.cxx.
References make_screenshot_filename(), and save_screenshot().
void DisplayRegion::set_active | ( | bool | active | ) | [virtual] |
Sets the active flag associated with the DisplayRegion.
If the DisplayRegion is marked inactive, nothing is rendered.
Reimplemented in StereoDisplayRegion.
Definition at line 215 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage().
void DisplayRegion::set_camera | ( | const NodePath & | camera | ) | [virtual] |
Sets the camera that is associated with this DisplayRegion.
There is a one-to-many association between cameras and DisplayRegions; one camera may be shared by multiple DisplayRegions.
The camera is actually set via a NodePath, which clarifies which instance of the camera (if there happen to be multiple instances) we should use.
Reimplemented in StereoDisplayRegion.
Definition at line 178 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage(), NodePath::is_empty(), and NodePath::node().
Referenced by cleanup(), MultitexReducer::flatten(), and GraphicsOutput::make_cube_map().
void DrawableRegion::set_clear_active | ( | int | n, |
bool | clear_aux_active | ||
) | [virtual, inherited] |
Sets the clear-active flag for any bitplane.
Reimplemented in StereoDisplayRegion.
Definition at line 33 of file drawableRegion.cxx.
References DrawableRegion::update_pixel_factor().
Referenced by DrawableRegion::set_clear_color_active(), DrawableRegion::set_clear_depth_active(), and DrawableRegion::set_clear_stencil_active().
void DrawableRegion::set_clear_color | ( | const Colorf & | color | ) | [inline, inherited] |
Sets the clear color to the indicated value.
This is the value that will be used to clear the color buffer every frame, but only if get_clear_color_active() returns true. If get_clear_color_active() returns false, this is meaningless.
Definition at line 173 of file drawableRegion.I.
References DrawableRegion::set_clear_value().
Referenced by GraphicsOutput::GraphicsOutput().
void DrawableRegion::set_clear_color_active | ( | bool | clear_color_active | ) | [inline, inherited] |
Toggles the flag that indicates whether the color buffer should be cleared every frame.
If this is true, the color buffer will be cleared to the color indicated by set_clear_color(); otherwise, it will be left alone.
Definition at line 95 of file drawableRegion.I.
References DrawableRegion::set_clear_active().
Referenced by GraphicsOutput::GraphicsOutput(), GraphicsOutput::make_cube_map(), and WindowFramework::open_window().
void DrawableRegion::set_clear_depth | ( | float | depth | ) | [inline, inherited] |
Sets the clear depth to the indicated value.
This is the value that will be used to clear the depth buffer every frame, but only if get_clear_depth_active() returns true. If get_clear_depth_active() returns false, this is meaningless.
Definition at line 201 of file drawableRegion.I.
References DrawableRegion::set_clear_value().
void DrawableRegion::set_clear_depth_active | ( | bool | clear_depth_active | ) | [inline, inherited] |
Toggles the flag that indicates whether the depth buffer should be cleared every frame.
If this is true, the depth buffer will be cleared to the depth value indicated by set_clear_depth(); otherwise, it will be left alone.
Definition at line 121 of file drawableRegion.I.
References DrawableRegion::set_clear_active().
Referenced by GraphicsOutput::GraphicsOutput(), and GraphicsOutput::make_cube_map().
void DrawableRegion::set_clear_stencil | ( | unsigned int | stencil | ) | [inline, inherited] |
Sets the clear stencil to the indicated value.
This is the value that will be used to clear the stencil buffer every frame, but only if get_clear_color_active() returns true. If get_clear_stencil_active() returns false, this is meaningless.
Definition at line 228 of file drawableRegion.I.
References DrawableRegion::set_clear_value().
void DrawableRegion::set_clear_stencil_active | ( | bool | clear_stencil_active | ) | [inline, inherited] |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame.
If this is true, the stencil buffer will be cleared to the value indicated by set_clear_stencil(); otherwise, it will be left alone.
Definition at line 147 of file drawableRegion.I.
References DrawableRegion::set_clear_active().
Referenced by GraphicsOutput::GraphicsOutput(), and GraphicsOutput::make_cube_map().
void DrawableRegion::set_clear_value | ( | int | n, |
const Colorf & | clear_value | ||
) | [virtual, inherited] |
Sets the clear value for any bitplane.
Reimplemented in StereoDisplayRegion.
Definition at line 56 of file drawableRegion.cxx.
Referenced by DrawableRegion::set_clear_color(), DrawableRegion::set_clear_depth(), and DrawableRegion::set_clear_stencil().
void DisplayRegion::set_cube_map_index | ( | int | cube_map_index | ) | [virtual] |
This is a special parameter that is only used when rendering the faces of a cube map.
Normally you should not need to set it directly. This sets up the DisplayRegion to render to the nth cube map face; the value must be between 0 and 5, inclusive. A normal DisplayRegion that is not associated with any particular cube map should be set to -1.
Reimplemented in StereoDisplayRegion.
Definition at line 370 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage().
Referenced by GraphicsOutput::make_cube_map().
void DisplayRegion::set_cull_callback | ( | CallbackObject * | object | ) | [inline] |
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal.
This callback will be made during the cull thread.
The cull traversal is responsible for determining which nodes are visible and within the view frustum, and for accumulating state and transform, and generally building up the list of CullableObjects that are to be eventually passed to the draw traversal for rendering.
At the time the cull traversal callback is made, the traversal for this DisplayRegion has not yet started.
The callback is passed an instance of a DisplayRegionCullCallbackData, which contains pointers to the current scene information, as well as the current DisplayRegion and GSG. The callback replaces* the normal cull behavior, so if your callback does nothing, the scene graph will not be traversed and therefore nothing will be drawn. If you wish the normal cull traversal to be performed for this DisplayRegion, you must call cbdata->upcall() from your callback.
Definition at line 239 of file displayRegion.I.
Referenced by clear_cull_callback().
void DisplayRegion::set_cull_result | ( | CullResult * | cull_result, |
SceneSetup * | scene_setup, | ||
Thread * | current_thread | ||
) | [inline] |
Stores the result of performing a cull operation on this DisplayRegion.
Normally, this will only be called by the GraphicsEngine; you should not call this directly.
The stored result will automatically be applied back to all upstream pipeline stages.
Definition at line 410 of file displayRegion.I.
void DisplayRegion::set_cull_traverser | ( | CullTraverser * | trav | ) | [virtual] |
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion.
Normally the default CullTraverser is sufficient, but this may be changed to change the default cull behavior.
Reimplemented in StereoDisplayRegion.
Definition at line 340 of file displayRegion.cxx.
void DisplayRegion::set_dimensions | ( | float | l, |
float | r, | ||
float | b, | ||
float | t | ||
) | [virtual] |
Changes the portion of the framebuffer this DisplayRegion corresponds to.
The parameters range from 0 to 1, where 0,0 is the lower left corner and 1,1 is the upper right; (0, 1, 0, 1) represents the whole screen.
Reimplemented in StereoDisplayRegion.
Definition at line 127 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage(), GraphicsOutput::get_fb_x_size(), GraphicsOutput::get_fb_y_size(), and GraphicsOutput::has_size().
Referenced by WindowFramework::split_window().
void DisplayRegion::set_draw_callback | ( | CallbackObject * | object | ) | [inline] |
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal.
This callback will be made during the draw thread.
The draw traversal is responsible for actually issuing the commands to the graphics engine to draw primitives. Its job is to walk through the list of CullableObjects build up by the cull traversal, as quickly as possible, issuing the appropriate commands to draw each one.
At the time the draw traversal callback is made, the graphics state is in the initial state, and no projection matrix or modelview matrix is in effect. begin_scene() has not yet been called, and no objects have yet been drawn. However, the viewport has already been set to the appropriate part of the window, and the clear commands for this DisplayRegion (if any) have been issued.
The callback is passed an instance of a DisplayRegionDrawCallbackData, which contains pointers to the current scene information, as well as the current DisplayRegion and GSG. The callback replaces* the normal draw behavior, so if your callback does nothing, nothing in the DisplayRegion will be drawn. If you wish the draw traversal to continue to draw the contents of this DisplayRegion, you must call cbdata->upcall() from your callback.
Definition at line 301 of file displayRegion.I.
Referenced by clear_draw_callback().
void DisplayRegion::set_incomplete_render | ( | bool | incomplete_render | ) | [virtual] |
Sets the incomplete_render flag.
When this is true, the frame will be rendered even if some of the geometry or textures in the scene are not available (e.g. they have been temporarily paged out). When this is false, the frame will be held up while this data is reloaded.
This flag may also be set on the GraphicsStateGuardian. It will be considered true for a given DisplayRegion only if it is true on both the GSG and on the DisplayRegion.
See GraphicsStateGuardian::set_incomplete_render() for more detail.
Reimplemented in StereoDisplayRegion.
Definition at line 305 of file displayRegion.cxx.
void DisplayRegion::set_lens_index | ( | int | index | ) |
Sets the lens index, allows for multiple lenses to be attached to a camera.
This is useful for a variety of setups, such as fish eye rendering. The default is 0.
Definition at line 110 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage().
void DrawableRegion::set_pixel_zoom | ( | float | pixel_zoom | ) | [virtual, inherited] |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally.
Setting this number larger makes the pixels blockier, but may make the rendering faster, particularly for software renderers. Setting this number to 2.0 reduces the number of pixels that have to be filled by the renderer by a factor of 2.0. It doesn't make sense to set this lower than 1.0.
It is possible to set this on either individual DisplayRegions or on overall GraphicsWindows, but you will get better performance for setting it on the window rather than its individual DisplayRegions. Also, you may not set it on a DisplayRegion that doesn't have both clear_color() and clear_depth() enabled.
This property is only supported on renderers for which it is particularly useful--currently, this is the tinydisplay software renderer. Other kinds of renderers allow you to set this property, but ignore it.
Reimplemented in StereoDisplayRegion.
Definition at line 132 of file drawableRegion.cxx.
References DrawableRegion::update_pixel_factor().
Referenced by GraphicsWindow::GraphicsWindow().
void DisplayRegion::set_sort | ( | int | sort | ) | [virtual] |
Sets the sort value associated with the DisplayRegion.
Within a window, DisplayRegions will be rendered in order from the lowest sort value to the highest.
Reimplemented in StereoDisplayRegion.
Definition at line 236 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage().
void DisplayRegion::set_stereo_channel | ( | Lens::StereoChannel | stereo_channel | ) | [virtual] |
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image.
This automatically adjusts the lens that is used to render to this DisplayRegion to its left or right eye, according to the lens's stereo properties.
When the DisplayRegion is attached to a stereo window (one for which is_stereo() returns true), this also specifies which physical channel the DisplayRegion renders to.
Normally you would create at least two DisplayRegions for a stereo window, one for each of the left and right channels. The two DisplayRegions may share the same camera (and thus the same lens); this parameter is used to control the exact properties of the lens when it is used to render into this DisplayRegion.
Also see the StereoDisplayRegion, which automates managing a pair of left/right DisplayRegions.
An ordinary DisplayRegion may be set to SC_mono, SC_left, or SC_right. You may set SC_stereo only on a StereoDisplayRegion.
Reimplemented in StereoDisplayRegion.
Definition at line 277 of file displayRegion.cxx.
References Thread::get_current_pipeline_stage(), and is_stereo().
void DisplayRegion::set_texture_reload_priority | ( | int | texture_reload_priority | ) | [virtual] |
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion.
This controls which textures are loaded first when multiple textures need to be reloaded at once; it also controls the relative priority between asynchronous texture loads and asynchronous model or animation loads.
Specifying a larger number here makes the textures rendered by this DisplayRegion load up first. This may be particularly useful to do, for instance, for the DisplayRegion that renders the gui.
Reimplemented in StereoDisplayRegion.
Definition at line 327 of file displayRegion.cxx.
bool DisplayRegion::supports_pixel_zoom | ( | ) | const [virtual] |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored.
If this returns false, then get_pixel_factor() will always return 1.0, regardless of what value you specify for set_pixel_zoom().
This may return false if the underlying renderer doesn't support pixel zooming, or if you have called this on a DisplayRegion that doesn't have both set_clear_color() and set_clear_depth() enabled.
Reimplemented from DrawableRegion.
Definition at line 664 of file displayRegion.cxx.
References DrawableRegion::get_clear_color_active(), DrawableRegion::get_clear_depth_active(), and DrawableRegion::supports_pixel_zoom().
bool ReferenceCount::test_ref_count_integrity | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't completely bogus.
Returns true if ok, false otherwise.
Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.
Definition at line 236 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_integrity().
Referenced by EggGroupNode::add_child(), InternalName::find_ancestor(), InternalName::get_ancestor(), ReferenceCount::get_ref_count(), InternalName::get_top(), ReferenceCount::ref(), EggVertex::test_gref_integrity(), EggVertex::test_pref_integrity(), EggNode::test_under_integrity(), EggPrimitive::test_vref_integrity(), EggGroup::test_vref_integrity(), MouseWatcher::throw_event_pattern(), ReferenceCount::unref(), and EggNode::update_under().
bool ReferenceCount::test_ref_count_nonzero | ( | ) | const [inline, inherited] |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
Returns true if ok, false otherwise.
Definition at line 252 of file referenceCount.I.
References ReferenceCount::do_test_ref_count_nonzero().
Referenced by CopyOnWritePointer::test_ref_count_nonzero().
bool ReferenceCount::unref | ( | ) | const [inline, virtual, inherited] |
Explicitly decrements the reference count.
Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().
User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.
This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.
The return value is true if the new reference count is nonzero, false if it is zero.
Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.
Definition at line 214 of file referenceCount.I.
References ReferenceCount::test_ref_count_integrity().
Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().
void DrawableRegion::update_pixel_factor | ( | ) | [inline, protected, inherited] |
Internal function to reset pixel_factor after it may have changed.
Definition at line 306 of file drawableRegion.I.
References DrawableRegion::pixel_factor_changed(), and DrawableRegion::supports_pixel_zoom().
Referenced by DrawableRegion::copy_clear_settings(), DrawableRegion::disable_clears(), DrawableRegion::set_clear_active(), and DrawableRegion::set_pixel_zoom().
void ReferenceCount::weak_ref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Adds the indicated PointerToVoid as a weak reference to this object.
Definition at line 321 of file referenceCount.I.
References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().
void ReferenceCount::weak_unref | ( | WeakPointerToVoid * | ptv | ) | [inline, inherited] |
Removes the indicated PointerToVoid as a weak reference to this object.
It must have previously been added via a call to weak_ref().
Definition at line 334 of file referenceCount.I.
References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().