Represents a region in a window or buffer where the libRocket UI will be rendered to. More...
#include "rocketRegion.h"
Public Member Functions | |
virtual TypeHandle | force_init_type () |
Rocket::Core::Context * | get_context () const |
Returns a pointer to the Rocket context associated with this region. More... | |
RocketInputHandler * | get_input_handler () const |
virtual TypeHandle | get_type () const |
bool | init_debugger () |
Initializes the libRocket debugger. More... | |
bool | is_debugger_visible () const |
void | set_debugger_visible (bool visible) |
void | set_input_handler (RocketInputHandler *handler) |
Public Member Functions inherited from DisplayRegion | |
void | cleanup () |
Cleans up some pointers associated with the DisplayRegion to help reduce the chance of memory leaks due to circular reference counts. More... | |
void | clear_cull_callback () |
Removes the callback set by an earlier call to set_cull_callback(). More... | |
void | clear_draw_callback () |
Removes the callback set by an earlier call to set_draw_callback(). More... | |
void | compute_pixels () |
Computes the pixel locations of the DisplayRegion within its window. More... | |
void | compute_pixels (int x_size, int y_size) |
Computes the pixel locations of the DisplayRegion within its window, given the size of the window in pixels. More... | |
void | compute_pixels_all_stages () |
Computes the pixel locations of the DisplayRegion within its window. More... | |
void | compute_pixels_all_stages (int x_size, int y_size) |
Performs a compute_pixels() operation for all stages of the pipeline. More... | |
PN_stdfloat | get_bottom (int i=0) const |
Retrieves the y coordinate of the bottom edge of the rectangle within its GraphicsOutput. More... | |
NodePath | get_camera (Thread *current_thread=Thread::get_current_thread()) const |
CallbackObject * | get_cull_callback () const |
PStatCollector & | get_cull_region_pcollector () |
Returns a PStatCollector for timing the cull operation for just this DisplayRegion. More... | |
CullResult * | get_cull_result (Thread *current_thread) const |
Returns the CullResult value that was stored on this DisplayRegion, presumably by the last successful cull operation. More... | |
CullTraverser * | get_cull_traverser () |
const std::string & | get_debug_name () const |
Returns a unique name used for debugging. More... | |
void | get_dimensions (PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
void | get_dimensions (int i, PN_stdfloat &l, PN_stdfloat &r, PN_stdfloat &b, PN_stdfloat &t) const |
LVecBase4 | get_dimensions (int i=0) const |
CallbackObject * | get_draw_callback () const |
PStatCollector & | get_draw_region_pcollector () |
Returns a PStatCollector for timing the draw operation for just this DisplayRegion. More... | |
bool | get_incomplete_render () const |
PN_stdfloat | get_left (int i=0) const |
Retrieves the x coordinate of the left edge of the rectangle within its GraphicsOutput. More... | |
int | get_lens_index () const |
int | get_num_regions () const |
Returns the number of regions, see set_num_regions. More... | |
GraphicsPipe * | get_pipe () const |
int | get_pixel_height (int i=0) const |
Returns the height of the DisplayRegion in pixels. More... | |
LVecBase2i | get_pixel_size (int i=0) const |
int | get_pixel_width (int i=0) const |
Returns the width of the DisplayRegion in pixels. More... | |
void | get_pixels (int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its window, in pixels. More... | |
void | get_pixels (int i, int &pl, int &pr, int &pb, int &pt) const |
Retrieves the coordinates of the DisplayRegion within its window, in pixels. More... | |
void | get_region_pixels (int &xo, int &yo, int &w, int &h) const |
Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More... | |
void | get_region_pixels (int i, int &xo, int &yo, int &w, int &h) const |
Retrieves the coordinates of the DisplayRegion within its window, as the pixel location of its bottom-left corner, along with a pixel width and height. More... | |
void | get_region_pixels_i (int &xo, int &yo, int &w, int &h) const |
Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More... | |
void | get_region_pixels_i (int i, int &xo, int &yo, int &w, int &h) const |
Similar to get_region_pixels(), but returns the upper left corner, and the pixel numbers are numbered from the top-left corner down, in the DirectX way of things. More... | |
PN_stdfloat | get_right (int i=0) const |
Retrieves the x coordinate of the right edge of the rectangle within its GraphicsOutput. More... | |
SceneSetup * | get_scene_setup (Thread *current_thread) const |
Returns the SceneSetup value that was stored on this DisplayRegion, presumably by the last successful cull operation. More... | |
bool | get_scissor_enabled () const |
bool | get_screenshot (PNMImage &image) |
Captures the most-recently rendered image from the framebuffer into the indicated PNMImage. More... | |
int | get_sort () const |
Lens::StereoChannel | get_stereo_channel () const |
int | get_target_tex_page () const |
int | get_tex_view_offset () const |
int | get_texture_reload_priority () const |
PN_stdfloat | get_top (int i=0) const |
Retrieves the y coordinate of the top edge of the rectangle within its GraphicsOutput. More... | |
GraphicsOutput * | get_window () const |
bool | is_active () const |
virtual bool | is_stereo () const |
bool | operator< (const DisplayRegion &other) const |
Returns true if this DisplayRegion should be sorted before the other one, false otherwise. More... | |
virtual void | output (std::ostream &out) const |
PT (Texture) get_screenshot() | |
virtual | PT (PandaNode) make_cull_result_graph() |
bool | save_screenshot (const Filename &filename, const std::string &image_comment="") |
Saves a screenshot of the region to the indicated filename. More... | |
Filename | save_screenshot_default (const std::string &prefix="screenshot") |
Saves a screenshot of the region to a default filename, and returns the filename, or empty string if the screenshot failed. More... | |
virtual void | set_active (bool active) |
virtual void | set_camera (const NodePath &camera) |
void | set_cube_map_index (int cube_map_index) |
Deprecated; replaced by set_target_tex_page(). More... | |
void | set_cull_callback (CallbackObject *object) |
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. More... | |
virtual void | set_cull_traverser (CullTraverser *trav) |
void | set_dimensions (PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
void | set_dimensions (int i, PN_stdfloat l, PN_stdfloat r, PN_stdfloat b, PN_stdfloat t) |
void | set_dimensions (const LVecBase4 &dimensions) |
virtual void | set_dimensions (int i, const LVecBase4 &dimensions) |
void | set_draw_callback (CallbackObject *object) |
virtual void | set_incomplete_render (bool incomplete_render) |
void | set_lens_index (int index) |
void | set_num_regions (int i) |
Sets the number of regions that this DisplayRegion indicates. More... | |
void | set_scissor_enabled (bool scissor_enabled) |
virtual void | set_sort (int sort) |
virtual void | set_stereo_channel (Lens::StereoChannel stereo_channel) |
virtual void | set_target_tex_page (int page) |
virtual void | set_tex_view_offset (int tex_view_offset) |
virtual void | set_texture_reload_priority (int texture_reload_priority) |
virtual bool | supports_pixel_zoom () const |
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored. More... | |
Public Member Functions inherited from TypedReferenceCount | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
Public Member Functions inherited from TypedObject | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
Public Member Functions inherited from ReferenceCount | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
Public Member Functions inherited from DrawableRegion | |
DrawableRegion (const DrawableRegion ©) | |
void | copy_clear_settings (const DrawableRegion ©) |
Copies only the clear settings from the other drawable region. More... | |
virtual void | disable_clears () |
Disables both the color and depth clear. More... | |
virtual bool | get_clear_active (int n) const |
Gets the clear-active flag for any bitplane. More... | |
const LColor & | get_clear_color () const |
bool | get_clear_color_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
PN_stdfloat | get_clear_depth () const |
bool | get_clear_depth_active () const |
Returns the current setting of the flag that indicates whether the depth buffer should be cleared every frame. More... | |
unsigned int | get_clear_stencil () const |
bool | get_clear_stencil_active () const |
Returns the current setting of the flag that indicates whether the color buffer should be cleared every frame. More... | |
virtual const LColor & | get_clear_value (int n) const |
Returns the clear value for any bitplane. More... | |
int | get_draw_buffer_type () const |
Returns the RenderBuffer into which the GSG should issue draw commands. More... | |
PN_stdfloat | get_pixel_factor () const |
PN_stdfloat | get_pixel_zoom () const |
int | get_screenshot_buffer_type () const |
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableRegion. More... | |
virtual bool | is_any_clear_active () const |
Returns true if any of the clear types (so far there are just color or depth) have been set active, or false if none of them are active and there is no need to clear. More... | |
void | operator= (const DrawableRegion ©) |
virtual void | set_clear_active (int n, bool clear_aux_active) |
Sets the clear-active flag for any bitplane. More... | |
void | set_clear_color (const LColor &color) |
void | set_clear_color_active (bool clear_color_active) |
Toggles the flag that indicates whether the color buffer should be cleared every frame. More... | |
void | set_clear_depth (PN_stdfloat depth) |
void | set_clear_depth_active (bool clear_depth_active) |
Toggles the flag that indicates whether the depth buffer should be cleared every frame. More... | |
void | set_clear_stencil (unsigned int stencil) |
void | set_clear_stencil_active (bool clear_stencil_active) |
Toggles the flag that indicates whether the stencil buffer should be cleared every frame. More... | |
virtual void | set_clear_value (int n, const LColor &clear_value) |
Sets the clear value for any bitplane. More... | |
virtual void | set_pixel_zoom (PN_stdfloat pixel_zoom) |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
static RocketRegion * | make (const std::string &context_name, GraphicsOutput *window) |
Creates a libRocket context with the given name (must be unique) for the given window. More... | |
static RocketRegion * | make (const std::string &context_name, GraphicsOutput *window, const LVecBase4 &dimensions) |
Creates a libRocket context with the given name (must be unique) for the given window. More... | |
Static Public Member Functions inherited from DisplayRegion | |
static TypeHandle | get_class_type () |
static void | init_type () |
static Filename | make_screenshot_filename (const std::string &prefix="screenshot") |
Synthesizes a suitable default filename for passing to save_screenshot(). More... | |
Static Public Member Functions inherited from TypedReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from TypedObject | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
Static Public Member Functions inherited from ReferenceCount | |
static TypeHandle | get_class_type () |
static void | init_type () |
Static Public Member Functions inherited from DrawableRegion | |
static int | get_renderbuffer_type (int plane) |
Returns the RenderBuffer::Type that corresponds to a RenderTexturePlane. More... | |
Public Attributes | |
get_input_handler | |
Returns the RocketInputHandler object previously passed to set_input_handler. More... | |
is_debugger_visible | |
Returns true if the debugger is visible. More... | |
set_debugger_visible | |
Sets whether the debugger should be visible. More... | |
set_input_handler | |
Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the libRocket context before rendering. More... | |
Public Attributes inherited from DisplayRegion | |
get_camera | |
Returns the camera associated with this DisplayRegion, or an empty NodePath if no camera is associated. More... | |
get_cull_callback | |
Returns the CallbackObject set by set_cull_callback(). More... | |
get_cull_traverser | |
Returns the CullTraverser that will be used to draw the contents of this DisplayRegion. More... | |
get_dimensions | |
Retrieves the coordinates of the DisplayRegion's rectangle within its GraphicsOutput. More... | |
get_draw_callback | |
Returns the CallbackObject set by set_draw_callback(). More... | |
get_incomplete_render | |
Returns the incomplete_render flag. More... | |
get_lens_index | |
Returns the specific lens of the associated Camera that will be used for rendering this scene. More... | |
get_pipe | |
Returns the GraphicsPipe that this DisplayRegion is ultimately associated with, or NULL if no pipe is associated. More... | |
get_pixel_size | |
Returns the size of the DisplayRegion in pixels. More... | |
get_scissor_enabled | |
Returns whether or not scissor testing is enabled for this region. More... | |
get_sort | |
Returns the sort value associated with the DisplayRegion. More... | |
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. More... | |
get_target_tex_page | |
Returns the target page number associated with this particular DisplayRegion, or -1 if it is not associated with a page. More... | |
get_tex_view_offset | |
Returns the current texture view offset for this DisplayRegion. More... | |
get_texture_reload_priority | |
Returns the priority which is assigned to asynchronous texture reload requests. More... | |
get_window | |
Returns the GraphicsOutput that this DisplayRegion is ultimately associated with, or NULL if no window is associated. More... | |
is_active | |
Returns the active flag associated with the DisplayRegion. More... | |
is_stereo | |
Returns true if this is a StereoDisplayRegion, false otherwise. More... | |
set_active | |
Sets the active flag associated with the DisplayRegion. More... | |
set_camera | |
Sets the camera that is associated with this DisplayRegion. More... | |
set_cull_callback | |
Sets the CallbackObject that will be notified when the DisplayRegion is visited during the cull traversal. More... | |
set_cull_traverser | |
Specifies the CullTraverser that will be used to draw the contents of this DisplayRegion. More... | |
set_dimensions | |
Changes the portion of the framebuffer this DisplayRegion corresponds to. More... | |
set_draw_callback | |
Sets the CallbackObject that will be notified when the contents of DisplayRegion is drawn during the draw traversal. More... | |
set_incomplete_render | |
Sets the incomplete_render flag. More... | |
set_lens_index | |
Sets the lens index, allows for multiple lenses to be attached to a camera. More... | |
set_scissor_enabled | |
Sets whether or not scissor testing is enabled for this region. More... | |
set_sort | |
Sets the sort value associated with the DisplayRegion. More... | |
set_stereo_channel | |
Specifies whether the DisplayRegion represents the left or right channel of a stereo pair, or whether it is a normal, monocular image. More... | |
set_target_tex_page | |
This is a special parameter that is only used when rendering the faces of a cube map or multipage and/or multiview texture. More... | |
set_tex_view_offset | |
Sets the current texture view offset for this DisplayRegion. More... | |
set_texture_reload_priority | |
Specifies an integer priority which is assigned to any asynchronous texture reload requests spawned while processing this DisplayRegion. More... | |
Public Attributes inherited from TypedObject | |
get_type | |
Public Attributes inherited from ReferenceCount | |
get_ref_count | |
Returns the current reference count. More... | |
Public Attributes inherited from DrawableRegion | |
get_clear_color | |
Returns the current clear color value. More... | |
get_clear_depth | |
Returns the current clear depth value. More... | |
get_clear_stencil | |
Returns the current clear stencil value. More... | |
get_pixel_factor | |
Returns the amount by which the height and width of the region will be scaled internally, based on the zoom factor set by set_pixel_zoom(). More... | |
get_pixel_zoom | |
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not. More... | |
set_clear_color | |
Sets the clear color to the indicated value. More... | |
set_clear_depth | |
Sets the clear depth to the indicated value. More... | |
set_clear_stencil | |
Sets the clear stencil to the indicated value. More... | |
set_pixel_zoom | |
Sets the amount by which the pixels of the region are scaled internally when filling the image interally. More... | |
Additional Inherited Members | |
Public Types inherited from DisplayRegion | |
typedef epvector< Region > | Regions |
Public Types inherited from DrawableRegion | |
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 } |
Represents a region in a window or buffer where the libRocket UI will be rendered to.
Definition at line 28 of file rocketRegion.h.
|
inline |
Returns a pointer to the Rocket context associated with this region.
Does not increase the reference count, so if you want to preserve it for longer than this region exists, be sure to call AddReference() and RemoveReference() yourself.
Definition at line 45 of file rocketRegion.I.
bool RocketRegion::init_debugger | ( | ) |
Initializes the libRocket debugger.
This will return false if the debugger failed to initialize, or if support for the debugger has not been built in (for example in an optimize=4 build).
Definition at line 150 of file rocketRegion.cxx.
|
inlinestatic |
Creates a libRocket context with the given name (must be unique) for the given window.
Returns a new DisplayRegion where the libRocket context will render to. This variant of make() creates a region that fills the entire window.
Definition at line 21 of file rocketRegion.I.
|
inlinestatic |
Creates a libRocket context with the given name (must be unique) for the given window.
Returns a new DisplayRegion where the libRocket context will render to.
Definition at line 31 of file rocketRegion.I.
|
inline |
Returns the RocketInputHandler object previously passed to set_input_handler.
Definition at line 54 of file rocketRegion.h.
bool RocketRegion::is_debugger_visible |
Returns true if the debugger is visible.
Definition at line 59 of file rocketRegion.h.
void RocketRegion::set_debugger_visible |
Sets whether the debugger should be visible.
Definition at line 59 of file rocketRegion.h.
|
inline |
Sets the RocketInputHandler object from which to gather the keyboard and mouse inputs to pass to the libRocket context before rendering.
You may use one input handler to provide inputs to any number of RocketRegion objects.
Definition at line 54 of file rocketRegion.h.