38 return cdata->_lens_index;
49 return cdata->_regions.size();
66 cdata->_regions.resize(i);
77 get_dimensions(PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
89 get_dimensions(
int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
91 const Region ®ion = cdata->_regions[i];
92 l = region._dimensions[0];
93 r = region._dimensions[1];
94 b = region._dimensions[2];
95 t = region._dimensions[3];
108 return cdata->_regions[i]._dimensions;
121 return cdata->_regions[i]._dimensions[0];
134 return cdata->_regions[i]._dimensions[1];
147 return cdata->_regions[i]._dimensions[2];
160 return cdata->_regions[i]._dimensions[3];
187 set_dimensions(
int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) {
226 CDReader cdata(_cycler, current_thread);
227 return cdata->_camera;
239 return cdata->_active;
265 return cdata->_stereo_channel;
284 return cdata->_tex_view_offset;
295 return _incomplete_render;
307 return _texture_reload_priority;
331 return cdata->_target_tex_page;
344 cdata->_scissor_enabled = scissor_enabled;
357 return cdata->_scissor_enabled;
392 cdata->_cull_callback = object;
414 return cdata->_cull_callback;
454 cdata->_draw_callback = object;
476 return cdata->_draw_callback;
487 return cdata->_regions[i]._pixels[1] - cdata->_regions[i]._pixels[0];
498 return cdata->_regions[i]._pixels[3] - cdata->_regions[i]._pixels[2];
519 get_pixels(
int i,
int &pl,
int &pr,
int &pb,
int &pt)
const {
521 const Region ®ion = cdata->_regions[i];
522 pl = region._pixels[0];
523 pr = region._pixels[1];
524 pb = region._pixels[2];
525 pt = region._pixels[3];
550 const Region ®ion = cdata->_regions[i];
551 xo = region._pixels[0];
552 yo = region._pixels[2];
553 w = region._pixels[1] - xo;
554 h = region._pixels[3] - yo;
581 const Region ®ion = cdata->_regions[i];
582 xo = region._pixels_i[0];
583 yo = region._pixels_i[3];
584 w = region._pixels_i[1] - xo;
585 h = region._pixels_i[2] - yo;
603 cdata->_cull_result = cull_result;
604 cdata->_scene_setup = scene_setup;
619 return cdata->_cull_result;
634 return cdata->_scene_setup;
645 return _cull_region_pcollector;
656 return _draw_region_pcollector;
664 INLINE DisplayRegion::Region::
666 _dimensions(0, 1, 0, 1),
676 INLINE DisplayRegion::CDataCull::
685 INLINE DisplayRegion::CDataCull::
686 CDataCull(
const DisplayRegion::CDataCull ©) :
687 _cull_result(copy._cull_result),
688 _scene_setup(copy._scene_setup)
697 INLINE DisplayRegionPipelineReader::
700 _current_thread(current_thread),
701 _cdata(object->_cycler.
read(current_thread))
704 nassertv(_object->test_ref_count_nonzero());
706 nassertv(_cdata->test_ref_count_nonzero());
707 #endif // DO_PIPELINING 716 INLINE DisplayRegionPipelineReader::
726 INLINE
void DisplayRegionPipelineReader::
736 INLINE DisplayRegionPipelineReader::
737 ~DisplayRegionPipelineReader() {
739 nassertv(_object->test_ref_count_nonzero());
741 nassertv(_cdata->test_ref_count_nonzero());
742 #endif // DO_PIPELINING 744 _object->_cycler.release_read(_cdata);
767 INLINE
Thread *DisplayRegionPipelineReader::
768 get_current_thread()
const {
769 return _current_thread;
777 INLINE
bool DisplayRegionPipelineReader::
778 is_any_clear_active()
const {
779 return _object->is_any_clear_active();
789 return _cdata->_regions.size();
800 get_dimensions(PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
812 get_dimensions(
int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t)
const {
814 l = region._dimensions[0];
815 r = region._dimensions[1];
816 b = region._dimensions[2];
817 t = region._dimensions[3];
829 return _cdata->_regions[i]._dimensions;
841 return _cdata->_regions[i]._dimensions[0];
853 return _cdata->_regions[i]._dimensions[1];
865 return _cdata->_regions[i]._dimensions[2];
877 return _cdata->_regions[i]._dimensions[3];
889 return _object->_window;
901 return _cdata->_camera;
912 return _cdata->_active;
923 return _cdata->_sort;
936 return _cdata->_stereo_channel;
954 return _cdata->_tex_view_offset;
967 return _cdata->_target_tex_page;
979 return _cdata->_scissor_enabled;
989 return _cdata->_draw_callback;
1012 pl = region._pixels[0];
1013 pr = region._pixels[1];
1014 pb = region._pixels[2];
1015 pt = region._pixels[3];
1040 xo = region._pixels[0];
1041 yo = region._pixels[2];
1042 w = region._pixels[1] - xo;
1043 h = region._pixels[3] - yo;
1070 xo = region._pixels_i[0];
1071 yo = region._pixels_i[3];
1072 w = region._pixels_i[1] - xo;
1073 h = region._pixels_i[2] - yo;
1083 return _cdata->_regions[i]._pixels[1] - _cdata->_regions[i]._pixels[0];
1093 return _cdata->_lens_index;
1103 return _cdata->_regions[i]._pixels[3] - _cdata->_regions[i]._pixels[2];
int get_num_regions() const
Returns the number of regions, see set_num_regions.
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.
PN_stdfloat get_right(int i=0) const
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput.
Encapsulates the data from a DisplayRegion, pre-fetched for one stage of the pipeline.
PN_stdfloat get_left(int i=0) const
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.
void set_scissor_enabled(bool scissor_enabled)
Sets whether or not scissor testing is enabled for this region.
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...
Lens::StereoChannel get_stereo_channel() const
Returns whether the DisplayRegion is specified as the left or right channel of a stereo pair...
bool get_incomplete_render() const
Returns the incomplete_render flag.
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 associate...
bool operator<(const DisplayRegion &other) const
Returns true if this DisplayRegion should be sorted before the other one, false otherwise.
void set_dimensions(PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t)
Changes the portion of the framebuffer this DisplayRegion corresponds to.
void clear_cull_callback()
Removes the callback set by an earlier call to set_cull_callback().
virtual void set_target_tex_page(int page)
This is a special parameter that is only used when rendering the faces of a cube map or multipage and...
int get_lens_index() const
Returns the specific lens of the associated Camera that will be used for rendering this scene...
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.
GraphicsOutput * get_window() const
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no windo...
SceneSetup * get_scene_setup(Thread *current_thread) const
Returns the SceneSetup value that was stored on this DisplayRegion, presumably by the last successful...
void set_cull_result(CullResult *cull_result, SceneSetup *scene_setup, Thread *current_thread)
Stores the result of performing a cull operation on this DisplayRegion.
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...
bool get_scissor_enabled() const
Returns whether or not scissor testing is enabled for this region.
int get_tex_view_offset() const
Returns the current texture view offset for this DisplayRegion.
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.
CallbackObject * get_draw_callback() const
Returns the CallbackObject set by set_draw_callback().
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_texture_reload_priority() const
Returns the priority which is assigned to asynchronous texture reload requests.
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...
CallbackObject * get_cull_callback() const
Returns the CallbackObject set by set_cull_callback().
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.
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.
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...
int get_target_tex_page() const
Returns the target page number associated with this particular DisplayRegion, or -1 if it is not asso...
int get_sort() const
Returns the sort value associated with the DisplayRegion.
void set_cube_map_index(int cube_map_index)
Deprecated; replaced by set_target_tex_page().
This is the base class for all three-component vectors and points.
This stores the result of a BinCullHandler traversal: an ordered collection of CullBins, each of which holds a number of Geoms and RenderStates to be rendered in some defined order.
PN_stdfloat get_left(int i=0) const
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput.
bool is_active() const
Returns the active flag associated with the DisplayRegion.
void set_draw_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the ...
A thread; that is, a lightweight process.
CallbackObject * get_draw_callback() const
Returns the CallbackObject set by set_draw_callback().
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.
void set_cull_callback(CallbackObject *object)
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull trave...
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.
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.
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.
const CycleDataType * read(Thread *current_thread) const
See PipelineCyclerBase::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.