28 INLINE
int DisplayRegion::
29 get_lens_index()
const {
30 CDReader cdata(_cycler);
31 return cdata->_lens_index;
40 return cdata->_regions.size();
53 cdata->_regions.resize(i);
61 get_dimensions(PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
70 get_dimensions(
int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
71 CDReader cdata(_cycler);
72 const Region ®ion = cdata->_regions[i];
73 l = region._dimensions[0];
74 r = region._dimensions[1];
75 b = region._dimensions[2];
76 t = region._dimensions[3];
85 CDReader cdata(_cycler);
86 return cdata->_regions[i]._dimensions;
96 return cdata->_regions[i]._dimensions[0];
106 return cdata->_regions[i]._dimensions[1];
116 return cdata->_regions[i]._dimensions[2];
126 return cdata->_regions[i]._dimensions[3];
135 set_dimensions(PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) {
145 set_dimensions(
int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) {
174 CDReader cdata(_cycler, current_thread);
175 return cdata->_camera;
181 INLINE
bool DisplayRegion::
183 CDReader cdata(_cycler);
184 return cdata->_active;
190 INLINE
int DisplayRegion::
192 CDReader cdata(_cycler);
201 INLINE Lens::StereoChannel DisplayRegion::
202 get_stereo_channel()
const {
203 CDReader cdata(_cycler);
204 return cdata->_stereo_channel;
215 INLINE
int DisplayRegion::
216 get_tex_view_offset()
const {
217 CDReader cdata(_cycler);
218 return cdata->_tex_view_offset;
224 INLINE
bool DisplayRegion::
225 get_incomplete_render()
const {
226 return _incomplete_render;
233 INLINE
int DisplayRegion::
234 get_texture_reload_priority()
const {
235 return _texture_reload_priority;
251 INLINE
int DisplayRegion::
252 get_target_tex_page()
const {
253 CDReader cdata(_cycler);
254 return cdata->_target_tex_page;
263 CDWriter cdata(_cycler);
264 cdata->_scissor_enabled = scissor_enabled;
271 INLINE
bool DisplayRegion::
272 get_scissor_enabled()
const {
273 CDReader cdata(_cycler);
274 return cdata->_scissor_enabled;
300 CDWriter cdata(_cycler);
301 cdata->_cull_callback = object;
316 get_cull_callback()
const {
317 CDReader cdata(_cycler);
318 return cdata->_cull_callback;
348 CDWriter cdata(_cycler);
349 cdata->_draw_callback = object;
364 get_draw_callback()
const {
365 CDReader cdata(_cycler);
366 return cdata->_draw_callback;
375 return cdata->_regions[i]._pixels[1] - cdata->_regions[i]._pixels[0];
384 return cdata->_regions[i]._pixels[3] - cdata->_regions[i]._pixels[2];
392 CDReader cdata(_cycler);
393 return LVecBase2i(cdata->_regions[i]._pixels[1] - cdata->_regions[i]._pixels[0],
394 cdata->_regions[i]._pixels[3] - cdata->_regions[i]._pixels[2]);
411 get_pixels(
int i,
int &pl,
int &pr,
int &pb,
int &pt)
const {
413 const Region ®ion = cdata->_regions[i];
414 pl = region._pixels[0];
415 pr = region._pixels[1];
416 pb = region._pixels[2];
417 pt = region._pixels[3];
438 const Region ®ion = cdata->_regions[i];
439 xo = region._pixels[0];
440 yo = region._pixels[2];
441 w = region._pixels[1] - xo;
442 h = region._pixels[3] - yo;
463 const Region ®ion = cdata->_regions[i];
464 xo = region._pixels_i[0];
465 yo = region._pixels_i[3];
466 w = region._pixels_i[1] - xo;
467 h = region._pixels_i[2] - yo;
482 cdata->_cull_result = std::move(cull_result);
483 cdata->_scene_setup = std::move(scene_setup);
494 return cdata->_cull_result;
505 return cdata->_scene_setup;
514 return _cull_region_pcollector;
523 return _draw_region_pcollector;
537 INLINE DisplayRegion::Region::
539 _dimensions(0, 1, 0, 1),
547 INLINE DisplayRegion::CDataCull::
554 INLINE DisplayRegion::CDataCull::
555 CDataCull(
const DisplayRegion::CDataCull ©) :
556 _cull_result(copy._cull_result),
557 _scene_setup(copy._scene_setup)
564 INLINE DisplayRegionPipelineReader::
567 _current_thread(current_thread),
568 _cdata(object->_cycler.read(current_thread))
571 nassertv(_object->test_ref_count_nonzero());
573 nassertv(_cdata->test_ref_count_nonzero());
574 #endif // DO_PIPELINING 581 INLINE DisplayRegionPipelineReader::
582 ~DisplayRegionPipelineReader() {
586 nassertv(_cdata->test_ref_count_nonzero());
587 #endif // DO_PIPELINING 608 INLINE
Thread *DisplayRegionPipelineReader::
609 get_current_thread()
const {
610 return _current_thread;
616 INLINE
bool DisplayRegionPipelineReader::
617 is_any_clear_active()
const {
626 return _cdata->_regions.size();
634 get_dimensions(PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
643 get_dimensions(
int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
645 l = region._dimensions[0];
646 r = region._dimensions[1];
647 b = region._dimensions[2];
648 t = region._dimensions[3];
657 return _cdata->_regions[i]._dimensions;
666 return _cdata->_regions[i]._dimensions[0];
675 return _cdata->_regions[i]._dimensions[1];
684 return _cdata->_regions[i]._dimensions[2];
693 return _cdata->_regions[i]._dimensions[3];
702 return _object->_window;
711 return _cdata->_camera;
719 return _cdata->_active;
727 return _cdata->_sort;
737 return _cdata->_stereo_channel;
750 return _cdata->_tex_view_offset;
760 return _cdata->_target_tex_page;
769 return _cdata->_scissor_enabled;
777 return _cdata->_draw_callback;
794 get_pixels(
int i,
int &pl,
int &pr,
int &pb,
int &pt)
const {
796 pl = region._pixels[0];
797 pr = region._pixels[1];
798 pb = region._pixels[2];
799 pt = region._pixels[3];
820 xo = region._pixels[0];
821 yo = region._pixels[2];
822 w = region._pixels[1] - xo;
823 h = region._pixels[3] - yo;
844 xo = region._pixels_i[0];
845 yo = region._pixels_i[3];
846 w = region._pixels_i[1] - xo;
847 h = region._pixels_i[2] - yo;
855 return _cdata->_regions[i]._pixels[1] - _cdata->_regions[i]._pixels[0];
863 return _cdata->_lens_index;
871 return _cdata->_regions[i]._pixels[3] - _cdata->_regions[i]._pixels[2];
874 INLINE std::ostream &
int get_num_regions() const
Returns the number of regions, see set_num_regions.
set_draw_callback
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the ...
Lens::StereoChannel get_stereo_channel() const
Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair,...
void set_num_regions(int i)
Sets the number of regions that this DisplayRegion indicates.
void set_cull_result(PT(CullResult) cull_result, PT(SceneSetup) scene_setup, Thread *current_thread)
Stores the result of performing a cull operation on this DisplayRegion.
PN_stdfloat get_right(int i=0) const
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput.
PN_stdfloat get_left(int i=0) const
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.
bool test_ref_count_nonzero() const
Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
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...
GraphicsOutput * get_window() const
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
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...
bool operator<(const DisplayRegion &other) const
Returns true if this DisplayRegion should be sorted before the other one, false otherwise.
void clear_cull_callback()
Removes the callback set by an earlier call to set_cull_callback().
PN_stdfloat get_bottom(int i=0) const
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput.
get_pixel_size
Returns the size of the DisplayRegion in pixels.
PN_stdfloat get_top(int i=0) const
Retrieves the y coordinate of the top 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...
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
PStatCollector & get_cull_region_pcollector()
Returns a PStatCollector for timing the cull operation for just this DisplayRegion.
NodePath get_camera() const
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associate...
set_cull_callback
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull trave...
int get_sort() const
Returns the sort value associated with the DisplayRegion.
A lightweight class that represents a single element that may be timed and/or counted via stats.
CullResult * get_cull_result(Thread *current_thread) const
Returns the CullResult value that was stored on this DisplayRegion, presumably by the last successful...
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...
int get_pixel_width(int i=0) const
Returns the width of the DisplayRegion in pixels.
int get_pixel_height(int i=0) const
Returns the height of the DisplayRegion in pixels.
get_camera
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associate...
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.
PStatCollector & get_draw_region_pcollector()
Returns a PStatCollector for timing the draw operation for just this DisplayRegion.
int get_target_tex_page() const
Returns the target page number associated with this particular DisplayRegion, or -1 if it is not asso...
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...
void clear_draw_callback()
Removes the callback set by an earlier call to set_draw_callback().
int get_tex_view_offset()
Returns the current texture view offset for this DisplayRegion.
int get_pixel_width(int i=0) const
Returns the width of the DisplayRegion in pixels.
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
This is a base class for the various different classes that represent the result of a frame of render...
int get_num_regions() const
Returns the number of regions, see set_num_regions.
set_target_tex_page
This is a special parameter that is only used when rendering the faces of a cube map or multipage and...
bool get_scissor_enabled() const
Returns whether or not scissor testing is enabled for this region.
This is a generic object that can be assigned to a callback at various points in the rendering proces...
void set_cube_map_index(int cube_map_index)
Deprecated; replaced by set_target_tex_page().
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins,...
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,...
PN_stdfloat get_left(int i=0) const
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.
A thread; that is, a lightweight process.
CallbackObject * get_draw_callback() const
Returns the CallbackObject set by set_draw_callback().
get_dimensions
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput.
PN_stdfloat get_bottom(int i=0) const
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput.
PN_stdfloat get_top(int i=0) const
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput.
const std::string & get_debug_name() const
Returns a unique name used for debugging.
A rectangular subregion within a window for rendering into.
int get_pixel_height(int i=0) const
Returns the height of the DisplayRegion in pixels.
set_scissor_enabled
Sets whether or not scissor testing is enabled for this region.
void get_pixels(int &pl, int &pr, int &pb, int &pt) const
Retrieves the coordinates of the DisplayRegion within its window, in pixels.
PN_stdfloat get_right(int i=0) const
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput.
get_sort
Returns the sort value associated with the DisplayRegion.
set_dimensions
Changes the portion of the framebuffer this DisplayRegion corresponds to.
This object holds the camera position, etc., and other general setup information for rendering a part...
int get_lens_index() const
Gets the index into a lens_node lens array.
void release_read(const CycleData *pointer) const
Releases a pointer previously obtained via a call to read().
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void get_pixels(int &pl, int &pr, int &pb, int &pt) const
Retrieves the coordinates of the DisplayRegion within its window, in pixels.
bool is_active() const
Returns the active flag associated with the DisplayRegion.