00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "drawableRegion.h"
00016
00017
00018
00019
00020
00021
00022
00023 DrawableRegion::
00024 ~DrawableRegion() {
00025 }
00026
00027
00028
00029
00030
00031
00032 void DrawableRegion::
00033 set_clear_active(int n, bool clear_active) {
00034 nassertv((n >= 0)&&(n < RTP_COUNT));
00035 _clear_active[n] = clear_active;
00036 update_pixel_factor();
00037 }
00038
00039
00040
00041
00042
00043
00044 bool DrawableRegion::
00045 get_clear_active(int n) const {
00046 nassertr((n >= 0)&&(n < RTP_COUNT), false);
00047 return _clear_active[n];
00048 }
00049
00050
00051
00052
00053
00054
00055 void DrawableRegion::
00056 set_clear_value(int n, const Colorf &clear_value) {
00057 nassertv((n >= 0) && (n < RTP_COUNT));
00058 _clear_value[n] = clear_value;
00059 }
00060
00061
00062
00063
00064
00065
00066 const Colorf &DrawableRegion::
00067 get_clear_value(int n) const {
00068 static Colorf blank(0.5,0.5,0.5,0.0);
00069 nassertr((n >= 0) && (n < RTP_COUNT), blank);
00070 return _clear_value[n];
00071 }
00072
00073
00074
00075
00076
00077
00078
00079 void DrawableRegion::
00080 disable_clears() {
00081 for (int i = 0; i < RTP_COUNT; ++i) {
00082 _clear_active[i] = false;
00083 }
00084 update_pixel_factor();
00085 }
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 bool DrawableRegion::
00096 is_any_clear_active() const {
00097 for (int i = 0; i < RTP_COUNT; ++i) {
00098 if (get_clear_active(i)) {
00099 return true;
00100 }
00101 }
00102 return false;
00103 }
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 void DrawableRegion::
00132 set_pixel_zoom(float pixel_zoom) {
00133 _pixel_zoom = pixel_zoom;
00134 update_pixel_factor();
00135 }
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151 bool DrawableRegion::
00152 supports_pixel_zoom() const {
00153 return false;
00154 }
00155
00156
00157
00158
00159
00160
00161
00162 int DrawableRegion::
00163 get_renderbuffer_type(int rtp) {
00164 switch(rtp) {
00165 case RTP_stencil: return RenderBuffer::T_stencil;
00166 case RTP_depth: return RenderBuffer::T_depth;
00167 case RTP_depth_stencil: return RenderBuffer::T_depth | RenderBuffer::T_stencil;
00168 case RTP_color: return RenderBuffer::T_color;
00169 case RTP_aux_rgba_0: return RenderBuffer::T_aux_rgba_0;
00170 case RTP_aux_rgba_1: return RenderBuffer::T_aux_rgba_1;
00171 case RTP_aux_rgba_2: return RenderBuffer::T_aux_rgba_2;
00172 case RTP_aux_rgba_3: return RenderBuffer::T_aux_rgba_3;
00173 case RTP_aux_hrgba_0: return RenderBuffer::T_aux_hrgba_0;
00174 case RTP_aux_hrgba_1: return RenderBuffer::T_aux_hrgba_1;
00175 case RTP_aux_hrgba_2: return RenderBuffer::T_aux_hrgba_2;
00176 case RTP_aux_hrgba_3: return RenderBuffer::T_aux_hrgba_3;
00177 case RTP_aux_float_0: return RenderBuffer::T_aux_float_0;
00178 case RTP_aux_float_1: return RenderBuffer::T_aux_float_1;
00179 case RTP_aux_float_2: return RenderBuffer::T_aux_float_2;
00180 case RTP_aux_float_3: return RenderBuffer::T_aux_float_3;
00181 default:
00182 display_cat.error() << "DrawableRegion::get_renderbuffer_type unexpected case!\n";
00183 return 0;
00184 };
00185 }
00186
00187
00188
00189
00190
00191
00192 void DrawableRegion::
00193 pixel_factor_changed() {
00194 }