1#include <cgv/base/group.h>
3#include <cgv/media/image/image_writer.h>
4#include <cgv/math/ftransform.h>
5#include <cgv/base/traverser.h>
6#include <cgv/render/drawable.h>
7#include <cgv/render/shader_program.h>
12#define SAFE_STACK_POP(STACK, WHERE) \
13if(STACK.size() == 1) error("context::" WHERE "() ... attempt to completely empty stack avoided."); \
20const int nr_backgrounds = 5;
21float background_colors[] = {
71 srh.reflect_member(
"debug",
debug) &&
105 return "render_config";
132 gpu_vendor = GPU_VENDOR_UNKNOWN;
166 projection_matrix_stack.push(cgv::math::identity4<double>());
169 wt.viewport =
ivec4(0, 0, 640, 480);
191 do_screen_shot =
false;
222 rc->last_error = message;
224 std::cerr << message << std::endl;
240void context::init_render_pass()
245void context::draw_textual_info()
250void context::perform_screen_shot()
254void context::destruct_render_objects()
260void context::finish_render_pass()
278 error(
child->get_type_name()+
"::init(context&) failed");
411 error(
"context::enable_phong_shading() deprecated");
414void context::disable_phong_shading()
417 error(
"context::disable_phong_shading() deprecated");
422 error(
"context::enable_material(phong_material) deprecated");
427 error(
"context::disable_material(phong_material) deprecated");
429void context::enable_material(
const textured_material& mat,
MaterialSide ms,
float alpha)
431 error(
"context::enable_material(textured_material) deprecated");
479 dvec4 hL(
Le,
light.get_type() == cgv::media::illum::LT_DIRECTIONAL ? 0.0f : 1.0f);
482 if (
light.get_type() != cgv::media::illum::LT_DIRECTIONAL)
519 light_sources[handle] = std::pair<cgv::media::illum::light_source, light_source_status>(
535 if (
iter->second.second.enabled) {
551 return iter->second.first;
558 return iter->second.second;
570 if (
iter->second.second.enabled)
581 prog.
set_uniform(*
this,
"inverse_modelview_matrix", inv(
V));
600 prog.
set_uniform(*
this,
"inverse_projection_matrix", inv(
P));
641 if (!prog.does_use_lights())
654 if (
iter->second.second.enabled)
681 return iter->second.second.enabled;
690 if (
iter->second.second.enabled)
692 iter->second.second.enabled =
true;
705 if (!
iter->second.second.enabled)
707 iter->second.second.enabled =
false;
711 iter->second.second.light_source_index = -1;
736 "RP_OPAQUE_SURFACES",
737 "RP_TRANSPARENT_SURFACES",
801 ri.user_data = user_data;
833 perform_screen_shot();
834 do_screen_shot =
false;
837 finish_render_pass();
846 unsigned int i,
j = 0;
847 for (
i = 0;
i<text.size(); ++
i) {
893 float y = (
float)cursor_y;
896 cursor_y =
int(y + 0.5f);
909 font_face->enable(
this, font_size);
942 unsigned char*
dst =
dv1.get_ptr<
unsigned char>();
955 unsigned char*
dst = dv.
get_ptr<
unsigned char>();
957 for (
size_t i=0;
i<n; ++
i, ++
dst)
971 "repeat",
"clamp",
"clamp_to_edge",
"clamp_to_border",
"mirror_clamp",
972 "mirror_clamp_to_edge",
"mirror_clamp_to_border"
982 "undefined",
"Texture1D",
"Texture2D",
"Texture3D",
"CubeTexture"
991 "x+",
"x-",
"y+",
"y-",
"z+",
"z-"
1000 "undef",
"points",
"lines",
"lines_adjacency",
"line_strip",
"line_strip_adjacency",
"line_loop",
1001 "triangles",
"triangles_adjacency",
"triangle_strip",
"triangle_strip_adjacency",
"triangle_fan",
1002 "quads",
"quad_strip",
"polygon",
"patches"
1013 "nearest_mipmap_nearest",
1014 "linear_mipmap_nearest",
1015 "nearest_mipmap_linear",
1016 "linear_mipmap_linear",
1023float black[4] = { 0, 0, 0, 1 };
1024float white[4] = { 1, 1, 1, 1 };
1025float gray[4] = { 0.25f, 0.25f, 0.25f, 1 };
1026float green[4] = { 0, 1, 0, 1 };
1027float brown[4] = { 0.3f, 0.1f, 0, 1 };
1028float dark_red[4] = { 0.4f, 0, 0, 1 };
1029float cyan[4] = { 0, 1, 1, 1 };
1030float yellow[4] = { 1, 1, 0, 1 };
1031float red[4] = { 1, 0, 0, 1 };
1032float blue[4] = { 0, 0, 1, 1 };
1034void compute_face_normals(
const float* vertices,
float* normals,
const int* vertex_indices,
int* normal_indices,
int nr_faces,
int face_degree)
1036 for (
int i = 0;
i < nr_faces; ++
i) {
1037 vec3& normal =
reinterpret_cast<vec3&
>(normals[3 *
i]);
1039 vec3 reference_pnt = *
reinterpret_cast<const vec3*
>(vertices + 3 * vertex_indices[face_degree*
i + face_degree - 1]);
1042 for (
int j = 0;
j < face_degree; ++
j) {
1048 for (
int j = 0;
j<face_degree; ++
j)
1049 normal_indices[face_degree*
i+
j] =
i;
1056 static float V[8*3] = {
1066 static float N[6*3] = {
1071 static const float ot =
float(1.0 / 3);
1072 static const float tt =
float(2.0 / 3);
1073 static float T[14*2] = {
1075 0.25f,0 , 0.25f,ot ,
1076 0.25f,tt , 0.25f,1 ,
1079 0.75f,ot , 0.75f,tt ,
1082 static int F[6*4] = {
1090 static int FN[6*4] = {
1095 static int FT[6*4] = {
1096 3,4,1,0 ,7,10,11,8 ,
1098 12,13,11,10 ,3,7,8,4
1109 static float N[6 * 3] = {
1114 static int F[6 * 4] = {
1122 static int FN[6 * 4] = {
1123 0, 0, 0, 0, 1, 1, 1, 1,
1124 2, 2, 2, 2, 3, 3, 3, 3,
1125 4, 4, 4, 4, 5, 5, 5, 5
1129 for (
unsigned i = 0;
i < 8; ++
i) {
1143 static const float V[6*3] = {
1151 static float a = 1.0f/
sqrt(5.0f);
1152 static float b = 2*a;
1153 static const float N[5*3] = {
1160 static const int FT[2*3] = { 0,1,2, 5,4,3 };
1161 static const int FQ[8] = { 4,1, 3,0, 5,2, 4,1};
1162 static const int FTN[2*3] = { 0,0,0, 1,1,1 };
1163 static const int FQN[8] = { 2,2, 2,2, 3,3, 4,4, };
1178 std::vector<float>
V;
V.reserve(3*(resolution+1));
1179 std::vector<float> N; N.reserve(3*(resolution+1));
1180 std::vector<float>
T;
T.reserve(2*(resolution+1));
1182 std::vector<int> F; F.resize(resolution+1);
1184 for (
i = 0;
i <= resolution; ++
i)
1187 float step =
float(2*M_PI/resolution);
1189 for (
i = 0;
i <= resolution; ++
i,
phi += step) {
1195 T.push_back((
float)
i/resolution);
1210 std::vector<float>
V;
V.reserve(6*(resolution+1));
1211 std::vector<float> N; N.reserve(6*(resolution+1));
1212 std::vector<float>
T;
T.reserve(4*(resolution+1));
1214 std::vector<int> F; F.resize(2*resolution+2);
1216 for (
i = 0;
i <= 2*resolution+1; ++
i)
1219 static float a = 1.0f/
sqrt(5.0f);
1220 static float b = 2*a;
1221 float step =
float(2*M_PI/resolution);
1225 for (
int i = 0;
i <= resolution; ++
i, u +=
duv,
phi += step) {
1254 std::vector<float>
V;
V.reserve(6*(resolution+1));
1255 std::vector<float> N; N.reserve(6*(resolution+1));
1256 std::vector<float>
T;
T.reserve(4*(resolution+1));
1258 std::vector<int> F; F.resize(2*(resolution+1));
1260 for (
i = 0;
i <= 2*resolution+1; ++
i)
1263 float step =
float(2*M_PI/resolution);
1267 for (
int i = 0;
i <= resolution; ++
i, u +=
duv,
phi += step) {
1296 std::vector<float>
V;
V.resize(6*(resolution+1));
1297 std::vector<float> N; N.resize(6*(resolution+1));
1298 std::vector<float>
T;
T.resize(4*(resolution+1));
1299 std::vector<int> F; F.resize(2*(resolution+1));
1301 for (
int i = 0;
i <= resolution; ++
i) {
1305 float step =
float(2*M_PI/resolution);
1310 for (
i = 0;
i < resolution; ++
i, u +=
duv) {
1318 for (
int j = 0;
j <= resolution; ++
j,
theta += step, v +=
duv) {
1346 std::vector<float>
V;
V.resize(6*(resolution+1));
1347 std::vector<float> N; N.resize(6*(resolution+1));
1348 std::vector<float>
T;
T.resize(4*(resolution+1));
1349 std::vector<int> F; F.resize(2*(resolution+1));
1351 for (
int i = 0;
i <= resolution; ++
i) {
1355 float step =
float(M_PI/resolution);
1360 for (
i = 0;
i < resolution; ++
i, u +=
duv) {
1368 for (
int j = 0;
j <= resolution; ++
j,
theta += step, v +=
duv) {
1397 static const float a =
float(1.0/(2*
sqrt(3.0)));
1398 static const float b =
float(1.0/(3*
sqrt(3.0/2)));
1399 static const float V[4*3] = {
1405 static const int F[4*3] = {
1406 0,2,1,3,2,0,3,0,1,3,1,2
1409 static float N[4*3];
1412 compute_face_normals(
V, N, F,
FN, 4, 3);
1425 static float N[1*3] = {
1428 static float V[4*3] = {
1432 static float T[4*2] = {
1436 static int FN[1*4] = {
1439 static int F[1*4] = {
1452 static float N[8*3] = {
1453 -1,-1,+1, +1,-1,+1, -1,+1,+1, +1,+1,+1,
1454 -1,-1,-1, +1,-1,-1, -1,+1,-1, +1,+1,-1
1456 static float V[6*3] = {
1461 static int FN[8*3] = {
1471 static int F[8*3] = {
1490 static const float h = 0.4472135956f;
1491 static const float r = 0.8944271912f;
1492 static const float s =
float(M_PI/2.5);
1493 static const float o =
float(M_PI/5);
1494 static const float V[13*3] = {
1496 r*
sin(1*s),r*
cos(1*s),-h,
1497 r*
sin(2*s),r*
cos(2*s),-h,
1498 r*
sin(3*s),r*
cos(3*s),-h,
1499 r*
sin(4*s),r*
cos(4*s),-h,
1500 r*
sin(5*s),r*
cos(5*s),-h,
1501 r*
sin(1*s+o),r*
cos(1*s+o),h,
1502 r*
sin(2*s+o),r*
cos(2*s+o),h,
1503 r*
sin(3*s+o),r*
cos(3*s+o),h,
1504 r*
sin(4*s+o),r*
cos(4*s+o),h,
1505 r*
sin(5*s+o),r*
cos(5*s+o),h,
1509 static int F[20*3] = {
1510 0,1,2, 0,2,3, 0,3,4, 0,4,5, 0,5,1,
1511 6,2,1, 2,6,7, 7,3,2, 3,7,8, 8,4,3, 4,8,9, 9,5,4, 5,9,10, 10,1,5, 6,1,10,
1512 11,6,10, 11,10,9, 11,9,8, 11,8,7, 11,7,6
1514 static int DF[12*5] = {
1528 static float N[20*3];
1529 static int FN[20*3];
1530 static int DFN[12*5] = {
1547 compute_face_normals(
V, N, F,
FN, 20, 3);
1600 if (prog.does_use_gamma())
1623 if (!prog.does_context_set_color())
1625 int clr_loc = prog.get_color_index();
1644 if (!prog.does_use_material())
1663 if (!prog.does_use_material())
1796 mask.red_flag = flags[0];
1797 mask.green_flag = flags[1];
1798 mask.blue_flag = flags[2];
1799 mask.alpha_flag = flags[3];
1827 SAFE_STACK_POP(projection_matrix_stack,
"pop_projection_matrix");
1848 if (!prog.does_use_view())
1856 projection_matrix_stack.top() =
P;
1865 if (!prog.does_use_view())
1880bool context::ensure_window_transformation_index(
int&
array_index)
1890 std::string message(
"context::ensure_window_transformation_index() ... attempt to resize window transformation array larger than maximum allowed size of ");
1903 if (!ensure_window_transformation_index(
array_index))
1910 if (!ensure_window_transformation_index(
array_index))
1924 std::string message(
"context::get_window_matrix() ... attempt to query window matrix with array index ");
1926 message +=
" out of range [0,";
1930 return cgv::math::identity4<double>();
1933 dmat4 M = cgv::math::identity4<double>();
1934 M(0, 0) = 0.5*
wt.viewport[2];
1935 M(0, 3) =
M(0, 0) +
wt.viewport[0];
1936 M(1, 1) = 0.5*
wt.viewport[3];
1937 M(1, 3) =
M(1, 1) +
wt.viewport[1];
1938 M(2, 2) = 0.5*(
wt.depth_range[1] -
wt.depth_range[0]);
1939 M(2, 3) =
M(2, 2) +
wt.depth_range[0];
1955 return vec3(
float(x(0) / x(3)),
float(x(1) / x(3)),
float(x(2) / x(3)));
1974 for (
unsigned int c = 0; c < p.
size(); ++c)
1986 int x_offset,
int y_offset)
1994 case 0 : x -= (
int)(floor(w)*0.5f);
break;
1995 case 2 : x -= (
int)floor(w);
break;
1999 case 0 : y -= (
int)(floor(h)*0.3f);
break;
2000 case 4 : y -= (
int)(floor(h)*0.6f);
break;
2024 std::cout <<
"tesselate_arrow not implemented in cgv::render::context" << std::endl;
2029 std::cout <<
"tesselate_arrow not implemented in cgv::render::context" << std::endl;
2034 std::cout <<
"draw_light_source not implemented in cgv::render::context" << std::endl;
2040 internal_format = 0;
2055 std::cerr <<
"no context set when render_component::put_id_void was called" << std::endl;
2061render_buffer_base::render_buffer_base()
2068 mag_filter = TF_LINEAR;
2069 min_filter = TF_LINEAR_MIPMAP_LINEAR;
2070 wrap_s = TW_CLAMP_TO_EDGE;
2071 wrap_t = TW_CLAMP_TO_EDGE;
2072 wrap_r = TW_CLAMP_TO_EDGE;
2075 border_color[0] = 1;
2076 border_color[1] = 1;
2077 border_color[2] = 1;
2078 border_color[3] = 1;
2080 compare_function = CF_LEQUAL;
2081 use_compare_function =
false;
2082 have_mipmaps =
false;
2085void shader_program_base::allow_context_to_set_color(
bool allow)
2087 context_sets_color =
allow;
2093 geometry_shader_input_type = PT_POINTS;
2094 geometry_shader_output_type = PT_POINTS;
2095 geometry_shader_output_count = 1;
2097 auto_detect_uniforms =
true;
2098 auto_detect_vertex_attributes =
true;
2101 uses_material =
false;
2102 uses_lights =
false;
2105 position_index = -1;
2108 context_sets_color =
true;
2109 texcoord_index = -1;
2113void shader_program_base::specify_standard_uniforms(
bool view,
bool material,
bool lights,
bool gamma)
2115 auto_detect_uniforms =
false;
2117 uses_material = material;
2122void shader_program_base::specify_standard_vertex_attribute_names(context& ctx,
bool color,
bool normal,
bool texcoord)
2124 auto_detect_vertex_attributes =
false;
2125 position_index = ctx.get_attribute_location(*
this,
"position");
2126 color_index =
color ? ctx.get_attribute_location(*
this,
"color") : -1;
2127 normal_index = normal ? ctx.get_attribute_location(*
this,
"normal") : -1;
2128 texcoord_index = texcoord ? ctx.get_attribute_location(*
this,
"texcoord") : -1;
2131void shader_program_base::specify_vertex_attribute_names(context& ctx,
const std::string& position,
const std::string&
color,
const std::string& normal,
const std::string& texcoord)
2133 auto_detect_vertex_attributes =
false;
2134 position_index = position.empty() ? -1 : ctx.get_attribute_location(*
this, position);
2135 color_index =
color.empty() ? -1 : ctx.get_attribute_location(*
this,
color);
2136 normal_index = normal.empty() ? -1 : ctx.get_attribute_location(*
this, normal);
2137 texcoord_index = texcoord.empty() ? -1 : ctx.get_attribute_location(*
this, texcoord);
2139bool context::shader_program_link(shader_program_base&
spb)
const
2141 if (
spb.handle == 0)
2143 if (
spb.auto_detect_vertex_attributes) {
2144 spb.position_index = get_attribute_location(
spb,
"position");
2145 spb.color_index = get_attribute_location(
spb,
"color");
2146 spb.normal_index = get_attribute_location(
spb,
"normal");
2147 spb.texcoord_index = get_attribute_location(
spb,
"texcoord");
2148 spb.auto_detect_vertex_attributes =
false;
2150 if (
spb.auto_detect_uniforms) {
2151 spb.uses_lights = get_uniform_location(
spb,
"light_sources[0].light_source_type") != -1;
2152 spb.uses_material = get_uniform_location(
spb,
"material.brdf_type") != -1;
2154 get_uniform_location(
spb,
"modelview_matrix") != -1 ||
2155 get_uniform_location(
spb,
"projection_matrix") != -1 ||
2156 get_uniform_location(
spb,
"inverse_projection_matrix") != -1 ||
2157 get_uniform_location(
spb,
"normal_matrix") != -1 ||
2158 get_uniform_location(
spb,
"inverse_modelview_matrix") != -1 ||
2159 get_uniform_location(
spb,
"inverse_normal_matrix") != -1;
2160 spb.uses_gamma = get_uniform_location(
spb,
"gamma3") != -1 || get_uniform_location(
spb,
"gamma") != -1;
2161 spb.auto_detect_uniforms =
false;
2166bool context::shader_program_enable(shader_program_base&
spb)
2168 if (
spb.is_enabled) {
2170 error(
"context::shader_program_enable() called with program that is currently active", &
spb);
2173 error(
"context::shader_program_enable() called with program that is recursively reactivated", &
spb);
2177 spb.is_enabled =
true;
2181bool context::shader_program_disable(shader_program_base&
spb)
2184 error(
"context::shader_program_disable() called with empty stack", &
spb);
2187 if (!
spb.is_enabled) {
2188 error(
"context::shader_program_disable() called with disabled program", &
spb);
2192 error(
"context::shader_program_disable() called with program that was not on top of shader program stack", &
spb);
2196 spb.is_enabled =
false;
2200bool context::shader_program_destruct(shader_program_base&
spb)
const
2202 if (
spb.is_enabled) {
2203 error(
"context::shader_program_destruct() on shader program that was still enabled", &
spb);
2235 if (aab.is_enabled) {
2236 error(
"context::attribute_array_binding_destruct() on array binding that was still enabled", &aab);
2261bool context::attribute_array_binding_enable(attribute_array_binding_base& aab)
2264 error(
"context::attribute_array_binding_enable() called in not created attribute array binding.", &aab);
2267 if (aab.is_enabled) {
2269 error(
"context::attribute_array_binding_enable() called with array binding that is currently active", &aab);
2272 error(
"context::attribute_array_binding_enable() called with array binding that is recursively reactivated", &aab);
2276 aab.is_enabled =
true;
2280bool context::attribute_array_binding_disable(attribute_array_binding_base& aab)
2283 error(
"context::attribute_array_binding_disable() called with empty stack", &aab);
2286 if (!aab.is_enabled) {
2287 error(
"context::attribute_array_binding_disable() called with disabled array binding", &aab);
2291 error(
"context::attribute_array_binding_disable() called with array binding that was not on top of array binding stack", &aab);
2295 aab.is_enabled =
false;
2312 depth_attached =
false;
2313 std::fill(attached, attached+16,
false);
2316void context::get_buffer_list(
frame_buffer_base&
fbb,
bool& depth_buffer, std::vector<int>& buffers,
int offset)
2318 if (
fbb.enabled_color_attachments.size() == 0) {
2319 for (
int i = 0;
i < 16; ++
i)
2320 if (
fbb.attached[
i])
2321 buffers.push_back(
i + offset);
2324 for (
int i = 0;
i < (
int)
fbb.enabled_color_attachments.size(); ++
i)
2325 if (
fbb.attached[
fbb.enabled_color_attachments[
i]])
2326 buffers.push_back(
fbb.enabled_color_attachments[
i]+offset);
2331bool context::frame_buffer_create(frame_buffer_base&
fbb)
const
2333 if (
fbb.width == -1)
2335 if (
fbb.height == -1)
2340bool context::frame_buffer_attach(frame_buffer_base&
fbb,
const render_buffer_base&
rb,
bool is_depth,
int i)
const
2342 if (
fbb.handle == 0) {
2343 error(
"gl_context::frame_buffer_attach: attempt to attach to frame buffer that is not created", &
fbb);
2346 if (
rb.handle == 0) {
2347 error(
"gl_context::frame_buffer_attach: attempt to attach empty render buffer", &
fbb);
2351 fbb.depth_attached =
true;
2353 fbb.attached[
i] =
true;
2358bool context::frame_buffer_attach(frame_buffer_base&
fbb,
const texture_base& t,
bool is_depth,
int level,
int i,
int z_or_cube_side)
const
2360 if (
fbb.handle == 0) {
2361 error(
"context::frame_buffer_attach: attempt to attach to frame buffer that is not created", &
fbb);
2364 if (t.handle == 0) {
2365 error(
"context::frame_buffer_attach: attempt to attach texture that is not created", &
fbb);
2369 fbb.depth_attached =
true;
2371 fbb.attached[
i] =
true;
2376bool context::frame_buffer_enable(frame_buffer_base&
fbb)
2378 if (
fbb.handle == 0) {
2379 error(
"context::frame_buffer_enable: attempt to enable not created frame buffer", &
fbb);
2382 if (
fbb.is_enabled) {
2384 error(
"context::frame_buffer_enable() called with frame buffer that is currently active", &
fbb);
2387 error(
"context::frame_buffer_enable() called with frame buffer that is recursively reactivated", &
fbb);
2391 fbb.is_enabled =
true;
2395bool context::frame_buffer_disable(frame_buffer_base&
fbb)
2398 error(
"gl_context::frame_buffer_disable called with empty stack", &
fbb);
2402 error(
"gl_context::frame_buffer_disable called with different frame buffer enabled", &
fbb);
2406 fbb.is_enabled =
false;
2410bool context::frame_buffer_destruct(frame_buffer_base&
fbb)
const
2412 if (
fbb.handle == 0) {
2413 error(
"context::frame_buffer_destruct: attempt to destruct not created frame buffer", &
fbb);
2416 if (
fbb.is_enabled) {
2417 error(
"context::frame_buffer_destruct() on frame buffer that was still enabled", &
fbb);
2423std::vector<context_creation_function_type>& ref_context_creation_functions()
2425 static std::vector<context_creation_function_type>
ccfs;
2432 ref_context_creation_functions().push_back(fp);
2435context_factory_registration::context_factory_registration(context_creation_function_type fp)
2444 unsigned int w,
unsigned int h,
2445 const std::string& title,
bool show)
2447 std::vector<context_creation_function_type>&
ccfs = ref_context_creation_functions();
2448 for (
unsigned i=0;
i<
ccfs.size(); ++
i) {
2455 std::cerr <<
"could not create context for given parameters" << std::endl;
2463#include <cgv/base/register.h>
2475#undef SAFE_STACK_POP
virtual bool end()
perform the leave part of the action on the current object
The group class is a node with children.
complete implementation of method actions that only call one method when entering a node
class used to traverse a tree structure
bool traverse(base_ptr start, traverse_callback_handler *tch=0)
traverse a tree starting at given node according to set strategy, order and dest and previously comin...
const data_format * get_format() const
return the component format
cgv::type::func::transfer_const< P, S * >::type get_ptr() const
return a data pointer to type S
the data view gives access to a data array of one, two, three or four dimensions.
reference counted pointer, which can work together with types that are derived from ref_counted,...
bool empty() const
check if pointer is not yet set
matrix of fixed size dimensions
T normalize()
normalize the vector using the L2-Norm and return the length
void zeros()
fill the vector with zeros
A matrix type (full column major storage) The matrix can be loaded directly into OpenGL without need ...
unsigned size() const
number of elements
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
base class for attribute_array_bindings
attribute_array_binding_base()
nothing to be done heremembers
base class for all drawables, which is independent of the used rendering API.
void push_window_transformation_array()
push a copy of the current viewport and depth range arrays defining the window transformations
void tesselate_unit_prism(bool flip_normals=false, bool edges=false)
tesselate a prism
void * add_light_source(const cgv::media::illum::light_source &light, bool enabled=true, bool place_now=false)
add a new light source, enable it if enable is true and place it relative to current model view trans...
virtual void set_blend_func(BlendFunction src_factor, BlendFunction dst_factor)
set the blend function
void enable_shader_file_cache()
enable the usage of the shader file caches
virtual std::ostream & output_stream()
returns an output stream whose output is printed at the current cursor location, which is managed by ...
virtual bool read_frame_buffer(data::data_view &dv, unsigned int x=0, unsigned int y=0, FrameBufferType buffer_type=FB_BACK, cgv::type::info::TypeId type=cgv::type::info::TI_UINT8, data::ComponentFormat cf=data::CF_RGB, int w=-1, int h=-1)=0
read the current frame buffer or a rectangular region of it into the given data view.
void set_blend_func_back_to_front()
set the default blend function for back to front blending
virtual void mul_modelview_matrix(const dmat4 &MV)
multiply given matrix from right to current modelview matrix
virtual void render_pass(RenderPass render_pass=RP_MAIN, RenderPassFlags render_pass_flags=RPF_ALL, void *user_data=0)
perform the given render task
void pop_bg_color()
pop the top of the current background color from the stack
virtual void set_depth_range(const dvec2 &depth_range=dvec2(0, 1), int array_index=-1)
set the current depth range or one of the depth ranges in the window transformation array
vec3 gamma3
per color channel gamma value passed to shader programs that have gamma uniform
virtual bool in_render_process() const =0
return whether the context is currently in process of rendering
virtual void process_text(const std::string &text)
callback method for processing of text from the output stream
virtual void set_color(const rgba &clr)
set the current color
virtual void draw_light_source(const cgv::media::illum::light_source &l, float intensity_scale, float light_scale)
draw a light source with an emissive material
virtual bool is_created() const =0
return whether the context is created
virtual void set_gamma3(const vec3 &_gamma3)
set the current per channel gamma values to single value
virtual void enable_sRGB_framebuffer(bool do_enable=true)
enable or disable sRGB framebuffer
virtual void draw_edges_of_faces(const float *vertices, const float *normals, const float *tex_coords, const int *vertex_indices, const int *normal_indices, const int *tex_coord_indices, int nr_faces, int face_degree, bool flip_normals=false) const =0
pass geometry of given faces to current shader program and generate draw calls to render lines for th...
RenderPassFlags default_render_flags
default render flags with which the main render pass is initialized
void pop_buffer_mask()
pop the top of the current buffer mask from the stack
vec3 get_model_point(int x_window, int y_window) const
compute model space 3D point from the given opengl pixel location (window location)
shader_program_base * get_current_program() const
check for current program, prepare it for rendering and return pointer to it
virtual void error(const std::string &message, const render_component *rc=0) const
error handling
std::stack< render_info > render_pass_stack
store the current render pass
virtual void draw_edges_of_strip_or_fan(const float *vertices, const float *normals, const float *tex_coords, const int *vertex_indices, const int *normal_indices, const int *tex_coord_indices, int nr_faces, int face_degree, bool is_fan, bool flip_normals=false) const =0
pass geometry of given strip or fan to current shader program and generate draw calls to render lines...
virtual GPUVendorID get_gpu_vendor_id() const
device information
void set_current_view(shader_program &prog, bool modelview_deps=true, bool projection_deps=true) const
set the shader program view matrices to the currently enabled view matrices
float current_font_size
store current font size
bool enable_vsync
whether vsync should be enabled
const light_source_status & get_light_source_status(void *handle) const
read access to light source status
void place_light_source(void *handle)
place the given light source relative to current model viel transformation
void tesselate_unit_cube(bool flip_normals=false, bool edges=false)
tesselate a unit cube with extent from [-1,-1,-1] to [1,1,1] with face normals that can be flipped
virtual void get_cursor(int &x, int &y) const
return current cursor location in opengl coordinates with (0,0) in lower left corner
std::stack< BufferMask > buffer_mask_stack
stack of buffer masks
void set_bg_clr_idx(unsigned int idx)
set an indexed background color
virtual void set_buffer_mask(BufferMask mask)
set the buffer mask for depth and color buffers
virtual void draw_strip_or_fan(const float *vertices, const float *normals, const float *tex_coords, const int *vertex_indices, const int *normal_indices, const int *tex_coord_indices, int nr_faces, int face_degree, bool is_fan, bool flip_normals=false) const =0
pass geometry of given strip or fan to current shader program and generate draw calls to render trian...
bool auto_set_lights_in_current_shader_program
whether to automatically set lights in current shader program, defaults to true
float get_bg_accum_alpha() const
return the current alpha value for clearing the accumulation buffer
void set_bg_alpha(float a)
set a user defined background alpha value
virtual void set_blend_func_separate(BlendFunction src_color_factor, BlendFunction dst_color_factor, BlendFunction src_alpha_factor, BlendFunction dst_alpha_factor)
set the blend function separately for color and alpha
size_t light_source_handle
counter to construct light source handles
virtual void on_lights_changed()
helper function to send light update events
context()
init the cursor position to (0,0)
void push_depth_test_state()
push a copy of the current depth test state onto the stack saved attributes: depth test enablement,...
virtual void tesselate_arrow(double length=1, double aspect=0.1, double rel_tip_radius=2.0, double tip_aspect=0.3, int res=25, bool edges=false)
tesselate an arrow from the origin in z-direction
void put_bg_color(float *rgba) const
copy the current background rgba color into the given float array
std::stack< shader_program_base * > shader_program_stack
stack of currently enabled shader programs
void push_blend_state()
push a copy of the current blend state onto the stack saved attributes: blend enablement,...
bool is_light_source_enabled(void *handle)
check whether light source is enabled
virtual void disable_depth_test()
disable the depth test
void pop_bg_depth()
pop the top of the current background depth value from the stack
int get_bg_stencil() const
return the current stencil value for clearing the background
virtual float get_current_font_size() const
return the size in pixels of the currently enabled font face
void pop_blend_state()
pop the top of the current culling state from the stack
virtual unsigned int get_width() const =0
return the width of the window
const cgv::media::illum::surface_material * get_current_material() const
return pointer to current material or nullptr if no current material is available
void set_bg_accum_alpha(float a)
set a user defined background alpha value for the accumulation buffer
float get_gamma() const
query current gamma computed as average over gamma3 per channel values
bool disable_light_source(void *handle)
disable a given light source and return whether there existed a light source with given handle
int current_background
current back ground color index
void set_blend_func_front_to_back()
set the default blend function for front to back blending
virtual RenderPass get_render_pass() const
return the current render pass
void pop_depth_test_state()
pop the top of the current depth test state from the stack
void tesselate_unit_sphere(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a sphere of radius 1
virtual RenderPassFlags get_render_pass_flags() const
return the current render pass flags
void tesselate_unit_cylinder(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a cylinder of radius 1
float get_bg_alpha() const
return the current alpha value for clearing the background
bool write_frame_buffer_to_image(const std::string &file_name, data::ComponentFormat cf=data::CF_RGB, FrameBufferType buffer_type=FB_BACK, unsigned int x=0, unsigned int y=0, int w=-1, int h=-1, float depth_offset=0.9f, float depth_scale=10.0f)
write the content of the frame buffer to an image file.
unsigned int get_bg_clr_idx() const
return the current index of the background color
void tesselate_unit_tetrahedron(bool flip_normals=false, bool edges=false)
tesselate a tetrahedron
virtual bool recreate_context()
recreate context based on current context config settings
virtual void configure_new_child(cgv::base::base_ptr child)
helper method to integrate a new child
virtual void set_bg_color(vec4 rgba)
set a user defined background color
virtual void set_depth_test_state(DepthTestState state)
set the depth test state
void tesselate_unit_octahedron(bool flip_normals=false, bool edges=false)
tesselate a octahedron
size_t get_nr_enabled_light_sources() const
return the number of light sources
virtual unsigned int get_height() const =0
return the height of the window
vec3 get_gamma3() const
query current per color channel gamma
void set_default_light_source(size_t i, const cgv::media::illum::light_source &ls)
set i-th default light source
virtual void disable_blending()
disable blending
BufferMask get_buffer_mask() const
return the current buffer mask
void push_cull_state()
push a copy of the current culling state onto the stack saved attributes: cull face enablement,...
virtual void enable_font_face(media::font::font_face_ptr font_face, float font_size)
enable the given font face with the given size in pixels
dmat4 get_modelview_projection_window_matrix(unsigned array_index=0) const
return a homogeneous 4x4 matrix to transfrom from model to window coordinates, i.e....
dmat4 get_window_matrix(unsigned array_index=0) const
return a homogeneous 4x4 matrix to transform clip to window coordinates
void pop_bg_stencil()
pop the top of the current background stencil value from the stack
virtual void draw_faces(const float *vertices, const float *normals, const float *tex_coords, const int *vertex_indices, const int *normal_indices, const int *tex_coord_indices, int nr_faces, int face_degree, bool flip_normals=false) const =0
pass geometry of given faces to current shader program and generate draw calls to render triangles
std::stack< dmat4 > modelview_matrix_stack
keep two matrix stacks for model view and projection matrices
vec3 get_light_eye_position(const cgv::media::illum::light_source &light, bool place_now) const
helper function to place lights
void push_bg_stencil()
push a copy of the current background stencil value onto the stack
virtual unsigned get_max_nr_enabled_light_sources() const
return maximum number of light sources, that can be enabled in parallel
virtual void pop_window_transformation_array()
restore previous viewport and depth range arrays defining the window transformations
const cgv::media::illum::light_source & get_default_light_source(size_t i) const
return i-th default light source
bool use_shader_file_cache
whether to use the caching facilities of shader_program and shader_code to store loaded shader file c...
virtual void set_color_mask(bvec4 flags)
set the color buffer mask
virtual void set_material(const cgv::media::illum::surface_material &mat)
set the current material
DepthTestState get_depth_test_state() const
return the current depth test state
int nr_identations
current number of indentations
void tesselate_unit_dodecahedron(bool flip_normals=false, bool edges=false)
tesselate a dodecahedron
bool auto_set_material_in_current_shader_program
whether to automatically set material in current shader program, defaults to true
void set_current_lights(shader_program &prog) const
set the shader program lights to the currently enabled lights
virtual void tesselate_box(const cgv::media::axis_aligned_box< double, 3 > &B, bool flip_normals, bool edges=false) const
tesselate an axis aligned box
bool enable_light_source(void *handle)
enable a given light source and return whether there existed a light source with given handle
virtual void * get_render_pass_user_data() const
return the current render pass user data
void tesselate_unit_disk(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a circular disk of radius 1
std::stack< float > bg_depth_stack
stack of background depth values
virtual void enable_depth_test()
enable the depth test
bool support_compatibility_mode
whether to support view and lighting management of compatibility mode, defaults to true
void set_current_gamma(shader_program &prog) const
set the shader program gamma values
void tesselate_unit_torus(float minor_radius=0.2f, int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a torus with major radius of one and given minor radius
vec4 get_bg_color() const
return the current color value for clearing the background
void pop_projection_matrix()
see push_P for an explanation
std::stack< attribute_array_binding_base * > attribute_array_binding_stack
stack of currently enabled attribute array binding
BlendState get_blend_state() const
return the current blend state
virtual void set_cull_state(CullingMode culling_mode)
set the culling state
void tesselate_unit_icosahedron(bool flip_normals=false, bool edges=false)
tesselate an icosahedron
virtual void set_depth_func(CompareFunction func)
set the depth test function
void set_light_source(void *handle, const cgv::media::illum::light_source &light, bool place_now=true)
set light source newly
std::stack< DepthTestState > depth_test_state_stack
stack of depth test states
std::stack< CullingMode > cull_state_stack
stack of culling mode states
void push_bg_depth()
push a copy of the current background depth value onto the stack
bool get_depth_mask() const
get the depth buffer mask
void disable_shader_file_cache()
disable the usage of the shader file caches
bool phong_shading
whether to use phong shading
virtual void push_pixel_coords()=0
use this to push new modelview and new projection matrices onto the transformation stacks such that x...
void push_projection_matrix()
same as push_V but for the projection matrix - a different matrix stack is used.
bvec4 get_color_mask() const
get the color buffer mask
const rgba & get_color() const
return current color
bool is_shader_file_cache_enabled() const
whether the shader file caches are enabled
bool current_material_is_textured
store flag to tell whether current material is textured
void push_bg_accum_color()
push a copy of the current background accumulation color onto the stack
virtual media::font::font_face_ptr get_current_font_face() const
return the currently enabled font face
virtual void set_projection_matrix(const dmat4 &P)
set the current projection matrix, which transforms from eye to clip space
rgba current_color
current color value
static const unsigned nr_default_light_sources
number of default light sources
cgv::media::illum::light_source default_light_source[nr_default_light_sources]
default light sources
std::stack< int > bg_stencil_stack
stack of background stencil values
virtual dmat4 get_projection_matrix() const =0
return homogeneous 4x4 projection matrix, which transforms from eye to clip space
dmat4 get_modelview_projection_device_matrix() const
return matrix to transfrom from model to device coordinates, i.e. the product of modelview,...
std::stack< vec4 > bg_accum_color_stack
stack of background accumulation colors
virtual void set_cursor(int x, int y)
flush the output_stream and set a new cursor position given in opengl coordinates with (0,...
void pop_bg_accum_color()
pop the top of the current background accumulation color from the stack
virtual void set_bg_stencil(int s)
set a user defined background stencil value
virtual void put_cursor_coords(const vecn &p, int &x, int &y) const
transform point p in current world coordinates into opengl coordinates with (0,0) in lower left corne...
virtual void set_bg_accum_color(vec4 rgba)
set a user defined background color for the accumulation buffer
virtual void set_default_render_pass_flags(RenderPassFlags)
return the default render pass flags
float get_bg_depth() const
return the current depth value for clearing the background
const std::vector< window_transformation > & get_window_transformation_array() const
return the current window transformation array
virtual unsigned get_max_window_transformation_array_size() const =0
query the maximum number of supported window transformations, which is at least 1
int x_offset
offset in x and y direction where text starts
void put_bg_accum_color(float *rgba) const
copy the current accumulation background rgba color into the given float array
std::map< void *, std::pair< cgv::media::illum::light_source, light_source_status > > light_sources
map handle to light source and light source status information
virtual void set_textured_material(const textured_material &mat)
set the current material
std::stack< std::vector< window_transformation > > window_transformation_stack
keep stack of window transformations
int cursor_x
current cursor location for textual output
vec4 get_bg_accum_color() const
return the current color value for clearing the accumulation buffer
const cgv::media::illum::light_source & get_light_source(void *handle) const
read access to light source
virtual bool make_current() const =0
make the current context current if possible
bool draw_in_compatibility_mode
whether to do all drawing in compatibility mode, only possible if support_compatibility_mode is true,...
virtual void set_blend_state(BlendState state)
set the complete blend state
bool remove_light_source(void *handle)
remove a light source by handle and whether it existed
bool sRGB_framebuffer
whether to use opengl option to support sRGB framebuffer
virtual RenderPassFlags get_default_render_pass_flags() const
return the default render pass flags
virtual void set_bg_depth(float d)
set a user defined background depth value
void set_gamma(float _gamma)
set the current per channel gamma values to single value
virtual void enable_blending()
enable blending
virtual dmat4 get_modelview_matrix() const =0
return homogeneous 4x4 viewing matrix, which transforms from world to eye space
vec3 get_light_eye_spot_direction(const cgv::media::illum::light_source &light, bool place_now) const
helper function to place spot lights
void set_current_material(shader_program &prog) const
set the shader program material to the currently enabled material
void pop_cull_state()
pop the top of the current culling state from the stack
virtual void draw_text(const std::string &text)
draw some text at cursor position and update cursor position
void pop_modelview_matrix()
see push_V for an explanation
virtual ~context()
virtual destructor
void * default_light_source_handles[nr_default_light_sources]
handles of default light sources
void push_modelview_matrix()
push the current viewing matrix onto a matrix stack for viewing matrices.
std::stack< frame_buffer_base * > frame_buffer_stack
stack of currently enabled frame buffers
virtual void pop_pixel_coords()=0
pop previously pushed transformation matrices from modelview and projection stacks
bool at_line_begin
store whether we are at the beginning of the line
size_t get_nr_light_sources() const
return the number of light sources
void tesselate_unit_square(bool flip_normals=false, bool edges=false)
tesselate a unit square in the xy-plane with texture coordinates
bool auto_set_view_in_current_shader_program
whether to automatically set viewing matrixes in current shader program, defaults to true
bool debug_render_passes
whether to debug render passes
std::vector< void * > enabled_light_source_handles
keep track of enabled light source handles
void tesselate_unit_cone(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a cone of radius 1
CullingMode get_cull_state() const
return the current culling state
virtual void mul_projection_matrix(const dmat4 &P)
multiply given matrix from right to current projection matrix
virtual void set_viewport(const ivec4 &viewport, int array_index=-1)
set the current viewport or one of the viewports in the window transformation array
virtual void post_redraw()=0
the context will be redrawn when the system is idle again
const cgv::media::illum::surface_material * current_material_ptr
store pointer to current material
virtual void set_modelview_matrix(const dmat4 &MV)
set the current modelview matrix, which transforms from world to eye space
void push_bg_color()
push a copy of the current background color onto the stack
void * get_enabled_light_source_handle(size_t i) const
access to handle of i-th light source
void push_buffer_mask()
push a copy of the current buffer mask onto the stack saved attributes: depth mask,...
virtual void enable_phong_shading()
enable phong shading with the help of a shader (enabled by default)
void set_debug_render_passes(bool _debug)
set flag whether to debug render passes
cgv::media::font::font_face_ptr current_font_face
store current font
cgv::signal::callback_stream out_stream
use a callback stream to write text to the opengl context
std::stack< vec4 > bg_color_stack
stack of background colors
unsigned get_render_pass_recursion_depth() const
return current render pass recursion depth
std::stack< BlendState > blend_state_stack
stack of blend states
virtual void set_depth_mask(bool flag)
set the depth buffer mask
bool auto_set_gamma_in_current_shader_program
whether to automatically set gamma in current shader program, defaults to true
void set_context(context *_ctx)
set the current focus context, this should only be called by the context itself
virtual void finish_draw(context &)
this method is called when the current drawable is left in a tree traversal that calls the draw metho...
virtual void draw(context &)
overload to draw the content of this drawable
virtual void after_finish(context &)
this method is called in one pass over all drawables after finish frame
virtual void finish_frame(context &)
this method is called in one pass over all drawables after drawing
virtual bool init(context &)
this method is called after creation or recreation of the context, return whether all necessary funct...
base interface for framebuffer
frame_buffer_base()
initialize members
base interface for all render components
virtual bool is_created() const
return whether component has been created
const context * ctx_ptr
keep pointer to my context
render_component()
initialize members
void put_id_void(void *ptr) const
copy the rendering api specific id the component to the memory location of the given pointer.
base interface for shader programs
shader_program_base()
initializes members
a shader program combines several shader code fragments to a complete definition of the shading pipel...
bool set_uniform(const context &ctx, const std::string &name, const T &value, bool generate_error=false)
Set the value of a uniform by name, where the type can be any of int, unsigned, float,...
bool set_attribute(const context &ctx, const std::string &name, const T &value)
set constant default value of a vertex attribute by attribute name, if name does not specify an attri...
bool set_textured_material_uniform(const context &ctx, const std::string &name, const textured_material &material, bool generate_error=false)
set a uniform of type textured_material
bool set_light_uniform(const context &ctx, const std::string &name, const cgv::media::illum::light_source &light, bool generate_error=false)
set a uniform of type light source
int get_uniform_location(const context &ctx, const std::string &name) const
query location index of an uniform
bool set_material_uniform(const context &ctx, const std::string &name, const cgv::media::illum::surface_material &material, bool generate_error=false)
set a uniform of type material
texture_base(TextureType _tt=TT_UNDEF)
initialize members
class that extends obj_material with the management of textures
vertex_buffer_base()
initialize members
VertexBufferType type
buffer type defaults to VBT_VERTICES
VertexBufferUsage usage
usage defaults to VBU_STATIC_DRAW
defines a symmetric view with the following quantities:
the base namespace holds the base hierarchy, support for plugin registration and signals
data::ref_ptr< group, true > group_ptr
ref counted pointer to a node
void register_object(base_ptr object, const std::string &options)
register an object and send event to all current registration ref_listeners()
ComponentFormat
define standard formats, which should be used to avoid wrong assignment of component names
@ CF_D
color format with components B, G, R and A
RenderAPI
enumeration of rendering APIs which can be queried from the context
CullingMode
different culling modes
void register_context_factory(context_creation_function_type fp)
registration context creation functions
BlendFunction
different blend functions
TextAlignment
different text alignments
std::string get_render_pass_name(RenderPass rp)
convert render pass type into string
TextureFilter
different texture filter
render_config_ptr get_render_config()
return a pointer to the current shader configuration
TextureWrap
different texture wrap modes
FrameBufferType
different frame buffer types which can be combined together with or
MaterialSide
different sides of a material
context * create_context(RenderAPI api, unsigned int w, unsigned int h, const std::string &title, bool show)
construct a context of the given size.
@ VBU_STATIC_DRAW
Modified once and used many times; Modified by the application, and used as the source for GL drawing...
TextureCubeSides
the six different sides of a cube
void tesselate_unit_dodecahedron_or_icosahedron(context &c, bool dual, bool flip_normals, bool edges)
render an icosahedron at a given center.
PrimitiveType
different primitive types
@ VBT_VERTICES
The buffer contains vertices and will be bound to GL_ARRAY_BUFFER.
RenderPass
Enumeration of different render passes, which can be queried from the context and used to specify a n...
TextureType
different texture types
RenderPassFlags
available flags that can be queried from the context and set for a new render pass
@ RPF_DRAWABLES_FINISH_FRAME
whether to call finish frame method of drawables
@ RPF_SET_LIGHTS
whether to define default lights
@ RPF_DRAWABLES_DRAW
whether to call draw and finish_draw methods of drawables
@ RPF_DRAWABLES_AFTER_FINISH
whether to call after finish method of drawables
@ RPF_DEFAULT
all flags set, defines default render pass
@ RPF_NONE
no frame initialization is performed
@ RPF_HANDLE_SCREEN_SHOT
whether to perform a screen shot if this was scheduled
@ RPF_DRAW_TEXTUAL_INFO
whether to draw textual information
CompareFunction
different comparison functions used for depth testing or texture comparisons
GPUVendorID
IDs for GPU vendors.
@ TI_FLT32
floating point type stored in 16 bits
@ TI_UINT8
signed integer stored in 64 bits
std::string to_string(const std::string &v, unsigned int w, unsigned int p, bool)
specialization of conversion from string to strings
cgv::math::fvec< float, 4 > vec4
declare type of 4d single precision floating point vectors (used for homogeneous coordinates)
cgv::media::color< float, cgv::media::RGB, cgv::media::OPACITY > rgba
declare rgba color type with 32 bit components
cgv::math::fvec< int32_t, 4 > ivec4
declare type of 4d 32 bit integer vectors
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::math::fvec< bool, 4 > bvec4
declare type of 4d boolean vectors
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
cgv::math::fvec< double, 2 > dvec2
declare type of 2d double precision floating point vectors
Represents a blend state used to configure fragment blending.
BlendFunction dst_color
the destination color (rgb) factor
BlendFunction dst_alpha
the destination alpha factor
BlendFunction src_alpha
the source alpha factor
BlendFunction src_color
the source color (rgb) factor
Represents a buffer mask used to mask depth and color buffer outputs.
Represents a depth test state used to configure depth testing.
status information of light sources
information necessary for a rendering pass
configuration object used to define context parameters that need to be set already at creation time
bool multi_sample_buffer
default: false
bool stencil_buffer
default: false
int version_minor
default: -1 ... minor version of maximum supported OpenGL version
int depth_bits
default: -1
bool double_buffer
default: true
int version_major
default: -1 ... major version of maximum supported OpenGL version
context_config()
construct config with default parameters
bool debug
default: false in release and true in debug version
bool forward_compatible
default: false
bool stereo_buffer
default: false
bool alpha_buffer
default: false
bool self_reflect(cgv::reflect::reflection_handler &srh)
reflect the shader_path member
bool core_profile
default: true
int stencil_bits
default: -1
int nr_multi_samples
default: -1
bool accumulation_buffer
default: false
int accumulation_bits
default: -1
bool depth_buffer
default: true
configuration object used to define render view creation parameters including error handling configur...
int window_width
default: 640
render_config()
construct config with default parameters
bool dialog_on_error
default: true (only in case a gui_driver, which supports this, is loaded)
bool self_reflect(cgv::reflect::reflection_handler &srh)
reflect the shader_path member
int fullscreen_monitor
default: -1 ... no fullscreen
int window_height
default: 480
bool abort_on_error
default: false
std::string get_type_name() const
return "render_config"
bool show_error_on_console
default: true