21 INLINE DrawableRegion::
26 for (
int i=0; i<RTP_COUNT; i++) {
27 _clear_active[i] =
false;
28 _clear_value[i] =
LColor(0.0f, 0.0f, 0.0f, 0.0f);
30 _clear_value[RTP_depth] =
LColor(1.0f,1.0f,1.0f,1.0f);
40 INLINE DrawableRegion::
42 _screenshot_buffer_type(copy._screenshot_buffer_type),
43 _draw_buffer_type(copy._draw_buffer_type),
44 _pixel_zoom(copy._pixel_zoom),
45 _pixel_factor(copy._pixel_factor)
47 for (
int i=0; i<RTP_COUNT; i++) {
48 _clear_active[i] = copy._clear_active[i];
49 _clear_value[i] = copy._clear_value[i];
58 INLINE
void DrawableRegion::
60 _screenshot_buffer_type = copy._screenshot_buffer_type;
61 _draw_buffer_type = copy._draw_buffer_type;
62 for (
int i=0; i<RTP_COUNT; i++) {
63 _clear_active[i] = copy._clear_active[i];
64 _clear_value[i] = copy._clear_value[i];
66 _pixel_zoom = copy._pixel_zoom;
67 _pixel_factor = copy._pixel_factor;
78 for (
int i=0; i<RTP_COUNT; i++) {
79 _clear_active[i] = copy._clear_active[i];
80 _clear_value[i] = copy._clear_value[i];
82 update_pixel_factor();
271 return _pixel_factor;
283 return _screenshot_buffer_type;
296 return _draw_buffer_type;
305 INLINE
void DrawableRegion::
306 update_pixel_factor() {
307 PN_stdfloat new_pixel_factor;
309 new_pixel_factor = (PN_stdfloat)1 / sqrt(max(_pixel_zoom, (PN_stdfloat)1.0));
311 new_pixel_factor = 1;
313 if (new_pixel_factor != _pixel_factor) {
314 _pixel_factor = new_pixel_factor;
315 pixel_factor_changed();
This is a base class for GraphicsWindow (actually, GraphicsOutput) and DisplayRegion, both of which are conceptually rectangular regions into which drawing commands may be issued.
bool get_clear_color_active() const
Returns the current setting of the flag that indicates whether the color buffer should be cleared eve...
virtual void set_clear_active(int n, bool clear_aux_active)
Sets the clear-active flag for any bitplane.
PN_stdfloat 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().
virtual const LColor & get_clear_value(int n) const
Returns the clear value for any bitplane.
void set_clear_color_active(bool clear_color_active)
Toggles the flag that indicates whether the color buffer should be cleared every frame.
const LColor & get_clear_color() const
Returns the current clear color value.
unsigned int get_clear_stencil() const
Returns the current clear stencil value.
virtual void set_clear_value(int n, const LColor &clear_value)
Sets the clear value for any bitplane.
PN_stdfloat get_clear_depth() const
Returns the current clear depth value.
bool get_clear_stencil_active() const
Returns the current setting of the flag that indicates whether the color buffer should be cleared eve...
void set_clear_stencil_active(bool clear_stencil_active)
Toggles the flag that indicates whether the stencil buffer should be cleared every frame...
int get_draw_buffer_type() const
Returns the RenderBuffer into which the GSG should issue draw commands.
PN_stdfloat get_pixel_zoom() const
Returns the value set by set_pixel_zoom(), regardless of whether it is being respected or not...
virtual bool supports_pixel_zoom() const
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored...
void copy_clear_settings(const DrawableRegion ©)
Copies only the clear settings from the other drawable region.
void set_clear_color(const LColor &color)
Sets the clear color 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_depth(PN_stdfloat depth)
Sets the clear depth to the indicated value.
This is the base class for all three-component vectors and points.
virtual bool get_clear_active(int n) const
Gets the clear-active flag for any bitplane.
bool get_clear_depth_active() const
Returns the current setting of the flag that indicates whether the depth buffer should be cleared eve...
int get_screenshot_buffer_type() const
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableR...
A RenderBuffer is an arbitrary subset of the various layers (depth buffer, color buffer, etc.) of a drawing region.