17 INLINE DrawableRegion::
23 for (
int i = 0; i < RTP_COUNT; ++i) {
24 _clear_value[i] = LColor(0.0f, 0.0f, 0.0f, 0.0f);
26 _clear_value[RTP_depth] = LColor(1.0f,1.0f,1.0f,1.0f);
34 INLINE DrawableRegion::
36 _screenshot_buffer_type(copy._screenshot_buffer_type),
37 _draw_buffer_type(copy._draw_buffer_type),
38 _clear_mask(copy._clear_mask),
39 _pixel_zoom(copy._pixel_zoom),
40 _pixel_factor(copy._pixel_factor)
42 for (
int i = 0; i < RTP_COUNT; ++i) {
43 _clear_value[i] = copy._clear_value[i];
50 INLINE
void DrawableRegion::
52 _screenshot_buffer_type = copy._screenshot_buffer_type;
53 _draw_buffer_type = copy._draw_buffer_type;
54 _clear_mask = copy._clear_mask;
55 for (
int i = 0; i < RTP_COUNT; ++i) {
56 _clear_value[i] = copy._clear_value[i];
58 _pixel_zoom = copy._pixel_zoom;
59 _pixel_factor = copy._pixel_factor;
67 _clear_mask = copy._clear_mask;
68 for (
int i = 0; i < RTP_COUNT; ++i) {
69 _clear_value[i] = copy._clear_value[i];
71 update_pixel_factor();
150 INLINE
const LColor &DrawableRegion::
151 get_clear_color()
const {
172 INLINE PN_stdfloat DrawableRegion::
173 get_clear_depth()
const {
193 INLINE
unsigned int DrawableRegion::
194 get_clear_stencil()
const {
202 INLINE PN_stdfloat DrawableRegion::
203 get_pixel_zoom()
const {
214 INLINE PN_stdfloat DrawableRegion::
215 get_pixel_factor()
const {
216 return _pixel_factor;
225 return _screenshot_buffer_type;
235 return _draw_buffer_type;
241 INLINE
void DrawableRegion::
242 update_pixel_factor() {
243 PN_stdfloat new_pixel_factor;
245 new_pixel_factor = (PN_stdfloat)1 / sqrt(std::max(_pixel_zoom, (PN_stdfloat)1.0));
247 new_pixel_factor = 1;
249 if (new_pixel_factor != _pixel_factor) {
250 _pixel_factor = new_pixel_factor;
251 pixel_factor_changed();
This is a base class for GraphicsWindow (actually, GraphicsOutput) and DisplayRegion,...
virtual void set_clear_active(int n, bool clear_aux_active)
Sets the clear-active flag for any bitplane.
virtual bool get_clear_active(int n) const
Gets the clear-active flag 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.
virtual void set_clear_value(int n, const LColor &clear_value)
Sets the clear value for any bitplane.
void set_clear_stencil_active(bool clear_stencil_active)
Toggles the flag that indicates whether the stencil buffer should be cleared every frame.
virtual const LColor & get_clear_value(int n) const
Returns the clear value for any bitplane.
virtual bool supports_pixel_zoom() const
Returns true if a call to set_pixel_zoom() will be respected, false if it will be ignored.
bool get_clear_color_active() const
Returns the current setting of the flag that indicates whether the color buffer should be cleared eve...
void copy_clear_settings(const DrawableRegion ©)
Copies only the clear settings from the other drawable region.
bool get_clear_depth_active() const
Returns the current setting of the flag that indicates whether the depth buffer should be cleared eve...
void set_clear_depth_active(bool clear_depth_active)
Toggles the flag that indicates whether the depth buffer should be cleared every frame.
int get_screenshot_buffer_type() const
Returns the RenderBuffer that should be used for capturing screenshots from this particular DrawableR...
bool get_clear_stencil_active() const
Returns the current setting of the flag that indicates whether the color buffer should be cleared eve...
int get_draw_buffer_type() const
Returns the RenderBuffer into which the GSG should issue draw commands.
set_clear_stencil
Sets the clear stencil to the indicated value.
set_clear_depth
Sets the clear depth to the indicated value.
set_clear_color
Sets the clear color to the indicated value.
A RenderBuffer is an arbitrary subset of the various layers (depth buffer, color buffer,...