5#ifndef _USE_MATH_DEFINES
6 #define _USE_MATH_DEFINES 1
12#include <cgv/defines/deprecated.h>
13#include <cgv/data/data_view.h>
14#include <cgv/math/fmat.h>
15#include <cgv/math/fvec.h>
16#include <cgv/math/mat.h>
17#include <cgv/math/vec.h>
18#include <cgv/media/axis_aligned_box.h>
19#include <cgv/media/font/font.h>
20#include <cgv/media/illum/light_source.h>
21#include <cgv/media/illum/phong_material.h>
22#include <cgv/media/illum/textured_surface_material.h>
23#include <cgv/signal/callback_stream.h>
42 int max_render_buffer_size = -1;
65 unsigned nr_columns : 4;
66 bool is_row_major : 1;
72 type_descriptor(
cgv::type::info::TypeId _coordinate_type,
bool _normalize =
false) : coordinate_type(_coordinate_type), element_type(ET_VALUE), nr_rows(1), nr_columns(1), is_row_major(false), is_array(false), normalize(_normalize) {}
74 type_descriptor(
cgv::type::info::TypeId _coordinate_type,
unsigned _nr_entries,
bool _normalize =
false) : coordinate_type(_coordinate_type), element_type(ET_VECTOR), nr_rows(_nr_entries), nr_columns(1), is_row_major(false), is_array(false), normalize(_normalize) {}
76 type_descriptor(
cgv::type::info::TypeId _coordinate_type,
unsigned _nr_rows,
unsigned _nr_cols,
bool _is_row_major,
bool _normalize =
false) : coordinate_type(_coordinate_type), element_type(ET_MATRIX), nr_rows(_nr_rows), nr_columns(_nr_cols), is_row_major(_is_row_major), is_array(false), normalize(_normalize) {}
78 type_descriptor(
const type_descriptor& td,
bool _is_array) : coordinate_type(td.coordinate_type), element_type(td.element_type), nr_rows(td.nr_rows), nr_columns(td.nr_columns), is_row_major(td.is_row_major), normalize(td.normalize), is_array(_is_array) {}
80 operator int()
const {
return *
reinterpret_cast<const int*
>(
this); }
86extern CGV_API std::ostream&
operator << (std::ostream&,
const type_descriptor&);
210 BF_ONE_MINUS_SRC_COLOR,
212 BF_ONE_MINUS_DST_COLOR,
214 BF_ONE_MINUS_SRC_ALPHA,
216 BF_ONE_MINUS_DST_ALPHA,
218 BF_ONE_MINUS_CONSTANT_COLOR,
220 BF_ONE_MINUS_CONSTANT_ALPHA,
221 BF_SRC_ALPHA_SATURATE,
223 BF_ONE_MINUS_SRC1_COLOR,
225 BF_ONE_MINUS_SRC1_ALPHA
232 TW_CLAMP_TO_EDGE = 2,
233 TW_CLAMP_TO_BORDER = 3,
235 TW_MIRROR_CLAMP_TO_EDGE = 5,
236 TW_MIRROR_CLAMP_TO_BORDER = 6,
237 TW_MIRRORED_REPEAT = 7,
248 TF_NEAREST_MIPMAP_NEAREST = 2,
249 TF_LINEAR_MIPMAP_NEAREST = 3,
250 TF_NEAREST_MIPMAP_LINEAR = 4,
251 TF_LINEAR_MIPMAP_LINEAR = 5,
266 TT_MULTISAMPLE_2D_ARRAY,
287 PT_LINE_STRIP_ADJACENCY,
290 PT_TRIANGLES_ADJACENCY,
292 PT_TRIANGLE_STRIP_ADJACENCY,
353class CGV_API context;
360 void* internal_format;
375 template <typename T>
383 unsigned nr_multi_samples = 0;
384 render_buffer_base();
398 float border_color[4];
400 bool use_compare_function;
403 unsigned nr_multi_samples = 5;
404 bool fixed_sample_locations =
true;
415 friend class context;
417 bool auto_detect_uniforms;
418 bool auto_detect_vertex_attributes;
426 std::map<std::string, int> uniform_locations;
431 bool context_sets_color;
438 int geometry_shader_output_count;
442 void specify_standard_uniforms(
bool view,
bool material,
bool lights,
bool gamma);
443 void specify_standard_vertex_attribute_names(context& ctx,
bool color =
true,
bool normal =
true,
bool texcoord =
true);
444 void specify_vertex_attribute_names(context& ctx,
const std::string& position,
const std::string& color =
"",
const std::string& normal =
"",
const std::string& texcoord =
"");
446 bool does_use_view()
const {
return uses_view; }
447 bool does_use_material()
const {
return uses_material; }
448 bool does_use_lights()
const {
return uses_lights; }
449 bool does_use_gamma()
const {
return uses_gamma; }
452 void allow_context_to_set_color(
bool allow);
453 int get_position_index()
const {
return position_index; }
454 int get_color_index()
const {
return color_index; }
455 bool does_context_set_color()
const {
return context_sets_color; }
456 int get_normal_index()
const {
return normal_index; }
457 int get_texcoord_index()
const {
return texcoord_index; }
465 friend class context;
531 friend class context;
533 std::vector<int> enabled_color_attachments;
543enum ShaderType { ST_DETECT, ST_COMPUTE, ST_VERTEX, ST_TESS_CONTROL, ST_TESS_EVALUATION, ST_GEOMETRY, ST_FRAGMENT, ST_TASK, ST_MESH };
559 FB_BACK_LEFT = FB_BACK+FB_LEFT,
560 FB_BACK_RIGHT = FB_BACK+FB_RIGHT,
561 FB_FRONT_LEFT = FB_FRONT+FB_LEFT,
562 FB_FRONT_RIGHT = FB_FRONT+FB_RIGHT
566class CGV_API texture;
567class CGV_API render_buffer;
568class CGV_API frame_buffer;
569class CGV_API shader_code;
570class CGV_API shader_program;
677 friend class CGV_API attribute_array_manager;
678 friend class CGV_API render_component;
679 friend class CGV_API texture;
680 friend class CGV_API render_buffer;
681 friend class CGV_API frame_buffer;
682 friend class CGV_API shader_code;
683 friend class CGV_API shader_program;
684 friend class CGV_API attribute_array_binding;
685 friend class CGV_API vertex_buffer;
724 friend class shader_program_base;
797 vec3 eye_spot_direction;
798 int light_source_index;
805 std::map<void*, std::pair<cgv::media::illum::light_source, light_source_status> >
light_sources;
857 virtual void draw_text(
const std::string& text);
859 virtual void destruct_render_objects();
860 virtual void put_id(
void* handle,
void* ptr)
const = 0;
867 virtual bool texture_replace_from_buffer(
texture_base& tb,
int x,
int y,
int z_or_cube_side,
int x_buffer,
int y_buffer,
unsigned int width,
unsigned int height,
int level)
const = 0;
870 virtual bool texture_generate_mipmaps (
texture_base& tb,
unsigned int dim)
const = 0;
871 virtual bool texture_destruct (
texture_base& tb)
const = 0;
872 virtual bool texture_set_state (
const texture_base& tb)
const = 0;
873 virtual bool texture_enable (
texture_base& tb,
int tex_unit,
unsigned int nr_dims)
const = 0;
874 virtual bool texture_disable (
texture_base& tb,
int tex_unit,
unsigned int nr_dims)
const = 0;
875 virtual bool texture_bind_as_image (
texture_base& tb,
int tex_unit,
int level,
bool bind_array,
int layer,
AccessType access)
const = 0;
889 virtual int frame_buffer_get_max_nr_color_attachments()
const = 0;
890 virtual int frame_buffer_get_max_nr_draw_buffers()
const = 0;
892 virtual bool shader_code_create (render_component& sc,
ShaderType st,
const std::string& source)
const = 0;
893 virtual bool shader_code_compile (render_component& sc)
const = 0;
894 virtual void shader_code_destruct(render_component& sc)
const = 0;
896 virtual bool shader_program_create (shader_program_base& spb)
const = 0;
897 virtual void shader_program_attach(shader_program_base& spb,
const render_component& sc)
const = 0;
898 virtual void shader_program_detach(shader_program_base& spb,
const render_component& sc)
const = 0;
899 virtual bool shader_program_link(shader_program_base& spb)
const;
900 virtual bool shader_program_set_state(shader_program_base& spb)
const = 0;
901 virtual bool shader_program_enable (shader_program_base& spb);
902 virtual bool shader_program_disable(shader_program_base& spb);
903 virtual bool shader_program_destruct(shader_program_base& spb)
const;
904 virtual void shader_program_set_uniform_locations(shader_program_base& spb)
const;
905 virtual bool shader_program_get_active_uniforms(shader_program_base& spb, std::vector<std::string>& names)
const = 0;
906 virtual void shader_program_inspect_variables(shader_program_base& spb,
ProgramVariableKind kind, std::vector<program_variable_info>& Vs,
bool get_location,
bool get_value)
const = 0;
907 virtual int get_uniform_location(
const shader_program_base& spb,
const std::string& name)
const = 0;
908 virtual bool set_uniform_void(shader_program_base& spb,
int loc,
type_descriptor value_type,
const void* value_ptr)
const = 0;
909 virtual bool set_uniform_array_void(shader_program_base& spb,
int loc,
type_descriptor value_type,
const void* value_ptr,
size_t nr_elements)
const = 0;
910 virtual int get_uniform_block_index(
const shader_program_base& spb,
const std::string& name)
const = 0;
911 virtual bool set_uniform_block_binding(shader_program_base& spb,
int index,
int binding)
const = 0;
912 virtual int get_attribute_location(
const shader_program_base& spb,
const std::string& name)
const = 0;
913 virtual bool set_attribute_void(shader_program_base& spb,
int loc,
type_descriptor value_type,
const void* value_ptr)
const = 0;
926 virtual bool vertex_buffer_create(
vertex_buffer_base& vbb,
const void* array_ptr,
size_t size_in_bytes)
const = 0;
927 virtual bool vertex_buffer_resize(
vertex_buffer_base& vbb,
const void* array_ptr,
size_t size_in_bytes)
const = 0;
928 virtual bool vertex_buffer_clear(
vertex_buffer_base& vbb,
size_t offset,
size_t size_in_bytes)
const = 0;
929 virtual bool vertex_buffer_replace(
vertex_buffer_base& vbb,
size_t offset,
size_t size_in_bytes,
const void* array_ptr)
const = 0;
931 virtual bool vertex_buffer_copy_back(
const vertex_buffer_base& vbb,
size_t offset,
size_t size_in_bytes,
void* array_ptr)
const = 0;
939 virtual void error(
const std::string& message,
const render_component* rc = 0)
const;
947 virtual void init_render_pass();
949 virtual void draw_textual_info();
951 virtual void perform_screen_shot();
953 virtual void finish_render_pass();
1020 virtual void resize(
unsigned int width,
unsigned int height) = 0;
1040 unsigned int x = 0,
unsigned int y = 0,
1044 int w = -1,
int h = -1) = 0;
1049 const std::string& file_name,
1052 unsigned int x = 0,
unsigned int y = 0,
1053 int w = -1,
int h = -1,
1054 float depth_offset = 0.9f,
float depth_scale = 10.0f);
1113 virtual void clear_background(
bool color_flag,
bool depth_flag,
bool stencil_flag =
false,
bool accum_flag =
false) = 0;
1137 DEPRECATED(
"deprecated and ignored.") virtual
void disable_phong_shading();
1138 DEPRECATED(
"deprecated, use set_material instead.") virtual
void enable_material(const
cgv::media::illum::phong_material& mat =
cgv::media::illum::phong_material::get_default(),
MaterialSide ms = MS_FRONT_AND_BACK,
float alpha = 1);
1139 DEPRECATED(
"deprecated and ignored.") virtual
void disable_material(const
cgv::media::illum::phong_material& mat =
cgv::media::illum::phong_material::get_default());
1140 DEPRECATED(
"deprecated, use enable_material(textured_surface_material) instead.") virtual
void enable_material(const
textured_material& mat,
MaterialSide ms = MS_FRONT_AND_BACK,
float alpha = 1);
1151 virtual void enable_sRGB_framebuffer(
bool do_enable =
true);
1155 void begin_attribute_less_rendering();
1157 void end_attribute_less_rendering();
1159 const rgba& get_color()
const;
1161 virtual void set_color(
const rgba& clr);
1177 void set_current_view(shader_program& prog,
bool modelview_deps =
true,
bool projection_deps =
true)
const;
1191 virtual void enumerate_program_uniforms(shader_program& prog, std::vector<std::string>& names, std::vector<int>* locations_ptr = 0, std::vector<int>* sizes_ptr = 0, std::vector<int>* types_ptr = 0,
bool show =
false)
const = 0;
1193 virtual void enumerate_program_attributes(shader_program& prog, std::vector<std::string>& names, std::vector<int>* locations_ptr = 0, std::vector<int>* sizes_ptr = 0, std::vector<int>* types_ptr = 0,
bool show =
false)
const = 0;
1198 DEPRECATED(
"deprecated, use add_light_source instead.") void* enable_light(const
cgv::media::illum::light_source& light) {
return add_light_source(light); }
1199 DEPRECATED(
"deprecated, use enable_light_source instead.") void disable_light(
void* handle) { disable_light_source(handle); }
1200 DEPRECATED(
"deprecated, use get_max_nr_enabled_light_sources instead.") unsigned get_max_nr_lights()
const {
return get_max_nr_enabled_light_sources(); }
1202 size_t get_nr_light_sources()
const;
1206 bool remove_light_source(
void* handle);
1210 const light_source_status& get_light_source_status(
void* handle)
const;
1214 void place_light_source(
void* handle);
1217 virtual unsigned get_max_nr_enabled_light_sources()
const;
1219 size_t get_nr_enabled_light_sources()
const;
1221 void* get_enabled_light_source_handle(
size_t i)
const;
1223 bool is_light_source_enabled(
void* handle);
1225 bool enable_light_source(
void* handle);
1227 bool disable_light_source(
void* handle);
1245 virtual std::ostream& output_stream();
1247 virtual void set_cursor(
int x,
int y);
1249 virtual void get_cursor(
int& x,
int& y)
const;
1252 DEPRECATED(
"deprecated, use get_cursor_coords.") virtual
void put_cursor_coords(const
vecn& p,
int& x,
int& y) const;
1255 virtual
ivec2 get_cursor_coords(const
vec3& p) const;
1261 DEPRECATED(
"deprecated, use set_cursor(vec3, ...).") virtual
void set_cursor(const
vecn& pos,
1263 int x_offset=0,
int y_offset=0);
1269 virtual
void set_cursor(const
vec3& pos,
1271 ivec2 offset = { 0 });
1278 const float* vertices,
const float* normals,
const float* tex_coords,
1279 const int* vertex_indices,
const int* normal_indices,
const int* tex_coord_indices,
1280 int nr_faces,
int face_degree,
bool flip_normals =
false)
const = 0;
1283 const float* vertices,
const float* normals,
const float* tex_coords,
1284 const int* vertex_indices,
const int* normal_indices,
const int* tex_coord_indices,
1285 int nr_faces,
int face_degree,
bool is_fan,
bool flip_normals =
false)
const = 0;
1288 const float* vertices,
const float* normals,
const float* tex_coords,
1289 const int* vertex_indices,
const int* normal_indices,
const int* tex_coord_indices,
1290 int nr_faces,
int face_degree,
bool flip_normals =
false)
const = 0;
1293 const float* vertices,
const float* normals,
const float* tex_coords,
1294 const int* vertex_indices,
const int* normal_indices,
const int* tex_coord_indices,
1295 int nr_faces,
int face_degree,
bool is_fan,
bool flip_normals =
false)
const = 0;
1306 void tesselate_unit_disk(
int resolution = 25,
bool flip_normals =
false,
bool edges =
false);
1308 void tesselate_unit_cone(
int resolution = 25,
bool flip_normals =
false,
bool edges =
false);
1322 void tesselate_unit_torus(
float minor_radius = 0.2f,
int resolution = 25,
bool flip_normals =
false,
bool edges =
false);
1331 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);
1333 virtual void tesselate_arrow(
const dvec3& start,
const dvec3& end,
double aspect = 0.1f,
double rel_tip_radius = 2.0f,
double tip_aspect = 0.3f,
int res = 25,
bool edges =
false);
1419 DEPRECATED(
"deprecated: use push_modelview_matrix() instead.") void push_V() { push_modelview_matrix(); }
1420 DEPRECATED(
"deprecated: use pop_modelview_matrix() instead.") void pop_V() { pop_modelview_matrix(); }
1421 DEPRECATED(
"deprecated: use get_projection_matrix() instead.") dmatn get_P()
const {
return dmatn(4, 4, &get_projection_matrix()(0, 0)); }
1422 DEPRECATED(
"deprecated: use set_projection_matrix() instead.") void set_P(const dmatn& P)
const {
const_cast<context*
>(
this)->set_projection_matrix(
dmat4(4,4,&P(0, 0))); }
1423 DEPRECATED(
"deprecated: use push_projection_matrix() instead.") void push_P() { push_projection_matrix(); }
1424 DEPRECATED(
"deprecated: use pop_projection_matrix() instead.") void pop_P() { pop_projection_matrix(); }
1425 DEPRECATED(
"deprecated: use get_device_matrix() instead.") dmatn get_D()
const {
return dmatn(4, 4, &get_window_matrix()(0, 0)); }
1426 DEPRECATED(
"deprecated: use get_modelview_projection_device_matrix() instead.") dmatn get_DPV()
const {
return dmatn(4, 4, &get_modelview_projection_window_matrix()(0, 0)); }
1474 bool ensure_window_transformation_index(
int& array_index);
1527 return get_model_point(
dvec3(x_window+0.5, y_window+0.5, z_window), modelview_projection_window_matrix);
1538 static dvec3 get_model_point(
const dvec3& p_window,
const dmat4& modelview_projection_window_matrix);
1542 DEPRECATED(
"use get_modelview_projection_window_matrix() instead.")
dmat4 get_modelview_projection_device_matrix() const;
1565 unsigned int w = 800,
unsigned int h = 600,
1566 const std::string& title =
"",
bool show =
false);
1568typedef context* (*context_creation_function_type)(
RenderAPI api,
unsigned int w,
unsigned int h,
const std::string& title,
bool show);
1573struct CGV_API context_factory_registration
1575 context_factory_registration(context_creation_function_type fp);
1581#include <cgv/config/lib_end.h>
base class for all classes that can be registered with support for dynamic properties (see also secti...
The const_data_view has the functionality of the data_view but uses a const pointer and therefore doe...
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,...
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 announce_external_viewport_change(ivec4 &cgv_viewport_storage)=0
announce an external viewport change performed with rendering API to the cgv framework providing spac...
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 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 (source = BF_SRC_ALPHA, destination = BF_ON...
virtual void mul_modelview_matrix(const dmat4 &MV)
multiply given matrix from right to current modelview matrix
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 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 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...
virtual void recover_from_external_viewport_change(const ivec4 &cgv_viewport_storage)=0
restore cgv viewport to the state before the external change
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
virtual void announce_external_frame_buffer_change(void *&cgv_fbo_storage)=0
announce an external frame buffer change performed with rendering API to the cgv framework providing ...
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 enumerate_program_uniforms(shader_program &prog, std::vector< std::string > &names, std::vector< int > *locations_ptr=0, std::vector< int > *sizes_ptr=0, std::vector< int > *types_ptr=0, bool show=false) const =0
get list of program uniforms
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
virtual void disable_material(textured_material &mat)=0
disable a material with textures
virtual void attach_alpha_buffer(bool attach=true)=0
attach or detach (attach=false) an alpha buffer to the current frame buffer if not present
virtual void attach_stencil_buffer(bool attach=true)=0
attach or detach (attach=false) stencil buffer to the current frame buffer if not present
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
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...
virtual bool is_current() const =0
return whether the context is current
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)
virtual void attach_stereo_buffer(bool attach=true)=0
attach or detach (attach=false) stereo buffer to the current frame buffer if not present
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,...
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
vec3 get_point_W(int x_D, int y_D) const
compute the location in world space of a device x/y-location. For this the device point is extended w...
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
size_t get_nr_default_light_sources() const
return number of default light sources
void set_bg_accum_alpha(float a)
set a user defined background alpha value for the accumulation buffer
virtual void set_color(const rgb &clr, float opacity=1.0f)
set the current color
virtual shader_program & ref_default_shader_program(bool texture_support=false)=0
return a reference to a shader program used to render without illumination
float get_gamma() const
query current gamma computed as average over gamma3 per channel values
double get_z_D(int x_D, int y_D) const
read the window z-coordinate from the z-buffer for the given device x- and y-coordinates
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 (source = BF_ONE_MINUS_DST_ALPHA,...
virtual void clear_background(bool color_flag, bool depth_flag, bool stencil_flag=false, bool accum_flag=false)=0
clear the buffer contents of the flagged buffers to the set background colors
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
virtual bool is_stereo_buffer_supported() const =0
return whether the graphics card supports stereo buffer mode
void tesselate_unit_cylinder(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a cylinder of radius 1
virtual void resize(unsigned int width, unsigned int height)=0
resize the context to the given dimensions
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 render_pass_debug_output(const render_info &ri, const std::string &info="")
write out render pass debug info, if activated
void tesselate_unit_octahedron(bool flip_normals=false, bool edges=false)
tesselate a octahedron
const frame_buffer_base * get_current_frame_buffer() const
check for current framebuffer, and return pointer to it
virtual unsigned int get_height() const =0
return the height of the window
vec3 get_gamma3() const
query current per color channel gamma
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
bool update_render_pass_flags(int exclude_flags, int include_flags=0)
update the current render pass flags, return whether this was possible (fails outside of render passe...
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
dmat4 get_device_matrix() const
return homogeneous 4x4 projection matrix, which transforms from clip to device space
dvec3 get_model_point(int x_window, int y_window, double z_window) const
compute model space 3D point from the given opengl pixel location (window location)
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 void pop_window_transformation_array()
restore previous viewport and depth range arrays defining the window transformations
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 double get_window_z(int x_window, int y_window) const =0
read the window z-coordinate from the depth buffer for the given opengl x- and y-coordinates
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
virtual void clear_current() const =0
clear the current context, typically used in multi-threaded rendering to allow usage of context in se...
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
virtual void recover_from_external_frame_buffer_change(void *cgv_fbo_storage)=0
restore cgv frame buffer to the state before the external change
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
virtual RenderAPI get_render_api() const =0
return the used rendering API
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
attribute_array_binding_base * dummy_aab
allocate a dummy attribute array binding used to support attribute-less rendering
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
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
virtual void force_redraw()=0
the context will be redrawn right now. This method cannot be called inside the following methods of a...
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
std::stack< vec4 > bg_accum_color_stack
stack of background accumulation colors
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 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
cgv::media::illum::surface_material default_material
store a default material
bool sRGB_framebuffer_enabled()
check whether sRGB framebuffer is enabled
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
void set_blend_func_alpha_over()
set the blend function for back to front blendingusing the source-over operator (Porter-Duff alpha-ov...
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
virtual void attach_depth_buffer(bool attach=true)=0
attach or detach (attach=false) depth buffer to the current frame buffer if not present
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
std::stack< std::vector< window_transformation > > window_transformation_stack
keep stack of window transformations
dvec3 get_model_point(int x_window, int y_window) const
compute model space 3D point from the given opengl pixel location (window location)
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
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
virtual void render_pass(RenderPass render_pass=RP_MAIN, RenderPassFlags render_pass_flags=RPF_ALL, void *user_data=0, int rp_idx=-1)
perform the given render task
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 enumerate_program_attributes(shader_program &prog, std::vector< std::string > &names, std::vector< int > *locations_ptr=0, std::vector< int > *sizes_ptr=0, std::vector< int > *types_ptr=0, bool show=false) const =0
get list of program attributes
virtual void set_bg_depth(float d)
set a user defined background depth value
dvec3 get_model_point(int x_window, int y_window, const dmat4 &modelview_projection_window_matrix) const
compute model space 3D point from the given opengl pixel location (window location) and modelview_pro...
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
static dvec3 get_model_point(int x_window, int y_window, double z_window, const dmat4 &modelview_projection_window_matrix)
compute model space 3D point from the given opengl pixel location (window location) with the given mo...
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
virtual void enable_material(textured_material &mat)=0
enable a material with textures
dvec3 get_model_point(const vec3 &p_window) const
compute model space 3D point from the given window space point
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
virtual void attach_accumulation_buffer(bool attach=true)=0
attach or detach (attach=false) accumulation buffer to the current frame buffer if not present
void tesselate_unit_cone(int resolution=25, bool flip_normals=false, bool edges=false)
tesselate a cone of radius 1
virtual void attach_multi_sample_buffer(bool attach=true)=0
attach or detach (attach=false) multi sample buffer to the current frame buffer if not present
CullingMode get_cull_state() const
return the current culling state
virtual shader_program & ref_surface_shader_program(bool texture_support=false)=0
return a reference to the default shader program used to render surfaces
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
bool get_debug_render_passes() const
check whether render passes are debugged
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 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
base class for all drawables, which is independent of the used rendering API.
base interface for framebuffer
frame_buffer_base()
initialize members
base interface for a render_buffer
void put_id(T &id) const
cast the refence to rendering api specific representation of component id to the specified type
virtual bool is_created() const
return whether component has been created
const context * ctx_ptr
keep pointer to my context
std::string last_error
a string that contains the last error
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.
shader_program_base()
initializes members
base interface for a texture
texture_base(TextureType _tt=TT_UNDEF)
initialize members
class that extends obj_material with the management of textures
base interface for a vertex buffer
VertexBufferType type
buffer type defaults to VBT_VERTICES
VertexBufferUsage usage
usage defaults to VBU_STATIC_DRAW
defines a symmetric view with the following quantities:
connect to the write signal of the callback stream in order to process all text written to the stream
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
namespace for data management components
ComponentFormat
define standard formats, which should be used to avoid wrong assignment of component names
@ CF_RGB
color format with two components R and G
namespace for api independent GPU programming
RenderAPI
enumeration of rendering APIs which can be queried from the context
CullingMode
different culling modes
cgv::data::ref_ptr< render_config > render_config_ptr
type of ref counted pointer to render configuration
cgv::data::ref_ptr< context_config > context_config_ptr
type of ref counted pointer to context creation configuration
void register_context_factory(context_creation_function_type fp)
registration context creation functions
BlendFunction
different blend functions
TextAlignment
different text alignments
@ TA_TOP
center of top edge of text bounds
@ TA_BOTTOM_RIGHT
bottom right corner of text bounds
@ TA_BOTTOM
center of bottom edge of text bounds
@ TA_RIGHT
center of right edge of text bounds
@ TA_BOTTOM_LEFT
bottom left corner of text bounds
@ TA_TOP_LEFT
top left corner of text bounds
@ TA_LEFT
center of left edge of text bounds
@ TA_TOP_RIGHT
top right corner of text bounds
AccessType
different access types
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
TextureSampling
different sampling strategies for rendering to textures that steer the computation of the tex_coord i...
@ TS_VERTEX
tex_coord ranges from [0,0,0] to [1,1,1]
@ TS_CELL
for texture resulution N x M x L the tex_coord ranges from [1/2N, 1/2M, 1/2L] to [1-1/2N,...
ElementType
different compound types for data elements
context * create_context(RenderAPI api, unsigned int w, unsigned int h, const std::string &title, bool show)
construct a context of the given size.
std::ostream & operator<<(std::ostream &os, const type_descriptor &td)
operator to write textual description to stream
ProgramVariableKind
enumerates different kinds of shader program variables
VertexBufferUsage
Provides vertex buffer usage hints as defined in OpenGL.
@ VBU_STATIC_COPY
Modified once and used many times; Modified by reading data from the GL, and used as the source for G...
@ VBU_STREAM_COPY
Modified once and used at most a few times; Modified by reading data from the GL, and used as the sou...
@ VBU_DYNAMIC_DRAW
Modified repeatedly and used many times; Modified by the application, and used as the source for GL d...
@ VBU_STREAM_READ
Modified once and used at most a few times; Modified by reading data from the GL, and used to return ...
@ VBU_DYNAMIC_COPY
Modified repeatedly and used many times; Modified by reading data from the GL, and used as the source...
@ VBU_STATIC_READ
Modified once and used many times; Modified by reading data from the GL, and used to return that data...
@ VBU_STATIC_DRAW
Modified once and used many times; Modified by the application, and used as the source for GL drawing...
@ VBU_DYNAMIC_READ
Modified repeatedly and used many times; Modified by reading data from the GL, and used to return tha...
@ VBU_STREAM_DRAW
Modified once and used at most a few times; Modified by the application, and used as the source for G...
TextureCubeSides
the six different sides of a cube
IlluminationMode
different illumination modes
std::string to_string(TextureWrap wrap)
convert texture wrap to string
ShaderType
different shader types
PrimitiveType
different primitive types
VertexBufferType
Provides vertex buffer types to allow implicit binding.
@ VBT_VERTICES
The buffer contains vertices and will be bound to GL_ARRAY_BUFFER.
@ VBT_TEXTURE
The buffer contains texture data and will be bound to GL_TEXTURE_BUFFER.
@ VBT_UNDEF
The buffer has no type.
@ VBT_INDICES
The buffer contains indices and will be bound to GL_ELEMENT_ARRAY_BUFFER.
@ VBT_ATOMIC_COUNTER
The buffer contains atomic counter and will be bound to GL_ATOMIC_COUNTER_BUFFER.
@ VBT_STORAGE
The buffer contains arbitrary data and will be bound to GL_SHADER_STORAGE_BUFFER.
@ VBT_UNIFORM
The buffer contains uniforms and will be bound to GL_UNIFORM_BUFFER.
@ VBT_INDIRECT
The buffer contains indirect draw commands and will be bound to GL_DRAW_INDIRECT_BUFFER.
@ VBT_FEEDBACK
The buffer is used for transform&feedback and will be bound to GL_TRANSFORM_FEEDBACK_BUFFER.
BufferTypeBits
Bits for the selection of different buffer types.
@ BTB_COLOR_BIT
color buffer type
@ BTB_STENCIL_BIT
stencil buffer type
@ BTB_ALL_BITS
all buffer types
@ BTB_COLOR_AND_DEPTH_BITS
color and depth buffer types
@ BTB_DEPTH_BIT
depth buffer type
RenderPass
Enumeration of different render passes, which can be queried from the context and used to specify a n...
@ RP_SHADOW_VOLUME
construction of shadow map
@ RP_STEREO
rendering of second eye
@ RP_USER_DEFINED
user defined renderpass
@ RP_OPAQUE_SURFACES
opaque surface rendering using z-Buffer
@ RP_MAIN
the main rendering pass triggered by the redraw event
@ RP_TRANSPARENT_SURFACES
transparent surface rendering using depth peeling
@ RP_PICK
in picking pass a small rectangle around the mouse is rendered
@ RP_SHADOW_MAP
construction of shadow map
TextureType
different texture types
RenderPassFlags
available flags that can be queried from the context and set for a new render pass
@ RPF_CLEAR_ACCUM
whether to clear the accumulation buffer
@ RPF_SET_MODELVIEW
whether to set default modelview matrix
@ RPF_DRAWABLES_FINISH_FRAME
whether to call finish frame method of drawables
@ RPF_SET_MATERIAL
whether to define default material
@ RPF_SET_CLEAR_DEPTH
whether to set the clear color
@ RPF_ALL
all flags set, defines default render pass
@ RPF_SET_LIGHTS
whether to define default lights
@ RPF_CLEAR_COLOR
whether to clear the color buffer
@ RPF_DRAWABLES_DRAW
whether to call draw and finish_draw methods of drawables
@ RPF_CLEAR_STENCIL
whether to clear the depth buffer
@ RPF_SET_MODELVIEW_PROJECTION
whether to set default modelview and projection matrix
@ RPF_SET_CLEAR_STENCIL
whether to set the clear color
@ RPF_ENABLE_MATERIAL
whether to enable material
@ RPF_DRAWABLES_INIT_FRAME
whether to call the init_frame method of the 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_CLEAR_DEPTH
whether to clear the depth buffer
@ RPF_SET_STATE_FLAGS
whether to set depth buffer and culling flags
@ RPF_CLEAR_ALL
whether to clear all buffers
@ RPF_DRAW_TEXTUAL_INFO
whether to draw textual information
@ RPF_SET_PROJECTION
whether to set default projection matrix
@ RPF_SET_LIGHTING
whether to define and enable default lighting
@ RPF_SET_CLEAR_ACCUM
whether to set the accumulation buffer clear color
@ RPF_SET_CLEAR_COLOR
whether to set the clear color
@ RPF_SET_LIGHTS_ON
whether to turn on default lights
CompareFunction
different comparison functions used for depth testing or texture comparisons
GPUVendorID
IDs for GPU vendors.
TypeId
ids for the different types and type constructs
@ TI_UINT8
signed integer stored in 64 bits
namespace for compile time type information
this header is dependency free
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< double, 3 > dvec3
declare type of 3d double precision floating point vectors
cgv::math::fvec< int32_t, 3 > ivec3
declare type of 3d 32 bit integer vectors
cgv::math::fvec< int32_t, 4 > ivec4
declare type of 4d 32 bit integer vectors
cgv::math::vec< float > vecn
declare type of single precision floating point vector with varying dimension
cgv::media::color< float, cgv::media::RGB > rgb
declare rgb color type with 32 bit components
cgv::math::fvec< int32_t, 2 > ivec2
declare type of 2d 32 bit integer vectors
cgv::math::fmat< double, 4, 4 > dmat4
declare type of 4x4 matrices
cgv::math::mat< double > dmatn
declare type of matrices of varying dimensions
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.
bool enabled
whether blending is enabled
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.
bool red_flag
whether to write to the red channel of the color buffer
bool depth_flag
whether to write to the depth buffer if the depth test is enabled
bool alpha_flag
whether to write to the alpha channel of the color buffer
bool green_flag
whether to write to the green channel of the color buffer
bool blue_flag
whether to write to the blue channel of the color buffer
Represents a depth test state used to configure depth testing.
bool enabled
whether the depth test is enabled
CompareFunction test_func
the function used to compare depth values
status information of light sources
information necessary for a rendering pass
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
std::vector< int > context_creation_attrib_list
provide integer vector to store context creation attribute list
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
int max_compute_shared_memory_size
the total number of output values (a component, in GLSL terms, is a component of a vector....
ivec3 max_compute_work_group_count
the number of invocations in a single local work group (i.e., the product of the three dimensions) th...
int max_compute_work_group_invocations
total available storage size in bytes for all shared variables in a compute shader
int max_geometry_shader_total_output_component_count
the maximum number of components of outputs (out variables) written by a geometry shader
int max_geometry_shader_output_vertex_count
the maximum supported size for renderbuffers in any dimension
ivec3 max_compute_work_group_size
the maximum number of work groups that may be dispatched to a compute shader; dimension index 0,...
int max_geometry_shader_output_component_count
the maximum number that can be provided to the max_vertices output layout qualifier in a geometry sha...
structure to store information on a shader program variable, i.e.
std::string name
name as it appears in shaders
std::vector< char > current_value
data storage for the value of the program variable
unsigned array_size
dimension of arrays
void compute_sizes(size_t &cnt, size_t &s, size_t &S) const
helper member function to compute counts and sizes
int program_location
location in program, but not for array variables which span multiple locations
cgv::render::type_descriptor type_descr
type descriptor providing information on component and compositions (scalar, vector or matrix)
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
compact type description of data that can be sent to the context; convertible to int
type_descriptor(const type_descriptor &td, bool _is_array)
construct descriptor for an array
type_descriptor(cgv::type::info::TypeId _coordinate_type, bool _normalize=false)
construct descriptor for values
type_descriptor(cgv::type::info::TypeId _coordinate_type, unsigned _nr_rows, unsigned _nr_cols, bool _is_row_major, bool _normalize=false)
construct descriptor for matrices
type_descriptor(cgv::type::info::TypeId _coordinate_type, unsigned _nr_entries, bool _normalize=false)
construct descriptor for vectors
type_descriptor(int td=0)
construct from int
friend CGV_API std::ostream & operator<<(std::ostream &, const type_descriptor &)
operator to write textual description to stream