#include <displayRegion.h>
Inheritance diagram for DisplayRegion:
Public Member Functions | |
DisplayRegion (GraphicsLayer *layer) | |
DisplayRegion (GraphicsLayer *layer, const float l, const float r, const float b, const float t) | |
DisplayRegion (int xsize, int ysize) | |
This constructor makes a DisplayRegion that is not associated with any particular layer; this is typically for rendering a temporary pass. | |
~DisplayRegion () | |
void | get_dimensions (float &l, float &r, float &b, float &t) const |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsLayer. | |
float | get_left () const |
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsLayer. | |
float | get_right () const |
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsLayer. | |
float | get_bottom () const |
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsLayer. | |
float | get_top () const |
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsLayer. | |
void | set_dimensions (float l, float r, float b, float t) |
Changes the portion of the framebuffer this DisplayRegion corresponds to. | |
GraphicsLayer * | get_layer () const |
Returns the layer associated with this particular DisplayRegion, or NULL if no layer is associated (or if the layer was deleted). | |
GraphicsChannel * | get_channel () const |
Returns the GraphicsChannel that this DisplayRegion is ultimately associated with, or NULL if no channel is associated. | |
GraphicsWindow * | get_window () const |
Returns the GraphicsWindow that this DisplayRegion is ultimately associated with, or NULL if no window is associated. | |
GraphicsPipe * | get_pipe () const |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. | |
void | set_camera (const NodePath &camera) |
Sets the camera that is associated with this DisplayRegion. | |
const NodePath & | get_camera () const |
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. | |
void | set_active (bool active) |
Sets the active flag associated with the DisplayRegion. | |
bool | is_active () const |
Returns the active flag associated with the DisplayRegion. | |
void | compute_pixels () |
Computes the pixel locations of the DisplayRegion within its layer. | |
void | compute_pixels (int x_size, int y_size) |
Computes the pixel locations of the DisplayRegion within its layer, given the size of the layer in pixels. | |
void | get_pixels (int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its layer, in pixels. | |
void | get_region_pixels (int &xo, int &yo, int &w, int &h) const |
Retrieves the coordinates of the DisplayRegion within its layer, as the pixel location of its bottom-left corner, along with a pixel width and height. | |
int | get_pixel_width () const |
Returns the width of the DisplayRegion in pixels. | |
int | get_pixel_height () const |
Returns the height of the DisplayRegion in pixels. | |
void | output (ostream &out) const |
int | get_ref_count () const |
Returns the current reference count. | |
int | ref () const |
Explicitly increments the reference count. | |
int | unref () const |
Explicitly decrements the reference count. | |
void | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. | |
void | copy_clear_settings (const ClearableRegion ©) |
A convenience function that does the same thing as the assignment operator; this is just syntactically a little nicer (and a little clearer) to call from a derived class. | |
void | set_clear_color_active (bool clear_color_active) |
Toggles the flag that indicates whether the color buffer should be cleared every frame. | |
bool | get_clear_color_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. | |
void | set_clear_depth_active (bool clear_depth_active) |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. | |
bool | get_clear_depth_active () const |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. | |
void | set_clear_color (const Colorf &color) |
Sets the clear color to the indicated value. | |
const Colorf & | get_clear_color () const |
Returns the current clear color value. | |
void | set_clear_depth (float depth) |
Sets the clear depth to the indicated value. | |
float | get_clear_depth () const |
Returns the current clear depth value. | |
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. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Member Functions | |
DisplayRegion (const DisplayRegion ©) | |
void | operator= (const DisplayRegion ©) |
void | win_display_regions_changed () |
Intended to be called when the active state on a nested channel or layer or display region changes, forcing the window to recompute its list of active display regions. | |
void | do_compute_pixels (int x_size, int y_size) |
The private implementation of compute_pixels, this assumes that we already have the lock. | |
Private Attributes | |
Mutex | _lock |
float | _l |
float | _r |
float | _b |
float | _t |
int | _pl |
int | _pr |
int | _pb |
int | _pt |
GraphicsLayer * | _layer |
NodePath | _camera |
PointerTo< Camera > | _camera_node |
bool | _active |
PointerTo< CullResult > | _cull_result |
Friends | |
class | GraphicsLayer |
class | GraphicsEngine |
|
Definition at line 41 of file displayRegion.cxx. References compute_pixels(). |
|
Definition at line 58 of file displayRegion.cxx. |
|
This constructor makes a DisplayRegion that is not associated with any particular layer; this is typically for rendering a temporary pass.
Definition at line 81 of file displayRegion.cxx. References nassertv. |
|
Definition at line 98 of file displayRegion.cxx. References set_camera(). |
|
Definition at line 122 of file displayRegion.cxx. |
|
Computes the pixel locations of the DisplayRegion within its layer, given the size of the layer in pixels.
Definition at line 453 of file displayRegion.cxx. |
|
Computes the pixel locations of the DisplayRegion within its layer. The DisplayRegion will request the size from the window. Definition at line 421 of file displayRegion.cxx. Referenced by DisplayRegion(). |
|
A convenience function that does the same thing as the assignment operator; this is just syntactically a little nicer (and a little clearer) to call from a derived class.
Definition at line 85 of file clearableRegion.I. References ClearableRegion::_flags, and ClearableRegion::F_clear_color_active. |
|
The private implementation of compute_pixels, this assumes that we already have the lock.
Definition at line 49 of file displayRegion.I. Referenced by get_bottom(), get_pipe(), and set_camera(). |
|
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsLayer. This number will be in the range [0..1]. Definition at line 196 of file displayRegion.cxx. References do_compute_pixels(), WindowProperties::get_x_size(), and WindowProperties::get_y_size(). |
|
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated.
Definition at line 382 of file displayRegion.cxx. |
|
Returns the GraphicsChannel that this DisplayRegion is ultimately associated with, or NULL if no channel is associated.
Definition at line 283 of file displayRegion.cxx. |
|
|
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 211 of file clearableRegion.I. |
|
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. Definition at line 127 of file clearableRegion.I. References ClearableRegion::_flags, and ClearableRegion::F_clear_depth_active. |
|
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 253 of file clearableRegion.I. |
|
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. Definition at line 169 of file clearableRegion.I. References ClearableRegion::_clear_depth. |
|
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsLayer. These numbers will be in the range [0..1]. Definition at line 139 of file displayRegion.cxx. |
|
Returns the layer associated with this particular DisplayRegion, or NULL if no layer is associated (or if the layer was deleted).
Definition at line 265 of file displayRegion.cxx. References _camera_node, _lock, DCAST_INTO_V, NodePath::is_empty(), NodePath::node(), and NULL. |
|
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsLayer. This number will be in the range [0..1]. Definition at line 160 of file displayRegion.cxx. References _b. |
|
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated.
Definition at line 319 of file displayRegion.cxx. References _lock, do_compute_pixels(), GraphicsWindow::get_properties(), GraphicsWindow::get_requested_properties(), get_window(), WindowProperties::get_x_size(), WindowProperties::get_y_size(), WindowProperties::has_size(), NULL, and win. |
|
Returns the height of the DisplayRegion in pixels.
Definition at line 521 of file displayRegion.cxx. Referenced by GLGraphicsStateGuardian::enable_lighting(), and CRGraphicsStateGuardian::issue_transformed_color(). |
|
Returns the width of the DisplayRegion in pixels.
Definition at line 507 of file displayRegion.cxx. Referenced by GLGraphicsStateGuardian::enable_lighting(), and CRGraphicsStateGuardian::issue_transformed_color(). |
|
Retrieves the coordinates of the DisplayRegion within its layer, in pixels.
Definition at line 469 of file displayRegion.cxx. |
|
Returns the current reference count.
Definition at line 183 of file referenceCount.I. Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture(). |
|
Retrieves the coordinates of the DisplayRegion within its layer, as the pixel location of its bottom-left corner, along with a pixel width and height.
Definition at line 490 of file displayRegion.cxx. Referenced by GLGraphicsStateGuardian::copy_texture(), and PlanarReflector::init(). |
|
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsLayer. This number will be in the range [0..1]. Definition at line 178 of file displayRegion.cxx. References _b, _l, _lock, _r, _t, GraphicsWindow::get_properties(), get_window(), NULL, t, and win. |
|
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsLayer. This number will be in the range [0..1]. Definition at line 214 of file displayRegion.cxx. References _layer, _lock, GraphicsLayer::get_channel(), and NULL. |
|
Returns the GraphicsWindow that this DisplayRegion is ultimately associated with, or NULL if no window is associated.
Definition at line 301 of file displayRegion.cxx. References _active, _lock, and win_display_regions_changed(). Referenced by get_pipe(), get_right(), and NonlinearImager::set_texture_size(). |
|
|
Returns the active flag associated with the DisplayRegion.
Definition at line 34 of file displayRegion.I. References _b, _l, _pb, _pl, _pr, _pt, _r, _t, INLINE, and int(). Referenced by GraphicsWindow::process_events(). |
|
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 272 of file clearableRegion.I. Referenced by GraphicsWindow::get_mouse_data(). |
|
Definition at line 110 of file displayRegion.cxx. |
|
Definition at line 534 of file displayRegion.cxx. |
|
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. The return value is the new reference count. Definition at line 225 of file referenceCount.I. Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering(). |
|
Sets the active flag associated with the DisplayRegion. If the DisplayRegion is marked inactive, nothing is rendered. Definition at line 400 of file displayRegion.cxx. References _lock, _pb, and _pt. Referenced by indirect_keys(). |
|
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. Definition at line 347 of file displayRegion.cxx. References _lock, and do_compute_pixels(). Referenced by DisplayRegion(). |
|
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 190 of file clearableRegion.I. References ClearableRegion::_flags, and INLINE. |
|
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 106 of file clearableRegion.I. References ClearableRegion::_flags, ClearableRegion::F_clear_depth_active, and INLINE. |
|
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 232 of file clearableRegion.I. |
|
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 148 of file clearableRegion.I. References ClearableRegion::_clear_color, Colorf, and INLINE. |
|
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. Definition at line 236 of file displayRegion.cxx. References _layer, _lock, GraphicsLayer::get_window(), and NULL. |
|
Does some easy checks to make sure that the reference count isn't completely bogus.
Definition at line 328 of file referenceCount.I. References INLINE. Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount(). |
|
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; plus, we don't have a virtual destructor anyway.) 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 the new reference count. Definition at line 293 of file referenceCount.I. References INLINE. Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds(). |
|
Intended to be called when the active state on a nested channel or layer or display region changes, forcing the window to recompute its list of active display regions. It is assumed the lock is already held. Definition at line 558 of file displayRegion.cxx. Referenced by get_window(). |
|
Definition at line 121 of file displayRegion.h. |
|
Definition at line 120 of file displayRegion.h. |
|
Definition at line 113 of file displayRegion.h. Referenced by get_window(). |
|
Definition at line 98 of file displayRegion.h. Referenced by get_left(), get_right(), is_active(), and operator=(). |
|
Definition at line 107 of file displayRegion.h. |
|
Definition at line 111 of file displayRegion.h. Referenced by get_layer(). |
|
Definition at line 118 of file displayRegion.h. Referenced by GraphicsEngine::render_subframe(). |
|
Definition at line 96 of file displayRegion.h. Referenced by get_right(), is_active(), and operator=(). |
|
Definition at line 106 of file displayRegion.h. Referenced by GraphicsLayer::get_dr(), get_top(), and set_dimensions(). |
|
Definition at line 94 of file displayRegion.h. Referenced by get_dimensions(), get_layer(), get_pipe(), get_right(), get_top(), get_window(), operator=(), set_active(), set_camera(), and set_dimensions(). |
|
Definition at line 103 of file displayRegion.h. Referenced by get_camera(), is_active(), and set_active(). |
|
Definition at line 101 of file displayRegion.h. Referenced by get_camera(), and is_active(). |
|
Definition at line 102 of file displayRegion.h. Referenced by get_camera(), and is_active(). |
|
Definition at line 104 of file displayRegion.h. Referenced by get_camera(), is_active(), and set_active(). |
|
Definition at line 97 of file displayRegion.h. Referenced by get_dimensions(), get_right(), is_active(), and operator=(). |
|
Definition at line 99 of file displayRegion.h. Referenced by get_right(), is_active(), and operator=(). |