cgv
|
implementation of the context API for the OpenGL API excluding methods for font selection, redraw and initiation of render passes. More...
#include <gl_context.h>
Public Member Functions | |
gl_context () | |
construct context and attach signals | |
bool | configure_gl () |
ensure that glew is initialized, define lighting mode, viewing pyramid and the rendering mode and return whether gl configuration was successful | |
void | resize_gl () |
void | set_bg_color (vec4 rgba) override |
set a user defined background color | |
void | set_bg_depth (float d) override |
set a user defined background depth value | |
void | set_bg_stencil (int s) override |
set a user defined background stencil value | |
void | set_bg_accum_color (vec4 rgba) override |
set a user defined background color for the accumulation buffer | |
void | clear_background (bool color_flag, bool depth_flag, bool stencil_flag=false, bool accum_flag=false) override |
clear the buffer contents of the flagged buffers to the set background colors | |
float | get_info_font_size () const |
return info font size | |
cgv::media::font::font_face_ptr | get_info_font_face () const |
return info font face and ensure that it is created | |
float | get_current_font_size () const override |
overwrite function to return info font size in case no font is currently selected | |
media::font::font_face_ptr | get_current_font_face () const override |
overwrite function to return info font face in case no font is currently selected | |
void | perform_screen_shot () override |
RenderAPI | get_render_api () const override |
return the used rendering API | |
void | init_render_pass () override |
void | finish_render_pass () override |
light and materials management | |
void | set_color (const rgba &clr) override |
set the current color | |
void | set_material (const cgv::media::illum::surface_material &mat) override |
set the current material | |
void | enable_material (textured_material &mat) override |
enable a material with textures | |
void | disable_material (textured_material &mat) override |
disable a material with textures | |
shader_program & | ref_default_shader_program (bool texture_support=false) override |
return a reference to a shader program used to render without illumination | |
shader_program & | ref_surface_shader_program (bool texture_support=false) override |
return a reference to the default shader program used to render surfaces | |
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 override |
get list of program uniforms | |
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 override |
get list of program attributes | |
void | on_lights_changed () override |
helper function to send light update events | |
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) override |
tesselate an arrow from the origin in z-direction | |
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) override |
define length and direction from start and end point and draw an arrow | |
void | draw_light_source (const cgv::media::illum::light_source &l, float intensity_scale, float light_scale) override |
draw a light source with an emissive material | |
void | announce_external_viewport_change (ivec4 &cgv_viewport_storage) override |
announce an external viewport change performed with rendering API to the cgv framework providing space to temporarily store viewport of cgv framework | |
void | recover_from_external_viewport_change (const ivec4 &cgv_viewport_storage) override |
restore cgv viewport to the state before the external change | |
void | announce_external_frame_buffer_change (void *&cgv_fbo_storage) override |
announce an external frame buffer change performed with rendering API to the cgv framework providing space to temporarily store frame buffer of cgv framework | |
void | recover_from_external_frame_buffer_change (void *cgv_fbo_storage) override |
restore cgv frame buffer to the state before the external change | |
text output | |
void | push_pixel_coords () override |
use this to push transformation matrices on the stack such that x and y coordinates correspond to window coordinates | |
void | pop_pixel_coords () override |
pop previously changed transformation matrices | |
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=type::info::TI_UINT8, data::ComponentFormat cf=data::CF_RGB, int w=-1, int h=-1) override |
implement according to specification in context class | |
tesselation | |
bool | prepare_attributes (std::vector< vec3 > &P, std::vector< vec3 > &N, std::vector< vec2 > &T, unsigned nr_vertices, const float *vertices, const float *normals, const float *tex_coords, const int *vertex_indices, const int *normal_indices, const int *tex_coord_indices, bool flip_normals) const |
helper function to prepare attribute arrays | |
bool | release_attributes (const float *normals, const float *tex_coords, const int *normal_indices, const int *tex_coord_indices) const |
helper function to disable attribute arrays | |
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 override |
pass geometry of given faces to current shader program and generate draw calls to render lines for the edges | |
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 override |
pass geometry of given strip or fan to current shader program and generate draw calls to render lines for the edges | |
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) const override |
tesselate with independent faces | |
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) const override |
tesselate with one face strip | |
render state | |
void | set_depth_test_state (DepthTestState state) override |
set the depth test state | |
void | set_depth_func (CompareFunction func) override |
set the depth test function | |
void | enable_depth_test () override |
enable the depth test | |
void | disable_depth_test () override |
disable the depth test | |
void | set_cull_state (CullingMode culling_mode) override |
set the culling state | |
void | set_blend_state (BlendState state) override |
set the complete blend state | |
void | set_blend_func (BlendFunction src_factor, BlendFunction dst_factor) override |
set the blend function | |
void | set_blend_func_separate (BlendFunction src_color_factor, BlendFunction dst_color_factor, BlendFunction src_alpha_factor, BlendFunction dst_alpha_factor) override |
set the blend function separately for color and alpha | |
void | enable_blending () override |
enable blending | |
void | disable_blending () override |
disable blending | |
void | set_buffer_mask (BufferMask mask) override |
set the buffer mask for depth and color buffers | |
void | set_depth_mask (bool flag) override |
set the depth buffer mask | |
void | set_color_mask (bvec4 flags) override |
set the color buffer mask | |
![]() | |
shader_program_base * | get_current_program () const |
check for current program, prepare it for rendering and return pointer to it | |
void | enable_shader_file_cache () |
enable the usage of the shader file caches | |
void | disable_shader_file_cache () |
disable the usage of the shader file caches | |
bool | is_shader_file_cache_enabled () const |
whether the shader file caches are enabled | |
context () | |
init the cursor position to (0,0) | |
virtual | ~context () |
virtual destructor | |
virtual void | error (const std::string &message, const render_component *rc=0) const |
error handling | |
virtual GPUVendorID | get_gpu_vendor_id () const |
device information | |
virtual void | configure_new_child (cgv::base::base_ptr child) |
helper method to integrate a new child | |
unsigned | get_render_pass_recursion_depth () const |
return current render pass recursion depth | |
virtual RenderPass | get_render_pass () const |
return the current render pass | |
virtual RenderPassFlags | get_render_pass_flags () const |
return the current render pass flags | |
virtual void * | get_render_pass_user_data () const |
return the current render pass user data | |
virtual RenderPassFlags | get_default_render_pass_flags () const |
return the default render pass flags | |
virtual void | set_default_render_pass_flags (RenderPassFlags) |
return the default render pass flags | |
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 | set_debug_render_passes (bool _debug) |
set flag whether to debug render passes | |
bool | get_debug_render_passes () const |
check whether render passes are debugged | |
virtual bool | in_render_process () const =0 |
return whether the context is currently in process of rendering | |
virtual bool | is_created () const =0 |
return whether the context is created | |
virtual bool | is_current () const =0 |
return whether the context is current | |
virtual bool | recreate_context () |
recreate context based on current context config settings | |
virtual bool | make_current () const =0 |
make the current context current if possible | |
virtual void | clear_current () const =0 |
clear the current context, typically used in multi-threaded rendering to allow usage of context in several threads | |
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_depth_buffer (bool attach=true)=0 |
attach or detach (attach=false ) depth 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 | |
virtual bool | is_stereo_buffer_supported () const =0 |
return whether the graphics card supports stereo buffer mode | |
virtual void | attach_stereo_buffer (bool attach=true)=0 |
attach or detach (attach=false ) stereo buffer to the current frame buffer if not present | |
virtual void | attach_accumulation_buffer (bool attach=true)=0 |
attach or detach (attach=false ) accumulation buffer to the current frame buffer if not present | |
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 | |
virtual unsigned int | get_width () const =0 |
return the width of the window | |
virtual unsigned int | get_height () const =0 |
return the height of the window | |
virtual void | resize (unsigned int width, unsigned int height)=0 |
resize the context to the given dimensions | |
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. | |
void | push_bg_color () |
push a copy of the current background color onto the stack | |
void | pop_bg_color () |
pop the top of the current background color from the stack | |
void | set_bg_color (float r, float g, float b, float a) |
set a user defined background color | |
vec4 | get_bg_color () const |
return the current color value for clearing the background | |
void | put_bg_color (float *rgba) const |
copy the current background rgba color into the given float array | |
void | set_bg_alpha (float a) |
set a user defined background alpha value | |
float | get_bg_alpha () const |
return the current alpha value for clearing the background | |
void | set_bg_clr_idx (unsigned int idx) |
set an indexed background color | |
unsigned int | get_bg_clr_idx () const |
return the current index of the background color | |
void | push_bg_depth () |
push a copy of the current background depth value onto the stack | |
void | pop_bg_depth () |
pop the top of the current background depth value from the stack | |
float | get_bg_depth () const |
return the current depth value for clearing the background | |
void | push_bg_stencil () |
push a copy of the current background stencil value onto the stack | |
void | pop_bg_stencil () |
pop the top of the current background stencil value from the stack | |
int | get_bg_stencil () const |
return the current stencil value for clearing the background | |
void | push_bg_accum_color () |
push a copy of the current background accumulation color onto the stack | |
void | pop_bg_accum_color () |
pop the top of the current background accumulation color from the stack | |
void | set_bg_accum_color (float r, float g, float b, float a) |
set a user defined background color for the accumulation buffer | |
vec4 | get_bg_accum_color () const |
return the current color value for clearing the accumulation buffer | |
void | put_bg_accum_color (float *rgba) const |
copy the current accumulation background rgba color into the given float array | |
void | set_bg_accum_alpha (float a) |
set a user defined background alpha value for the accumulation buffer | |
float | get_bg_accum_alpha () const |
return the current alpha value for clearing the accumulation buffer | |
virtual void | post_redraw ()=0 |
the context will be redrawn when the system is idle again | |
virtual void | force_redraw ()=0 |
the context will be redrawn right now. This method cannot be called inside the following methods of a drawable: init, init_frame, draw, finish_draw | |
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 | |
virtual void | enable_phong_shading () |
enable phong shading with the help of a shader (enabled by default) | |
virtual void | disable_phong_shading () |
virtual void | enable_material (const cgv::media::illum::phong_material &mat=cgv::media::illum::default_material(), MaterialSide ms=MS_FRONT_AND_BACK, float alpha=1) |
virtual void | disable_material (const cgv::media::illum::phong_material &mat=cgv::media::illum::default_material()) |
virtual void | enable_material (const textured_material &mat, MaterialSide ms=MS_FRONT_AND_BACK, float alpha=1) |
void | set_gamma (float _gamma) |
set the current per channel gamma values to single value | |
virtual void | set_gamma3 (const vec3 &_gamma3) |
set the current per channel gamma values to single value | |
float | get_gamma () const |
query current gamma computed as average over gamma3 per channel values | |
vec3 | get_gamma3 () const |
query current per color channel gamma | |
virtual void | enable_sRGB_framebuffer (bool do_enable=true) |
enable or disable sRGB framebuffer | |
bool | sRGB_framebuffer_enabled () |
check whether sRGB framebuffer is enabled | |
const rgba & | get_color () const |
return current color | |
virtual void | set_color (const rgb &clr, float opacity=1.0f) |
set the current color | |
const cgv::media::illum::surface_material * | get_current_material () const |
return pointer to current material or nullptr if no current material is available | |
virtual void | set_textured_material (const textured_material &mat) |
set the current material | |
void | set_current_gamma (shader_program &prog) const |
set the shader program gamma values | |
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 | |
void | set_current_material (shader_program &prog) const |
set the shader program material to the currently enabled material | |
void | set_current_lights (shader_program &prog) const |
set the shader program lights to the currently enabled lights | |
vec3 | get_light_eye_position (const cgv::media::illum::light_source &light, bool place_now) const |
helper function to place lights | |
vec3 | get_light_eye_spot_direction (const cgv::media::illum::light_source &light, bool place_now) const |
helper function to place spot lights | |
void * | enable_light (const cgv::media::illum::light_source &light) |
void | disable_light (void *handle) |
unsigned | get_max_nr_lights () const |
size_t | get_nr_light_sources () const |
return the number of light sources | |
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 transformation if place_now is true; return handle to light source | |
bool | remove_light_source (void *handle) |
remove a light source by handle and whether it existed | |
const cgv::media::illum::light_source & | get_light_source (void *handle) const |
read access to light source | |
const light_source_status & | get_light_source_status (void *handle) const |
read access to light source status | |
void | set_light_source (void *handle, const cgv::media::illum::light_source &light, bool place_now=true) |
set light source newly | |
void | place_light_source (void *handle) |
place the given light source relative to current model viel transformation | |
virtual unsigned | get_max_nr_enabled_light_sources () const |
return maximum number of light sources, that can be enabled in parallel | |
size_t | get_nr_enabled_light_sources () const |
return the number of light sources | |
void * | get_enabled_light_source_handle (size_t i) const |
access to handle of i-th light source | |
bool | is_light_source_enabled (void *handle) |
check whether light source is enabled | |
bool | enable_light_source (void *handle) |
enable a given light source and return whether there existed a light source with given handle | |
bool | disable_light_source (void *handle) |
disable a given light source and return whether there existed a light source with given handle | |
size_t | get_nr_default_light_sources () const |
return number of default light sources | |
const cgv::media::illum::light_source & | get_default_light_source (size_t i) const |
return i-th default light source | |
void | set_default_light_source (size_t i, const cgv::media::illum::light_source &ls) |
set i-th default light source | |
virtual std::ostream & | output_stream () |
returns an output stream whose output is printed at the current cursor location, which is managed by the context. | |
virtual void | set_cursor (int x, int y) |
flush the output_stream and set a new cursor position given in opengl coordinates with (0,0) in lower left corner | |
virtual void | get_cursor (int &x, int &y) const |
return current cursor location in opengl coordinates with (0,0) in lower left corner | |
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 corner and put x and y coordinates into the passed variables | |
virtual void | set_cursor (const vecn &pos, const std::string &text="", TextAlignment ta=TA_BOTTOM_LEFT, int x_offset=0, int y_offset=0) |
flush output_stream and set the current text position from a 3D or 4D location in current world coordinates. | |
void | tesselate_unit_square (bool flip_normals=false, bool edges=false) |
tesselate a unit square in the xy-plane with texture coordinates | |
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 | tesselate_box (const cgv::media::axis_aligned_box< double, 3 > &B, bool flip_normals, bool edges=false) const |
tesselate an axis aligned box | |
void | tesselate_unit_prism (bool flip_normals=false, bool edges=false) |
tesselate a prism | |
void | tesselate_unit_disk (int resolution=25, bool flip_normals=false, bool edges=false) |
tesselate a circular disk of radius 1 | |
void | tesselate_unit_cone (int resolution=25, bool flip_normals=false, bool edges=false) |
tesselate a cone of radius 1 | |
void | tesselate_unit_cylinder (int resolution=25, bool flip_normals=false, bool edges=false) |
tesselate a cylinder of radius 1 | |
void | tesselate_unit_sphere (int resolution=25, bool flip_normals=false, bool edges=false) |
tesselate a sphere of radius 1 | |
void | tesselate_unit_tetrahedron (bool flip_normals=false, bool edges=false) |
tesselate a tetrahedron | |
void | tesselate_unit_octahedron (bool flip_normals=false, bool edges=false) |
tesselate a octahedron | |
void | tesselate_unit_dodecahedron (bool flip_normals=false, bool edges=false) |
tesselate a dodecahedron | |
void | tesselate_unit_icosahedron (bool flip_normals=false, bool edges=false) |
tesselate an icosahedron | |
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 | |
void | push_depth_test_state () |
push a copy of the current depth test state onto the stack saved attributes: depth test enablement, depth test function | |
void | pop_depth_test_state () |
pop the top of the current depth test state from the stack | |
DepthTestState | get_depth_test_state () const |
return the current depth test state | |
void | push_cull_state () |
push a copy of the current culling state onto the stack saved attributes: cull face enablement, cull face | |
void | pop_cull_state () |
pop the top of the current culling state from the stack | |
CullingMode | get_cull_state () const |
return the current culling state | |
void | push_blend_state () |
push a copy of the current blend state onto the stack saved attributes: blend enablement, color and alpha source and destinatin functions | |
void | pop_blend_state () |
pop the top of the current culling state from the stack | |
BlendState | get_blend_state () const |
return the current blend state | |
void | set_blend_func_front_to_back () |
set the default blend function for front to back blending | |
void | set_blend_func_back_to_front () |
set the default blend function for back to front blending | |
void | push_buffer_mask () |
push a copy of the current buffer mask onto the stack saved attributes: depth mask, color mask | |
void | pop_buffer_mask () |
pop the top of the current buffer mask from the stack | |
BufferMask | get_buffer_mask () const |
return the current buffer mask | |
bool | get_depth_mask () const |
get the depth buffer mask | |
bvec4 | get_color_mask () const |
get the color buffer mask | |
dmatn | get_V () const |
void | set_V (const dmatn &V) const |
void | push_V () |
void | pop_V () |
dmatn | get_P () const |
void | set_P (const dmatn &P) const |
void | push_P () |
void | pop_P () |
dmatn | get_D () const |
dmatn | get_DPV () const |
virtual void | mul_modelview_matrix (const dmat4 &MV) |
multiply given matrix from right to current modelview matrix | |
void | push_modelview_matrix () |
push the current viewing matrix onto a matrix stack for viewing matrices. | |
void | pop_modelview_matrix () |
see push_V for an explanation | |
virtual void | mul_projection_matrix (const dmat4 &P) |
multiply given matrix from right to current projection matrix | |
void | push_projection_matrix () |
same as push_V but for the projection matrix - a different matrix stack is used. | |
void | pop_projection_matrix () |
see push_P for an explanation | |
void | push_window_transformation_array () |
push a copy of the current viewport and depth range arrays defining the window transformations | |
const std::vector< window_transformation > & | get_window_transformation_array () const |
return the current window transformation array | |
dmat4 | get_window_matrix (unsigned array_index=0) const |
return a homogeneous 4x4 matrix to transform clip to window coordinates | |
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. the product of modelview, projection and device matrix in reversed order (window_matrix*projection_matrix*modelview_matrix) | |
vec3 | get_model_point (int x_window, int y_window) const |
compute model space 3D point from the given opengl pixel location (window location) | |
vec3 | 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_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_projection_window matrix | |
vec3 | get_model_point (const vec3 &p_window) const |
compute model space 3D point from the given window space point | |
dmat4 | get_device_matrix () const |
return homogeneous 4x4 projection matrix, which transforms from clip to device space | |
dmat4 | get_modelview_projection_device_matrix () const |
return matrix to transfrom from model to device coordinates, i.e. the product of modelview, projection and device matrix in reversed order (device_matrix*projection_matrix*modelview_matrix) | |
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 | |
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 with the device z-coordinate currently stored in the displayed depth buffer. | |
vec3 | get_point_W (int x_D, int y_D, const dmat4 &MPD) const |
compute the location in world space of a device x/y-location by inversion of the given transformation from world to device space. For this the device point is extended with the device z-coordinate currently stored in the displayed depth buffer. | |
vec3 | get_point_W (int x_D, int y_D, double z_D) const |
compute the location in world space of a device point. For this the current world to device transformation is inverted. | |
vec3 | get_point_W (int x_D, int y_D, double z_D, const dmat4 &MPD) const |
compute the location in world space of a device point by inversion of the given world to device transformation. | |
vec3 | get_point_W (const vec3 &p_D) const |
compute a the location in world space of a device point. | |
vec3 | get_point_W (const vec3 &p_D, const dmat4 &MPD) const |
compute a the location in world space of a device point. | |
![]() | |
context_config () | |
construct config with default parameters | |
bool | self_reflect (cgv::reflect::reflection_handler &srh) |
reflect the shader_path member | |
Protected Attributes | |
shader_program | progs [4] |
cgv::type::uint64_type | max_nr_indices |
cgv::type::uint64_type | max_nr_vertices |
cgv::media::font::font_face_ptr | info_font_face |
font used to draw textual info | |
float | info_font_size |
font size to draw textual info | |
bool | show_help |
bool | show_stats |
![]() | |
GPUVendorID | gpu_vendor |
bool | use_shader_file_cache |
whether to use the caching facilities of shader_program and shader_code to store loaded shader file contents as strings for faster loading | |
bool | auto_set_view_in_current_shader_program |
whether to automatically set viewing matrixes in current shader program, defaults to true | |
bool | auto_set_lights_in_current_shader_program |
whether to automatically set lights in current shader program, defaults to true | |
bool | auto_set_material_in_current_shader_program |
whether to automatically set material in current shader program, defaults to true | |
bool | auto_set_gamma_in_current_shader_program |
whether to automatically set gamma in current shader program, defaults to true | |
bool | support_compatibility_mode |
whether to support view and lighting management of compatibility mode, defaults to true | |
bool | draw_in_compatibility_mode |
whether to do all drawing in compatibility mode, only possible if support_compatibility_mode is true, , defaults to false | |
bool | debug_render_passes |
whether to debug render passes | |
bool | enable_vsync |
whether vsync should be enabled | |
rgba | current_color |
current color value | |
bool | sRGB_framebuffer |
whether to use opengl option to support sRGB framebuffer | |
vec3 | gamma3 |
per color channel gamma value passed to shader programs that have gamma uniform | |
std::stack< vec4 > | bg_color_stack |
stack of background colors | |
std::stack< float > | bg_depth_stack |
stack of background depth values | |
std::stack< int > | bg_stencil_stack |
stack of background stencil values | |
std::stack< vec4 > | bg_accum_color_stack |
stack of background accumulation colors | |
std::stack< DepthTestState > | depth_test_state_stack |
stack of depth test states | |
std::stack< CullingMode > | cull_state_stack |
stack of culling mode states | |
std::stack< BlendState > | blend_state_stack |
stack of blend states | |
std::stack< BufferMask > | buffer_mask_stack |
stack of buffer masks | |
std::stack< dmat4 > | modelview_matrix_stack |
keep two matrix stacks for model view and projection matrices | |
std::stack< dmat4 > | projection_matrix_stack |
std::stack< std::vector< window_transformation > > | window_transformation_stack |
keep stack of window transformations | |
std::stack< frame_buffer_base * > | frame_buffer_stack |
stack of currently enabled frame buffers | |
std::stack< shader_program_base * > | shader_program_stack |
stack of currently enabled shader programs | |
std::stack< attribute_array_binding_base * > | attribute_array_binding_stack |
stack of currently enabled attribute array binding | |
std::vector< void * > | enabled_light_source_handles |
keep track of enabled light source handles | |
size_t | light_source_handle |
counter to construct light source handles | |
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 | |
cgv::media::illum::light_source | default_light_source [nr_default_light_sources] |
default light sources | |
void * | default_light_source_handles [nr_default_light_sources] |
handles of default light sources | |
cgv::media::illum::surface_material | default_material |
store a default material | |
const cgv::media::illum::surface_material * | current_material_ptr |
store pointer to current material | |
bool | current_material_is_textured |
store flag to tell whether current material is textured | |
std::stack< render_info > | render_pass_stack |
store the current render pass | |
RenderPassFlags | default_render_flags |
default render flags with which the main render pass is initialized | |
bool | phong_shading |
whether to use phong shading | |
int | current_background |
current back ground color index | |
int | cursor_x |
current cursor location for textual output | |
int | cursor_y |
cgv::signal::callback_stream | out_stream |
use a callback stream to write text to the opengl context | |
float | current_font_size |
store current font size | |
cgv::media::font::font_face_ptr | current_font_face |
store current font | |
int | tab_size |
size a tabs | |
int | x_offset |
offset in x and y direction where text starts | |
int | y_offset |
int | nr_identations |
current number of indentations | |
bool | at_line_begin |
store whether we are at the beginning of the line | |
bool | do_screen_shot |
transformations | |
void | update_window_transformation_array () |
dmat4 | get_modelview_matrix () const override |
return homogeneous 4x4 viewing matrix, which transforms from world to eye space | |
void | set_modelview_matrix (const dmat4 &V) override |
set the current modelview matrix, which transforms from world to eye space | |
dmat4 | get_projection_matrix () const override |
return homogeneous 4x4 projection matrix, which transforms from eye to clip space | |
void | set_projection_matrix (const dmat4 &P) override |
set the current projection matrix, which transforms from eye to clip space | |
void | pop_window_transformation_array () override |
restore previous viewport and depth range arrays defining the window transformations | |
unsigned | get_max_window_transformation_array_size () const override |
query the maximum number of supported window transformations, which is at least 1 | |
void | set_viewport (const ivec4 &viewport, int array_index=-1) override |
set the current viewport or one of the viewports in the window transformation array | |
void | set_depth_range (const dvec2 &depth_range=dvec2(0, 1), int array_index=-1) override |
set the current depth range or one of the depth ranges in the window transformation array | |
double | get_window_z (int x_window, int y_window) const override |
read the device z-coordinate from the z-buffer for the given device x- and y-coordinates | |
Additional Inherited Members | |
![]() | |
static vec3 | 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 modelview_projection_window matrix | |
static vec3 | get_model_point (const dvec3 &p_window, const dmat4 &modelview_projection_window_matrix) |
compute model space 3D point from the given window space point and the given modelview_projection_window matrix | |
![]() | |
bool | depth_buffer |
default: true | |
bool | double_buffer |
default: true | |
bool | alpha_buffer |
default: false | |
bool | stereo_buffer |
default: false | |
bool | stencil_buffer |
default: false | |
bool | accumulation_buffer |
default: false | |
bool | multi_sample_buffer |
default: false | |
int | depth_bits |
default: -1 | |
int | stencil_bits |
default: -1 | |
int | accumulation_bits |
default: -1 | |
int | nr_multi_samples |
default: -1 | |
int | version_major |
default: -1 ... major version of maximum supported OpenGL version | |
int | version_minor |
default: -1 ... minor version of maximum supported OpenGL version | |
bool | forward_compatible |
default: false | |
bool | debug |
default: false in release and true in debug version | |
bool | core_profile |
default: true | |
std::vector< int > | context_creation_attrib_list |
provide integer vector to store context creation attribute list | |
![]() | |
static void | get_buffer_list (frame_buffer_base &fbb, bool &depth_buffer, std::vector< int > &buffers, int offset=0) |
![]() | |
static const unsigned | nr_default_light_sources = 2 |
number of default light sources | |
implementation of the context API for the OpenGL API excluding methods for font selection, redraw and initiation of render passes.
Definition at line 43 of file gl_context.h.
cgv::render::gl::gl_context::gl_context | ( | ) |
construct context and attach signals
construct gl_context and attach signals
Definition at line 342 of file gl_context.cxx.
References cgv::render::context::frame_buffer_stack, cgv::render::context::get_bg_accum_color(), cgv::render::context::get_bg_color(), cgv::render::context::get_bg_depth(), cgv::render::context::get_bg_stencil(), cgv::render::context::get_blend_state(), cgv::render::context::get_buffer_mask(), cgv::render::context::get_cull_state(), cgv::render::context::get_depth_test_state(), info_font_size, set_bg_accum_color(), set_bg_color(), set_bg_depth(), set_bg_stencil(), set_blend_state(), set_buffer_mask(), set_cull_state(), and set_depth_test_state().
|
overridevirtual |
announce an external frame buffer change performed with rendering API to the cgv framework providing space to temporarily store frame buffer of cgv framework
Implements cgv::render::context.
Definition at line 1042 of file gl_context.cxx.
References cgv::render::context::error(), and cgv::render::context::frame_buffer_stack.
|
overridevirtual |
announce an external viewport change performed with rendering API to the cgv framework providing space to temporarily store viewport of cgv framework
Implements cgv::render::context.
Definition at line 1062 of file gl_context.cxx.
References cgv::render::context::error(), and cgv::render::context::window_transformation_stack.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3333 of file gl_context.cxx.
|
protected |
Definition at line 3350 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 3373 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 3365 of file gl_context.cxx.
|
protected |
Definition at line 1878 of file gl_context.cxx.
|
protected |
Definition at line 1813 of file gl_context.cxx.
|
protected |
Definition at line 1843 of file gl_context.cxx.
|
protected |
Definition at line 1823 of file gl_context.cxx.
|
overridevirtual |
clear the buffer contents of the flagged buffers to the set background colors
Implements cgv::render::context.
Definition at line 548 of file gl_context.cxx.
References cgv::render::context_config::core_profile.
bool cgv::render::gl::gl_context::configure_gl | ( | ) |
ensure that glew is initialized, define lighting mode, viewing pyramid and the rendering mode and return whether gl configuration was successful
define lighting mode, viewing pyramid and the rendering mode
Definition at line 422 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context_config::debug, cgv::render::gl::ensure_glew_initialized(), cgv::render::context::error(), cgv::render::context_config::forward_compatible, cgv::render::context::get_height(), cgv::render::context::get_width(), cgv::render::drawable::init(), set_viewport(), cgv::utils::to_upper(), cgv::base::traverser::traverse(), cgv::render::context_config::version_major, and cgv::render::context_config::version_minor.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 845 of file gl_context.cxx.
|
overridevirtual |
disable blending
Reimplemented from cgv::render::context.
Definition at line 1587 of file gl_context.cxx.
References cgv::render::context::disable_blending().
|
overridevirtual |
disable the depth test
Reimplemented from cgv::render::context.
Definition at line 1525 of file gl_context.cxx.
References cgv::render::context::disable_depth_test().
|
overridevirtual |
disable a material with textures
Implements cgv::render::context.
Definition at line 838 of file gl_context.cxx.
References cgv::render::context::current_material_is_textured, and cgv::render::context::current_material_ptr.
|
overridevirtual |
pass geometry of given faces to current shader program and generate draw calls to render lines for the edges
Implements cgv::render::context.
Definition at line 1341 of file gl_context.cxx.
References cgv::render::context::draw_in_compatibility_mode, prepare_attributes(), and release_attributes().
|
overridevirtual |
pass geometry of given strip or fan to current shader program and generate draw calls to render lines for the edges
Implements cgv::render::context.
Definition at line 1391 of file gl_context.cxx.
References cgv::render::context::draw_in_compatibility_mode, prepare_attributes(), and release_attributes().
|
inlineprotected |
Definition at line 64 of file gl_context.h.
|
protected |
Definition at line 1367 of file gl_context.cxx.
|
overridevirtual |
tesselate with independent faces
Implements cgv::render::context.
Definition at line 1434 of file gl_context.cxx.
References cgv::render::context::draw_in_compatibility_mode, prepare_attributes(), and release_attributes().
|
overridevirtual |
draw a light source with an emissive material
[in] | l | to be rendered light source |
[in] | intensity_scale | used to multiply with the light source values |
Reimplemented from cgv::render::context.
Definition at line 1005 of file gl_context.cxx.
References cgv::render::context::mul_modelview_matrix(), cgv::render::context::pop_cull_state(), cgv::render::context::pop_modelview_matrix(), cgv::render::context::push_cull_state(), cgv::render::context::push_modelview_matrix(), rotate_vector_to_target(), set_color(), set_cull_state(), tesselate_arrow(), cgv::render::context::tesselate_unit_cone(), and cgv::render::context::tesselate_unit_sphere().
|
overridevirtual |
tesselate with one face strip
Implements cgv::render::context.
Definition at line 1480 of file gl_context.cxx.
References cgv::render::context::draw_in_compatibility_mode, prepare_attributes(), and release_attributes().
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 686 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3482 of file gl_context.cxx.
|
overridevirtual |
enable blending
Reimplemented from cgv::render::context.
Definition at line 1582 of file gl_context.cxx.
References cgv::render::context::enable_blending().
|
overridevirtual |
enable the depth test
Reimplemented from cgv::render::context.
Definition at line 1520 of file gl_context.cxx.
References cgv::render::context::enable_depth_test().
|
overridevirtual |
enable a material with textures
Implements cgv::render::context.
Definition at line 831 of file gl_context.cxx.
References cgv::render::context::set_textured_material().
|
protected |
Definition at line 1382 of file gl_context.cxx.
|
overridevirtual |
get list of program attributes
get list of program uniforms
Implements cgv::render::context.
Definition at line 773 of file gl_context.cxx.
|
overridevirtual |
get list of program uniforms
Implements cgv::render::context.
Definition at line 748 of file gl_context.cxx.
|
overridevirtual |
Reimplemented from cgv::render::context.
Definition at line 661 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2625 of file gl_context.cxx.
|
overrideprotectedvirtual |
attach 2d texture to depth buffer if it is a depth texture, to stencil if it is a stencil texture or to the i-th color attachment if it is a color texture
Reimplemented from cgv::render::context.
Definition at line 2641 of file gl_context.cxx.
References cgv::render::gl::get_gl_cube_map_target().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2584 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2505 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2562 of file gl_context.cxx.
|
overrideprotectedvirtual |
disable the framebuffer object
Reimplemented from cgv::render::context.
Definition at line 2549 of file gl_context.cxx.
References cgv::render::context::error(), and cgv::render::context::frame_buffer_stack.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2524 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2717 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2727 of file gl_context.cxx.
|
overrideprotectedvirtual |
check for completeness, if not complete, get the reason in last_error
Implements cgv::render::context.
Definition at line 2674 of file gl_context.cxx.
References cgv::render::context::error().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3228 of file gl_context.cxx.
|
overridevirtual |
overwrite function to return info font face in case no font is currently selected
Reimplemented from cgv::render::context.
Definition at line 570 of file gl_context.cxx.
References cgv::render::context::current_font_face, cgv::data::ref_ptr< T, is_ref_counted >::empty(), and get_info_font_face().
|
overridevirtual |
overwrite function to return info font size in case no font is currently selected
Reimplemented from cgv::render::context.
Definition at line 563 of file gl_context.cxx.
References cgv::render::context::current_font_size, and get_info_font_size().
cgv::media::font::font_face_ptr cgv::render::gl::gl_context::get_info_font_face | ( | ) | const |
return info font face and ensure that it is created
Definition at line 331 of file gl_context.cxx.
References cgv::media::font::default_font(), cgv::data::ref_ptr< T, is_ref_counted >::empty(), and info_font_face.
Referenced by get_current_font_face().
float cgv::render::gl::gl_context::get_info_font_size | ( | ) | const |
return info font size
Definition at line 326 of file gl_context.cxx.
References info_font_size.
Referenced by get_current_font_size().
|
overridevirtual |
query the maximum number of supported window transformations, which is at least 1
Implements cgv::render::context.
Definition at line 1671 of file gl_context.cxx.
|
overridevirtual |
return homogeneous 4x4 viewing matrix, which transforms from world to eye space
Implements cgv::render::context.
Definition at line 1619 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::modelview_matrix_stack, and cgv::render::context::support_compatibility_mode.
|
overridevirtual |
return homogeneous 4x4 projection matrix, which transforms from eye to clip space
Implements cgv::render::context.
Definition at line 1632 of file gl_context.cxx.
References cgv::render::context_config::core_profile, and cgv::render::context::support_compatibility_mode.
|
overridevirtual |
return the used rendering API
Implements cgv::render::context.
Definition at line 364 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2899 of file gl_context.cxx.
|
overridevirtual |
read the device z-coordinate from the z-buffer for the given device x- and y-coordinates
Implements cgv::render::context.
Definition at line 1754 of file gl_context.cxx.
References cgv::render::context::in_render_process(), cgv::render::context::is_current(), and cgv::render::context::make_current().
|
overridevirtual |
Reimplemented from cgv::render::context.
Definition at line 577 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3505 of file gl_context.cxx.
|
overridevirtual |
helper function to send light update events
Reimplemented from cgv::render::context.
Definition at line 906 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::get_enabled_light_source_handle(), cgv::render::context::get_light_source(), cgv::render::context::get_nr_enabled_light_sources(), cgv::render::context::on_lights_changed(), and cgv::render::context::support_compatibility_mode.
|
overridevirtual |
Reimplemented from cgv::render::context.
Definition at line 730 of file gl_context.cxx.
|
overridevirtual |
pop previously changed transformation matrices
Implements cgv::render::context.
Definition at line 1107 of file gl_context.cxx.
References cgv::render::context::pop_modelview_matrix(), and cgv::render::context::pop_projection_matrix().
|
overridevirtual |
restore previous viewport and depth range arrays defining the window transformations
Reimplemented from cgv::render::context.
Definition at line 1644 of file gl_context.cxx.
References cgv::render::context::pop_window_transformation_array().
bool cgv::render::gl::gl_context::prepare_attributes | ( | std::vector< vec3 > & | P, |
std::vector< vec3 > & | N, | ||
std::vector< vec2 > & | T, | ||
unsigned | nr_vertices, | ||
const float * | vertices, | ||
const float * | normals, | ||
const float * | tex_coords, | ||
const int * | vertex_indices, | ||
const int * | normal_indices, | ||
const int * | tex_coord_indices, | ||
bool | flip_normals | ||
) | const |
helper function to prepare attribute arrays
Definition at line 1247 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::attribute_array_binding::create(), cgv::render::vertex_buffer::create(), cgv::render::vertex_buffer::destruct(), cgv::render::attribute_array_binding::disable_array(), cgv::render::attribute_array_binding::disable_global_array(), cgv::render::attribute_array_binding::enable(), cgv::render::attribute_array_binding::enable_array(), cgv::render::attribute_array_binding::enable_global_array(), cgv::render::context::get_current_program(), cgv::render::vertex_buffer::replace(), and cgv::render::attribute_array_binding::set_attribute_array().
Referenced by draw_edges_of_faces(), draw_edges_of_strip_or_fan(), draw_faces(), and draw_strip_or_fan().
|
overridevirtual |
use this to push transformation matrices on the stack such that x and y coordinates correspond to window coordinates
Implements cgv::render::context.
Definition at line 1083 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::push_modelview_matrix(), cgv::render::context::push_projection_matrix(), set_modelview_matrix(), set_projection_matrix(), and cgv::render::context::support_compatibility_mode.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 283 of file gl_context.cxx.
|
overridevirtual |
implement according to specification in context class
Implements cgv::render::context.
Definition at line 1114 of file gl_context.cxx.
References cgv::data::CF_D, cgv::data::CF_RGB, cgv::data::CF_S, cgv::render::context::error(), cgv::data::packing_info::get_component_alignment(), cgv::data::data_format::get_component_format(), cgv::data::component_format::get_component_type(), cgv::data::data_view_base::get_format(), cgv::data::data_format::get_height(), cgv::data::data_view_impl< D, P >::get_ptr(), cgv::data::component_format::get_standard_component_format(), cgv::type::info::get_type_name(), cgv::data::data_format::get_width(), cgv::data::data_view_base::manage_format(), cgv::data::data_view::reflect_horizontally(), cgv::utils::to_string(), and cgv::data::data_view::~data_view().
|
overridevirtual |
restore cgv frame buffer to the state before the external change
Implements cgv::render::context.
Definition at line 1054 of file gl_context.cxx.
References cgv::render::context::frame_buffer_stack.
|
overridevirtual |
restore cgv viewport to the state before the external change
Implements cgv::render::context.
Definition at line 1074 of file gl_context.cxx.
References cgv::render::context::window_transformation_stack.
|
overridevirtual |
return a reference to a shader program used to render without illumination
Implements cgv::render::context.
Definition at line 852 of file gl_context.cxx.
References cgv::render::context::error(), cgv::render::context::is_created(), and cgv::render::shader_program::set_uniform().
|
overridevirtual |
return a reference to the default shader program used to render surfaces
return a reference to the default shader program used to render surfaces without textures
Implements cgv::render::context.
Definition at line 880 of file gl_context.cxx.
References cgv::render::context::error(), and cgv::render::context::is_created().
bool cgv::render::gl::gl_context::release_attributes | ( | const float * | normals, |
const float * | tex_coords, | ||
const int * | normal_indices, | ||
const int * | tex_coord_indices | ||
) | const |
helper function to disable attribute arrays
Definition at line 1218 of file gl_context.cxx.
References cgv::render::vertex_buffer::destruct(), cgv::render::attribute_array_binding::disable(), cgv::render::attribute_array_binding::disable_array(), cgv::render::attribute_array_binding::disable_global_array(), and cgv::render::context::get_current_program().
Referenced by draw_edges_of_faces(), draw_edges_of_strip_or_fan(), draw_faces(), and draw_strip_or_fan().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2453 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2491 of file gl_context.cxx.
void cgv::render::gl::gl_context::resize_gl | ( | ) |
Definition at line 517 of file gl_context.cxx.
|
protected |
helper function that multiplies a rotation to modelview matrix such that vector is rotated onto target
Definition at line 983 of file gl_context.cxx.
References cgv::render::context::mul_modelview_matrix().
Referenced by draw_light_source(), and tesselate_arrow().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3420 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3234 of file gl_context.cxx.
set a user defined background color for the accumulation buffer
Reimplemented from cgv::render::context.
Definition at line 542 of file gl_context.cxx.
References cgv::render::context_config::core_profile, and cgv::render::context::set_bg_accum_color().
Referenced by gl_context().
set a user defined background color
Reimplemented from cgv::render::context.
Definition at line 527 of file gl_context.cxx.
References cgv::render::context::set_bg_color().
Referenced by gl_context().
set a user defined background depth value
Reimplemented from cgv::render::context.
Definition at line 532 of file gl_context.cxx.
References cgv::render::context::set_bg_depth().
Referenced by gl_context().
set a user defined background stencil value
Reimplemented from cgv::render::context.
Definition at line 537 of file gl_context.cxx.
References cgv::render::context::set_bg_stencil().
Referenced by gl_context().
|
overridevirtual |
set the blend function
Reimplemented from cgv::render::context.
Definition at line 1567 of file gl_context.cxx.
References cgv::render::context::set_blend_func().
|
overridevirtual |
set the blend function separately for color and alpha
Reimplemented from cgv::render::context.
Definition at line 1572 of file gl_context.cxx.
References cgv::render::context::set_blend_func_separate().
|
overridevirtual |
set the complete blend state
Reimplemented from cgv::render::context.
Definition at line 1549 of file gl_context.cxx.
References cgv::render::context::BlendState::dst_alpha, cgv::render::context::BlendState::dst_color, cgv::render::context::BlendState::enabled, cgv::render::context::set_blend_state(), cgv::render::context::BlendState::src_alpha, and cgv::render::context::BlendState::src_color.
Referenced by gl_context().
|
overridevirtual |
set the buffer mask for depth and color buffers
Reimplemented from cgv::render::context.
Definition at line 1592 of file gl_context.cxx.
References cgv::render::context::set_buffer_mask().
Referenced by gl_context().
set the current color
Reimplemented from cgv::render::context.
Definition at line 798 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::current_color, cgv::render::shader_program::set_attribute(), cgv::render::context::shader_program_stack, and cgv::render::context::support_compatibility_mode.
Referenced by draw_light_source().
set the color buffer mask
Reimplemented from cgv::render::context.
Definition at line 1608 of file gl_context.cxx.
References cgv::render::context::set_color_mask().
|
overridevirtual |
set the culling state
Reimplemented from cgv::render::context.
Definition at line 1530 of file gl_context.cxx.
References cgv::render::context::set_cull_state().
Referenced by draw_light_source(), and gl_context().
|
overridevirtual |
set the depth test function
Reimplemented from cgv::render::context.
Definition at line 1515 of file gl_context.cxx.
References cgv::render::context::set_depth_func().
set the depth buffer mask
Reimplemented from cgv::render::context.
Definition at line 1603 of file gl_context.cxx.
References cgv::render::context::set_depth_mask().
|
overridevirtual |
set the current depth range or one of the depth ranges in the window transformation array
Reimplemented from cgv::render::context.
Definition at line 1699 of file gl_context.cxx.
References cgv::render::context::set_depth_range(), and cgv::render::context::window_transformation_stack.
|
overridevirtual |
set the depth test state
Reimplemented from cgv::render::context.
Definition at line 1506 of file gl_context.cxx.
References cgv::render::context::DepthTestState::enabled, cgv::render::context::set_depth_test_state(), and cgv::render::context::DepthTestState::test_func.
Referenced by gl_context().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3384 of file gl_context.cxx.
|
overridevirtual |
set the current material
Reimplemented from cgv::render::context.
Definition at line 816 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::set_material(), and cgv::render::context::support_compatibility_mode.
set the current modelview matrix, which transforms from world to eye space
Reimplemented from cgv::render::context.
Definition at line 1729 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::set_modelview_matrix(), and cgv::render::context::support_compatibility_mode.
Referenced by push_pixel_coords().
set the current projection matrix, which transforms from eye to clip space
Reimplemented from cgv::render::context.
Definition at line 1741 of file gl_context.cxx.
References cgv::render::context_config::core_profile, cgv::render::context::set_projection_matrix(), and cgv::render::context::support_compatibility_mode.
Referenced by push_pixel_coords().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3096 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2923 of file gl_context.cxx.
|
overridevirtual |
set the current viewport or one of the viewports in the window transformation array
Reimplemented from cgv::render::context.
Definition at line 1680 of file gl_context.cxx.
References cgv::render::context::set_viewport(), and cgv::render::context::window_transformation_stack.
Referenced by configure_gl().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2772 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2752 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2742 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2805 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2797 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2891 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2814 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2880 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2861 of file gl_context.cxx.
|
overrideprotectedvirtual |
Reimplemented from cgv::render::context.
Definition at line 2823 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2848 of file gl_context.cxx.
|
overridevirtual |
define length and direction from start and end point and draw an arrow
Reimplemented from cgv::render::context.
Definition at line 992 of file gl_context.cxx.
References cgv::render::context::error(), cgv::render::context::mul_modelview_matrix(), cgv::render::context::pop_modelview_matrix(), cgv::render::context::push_modelview_matrix(), rotate_vector_to_target(), and tesselate_arrow().
|
overridevirtual |
tesselate an arrow from the origin in z-direction
An arrow of length L is composed of a cylinder of radius R and a cone of radius r. The parameters are
[in] | length | the total length of the radius |
[in] | aspect | is defined as R/L |
[in] | rel_tip_radius | is defined as r/R |
[in] | tip_aspect | is defined as r/l |
Reimplemented from cgv::render::context.
Definition at line 955 of file gl_context.cxx.
References cgv::render::context::mul_modelview_matrix(), cgv::render::context::pop_modelview_matrix(), cgv::render::context::push_modelview_matrix(), cgv::render::context::tesselate_unit_cone(), cgv::render::context::tesselate_unit_cylinder(), and cgv::render::context::tesselate_unit_disk().
Referenced by draw_light_source(), and tesselate_arrow().
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2433 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 1924 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 1994 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2048 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2206 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2325 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2407 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2376 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 1782 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2308 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2108 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2151 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 2338 of file gl_context.cxx.
|
protected |
Definition at line 1650 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3557 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3618 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3634 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3574 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3647 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3605 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3593 of file gl_context.cxx.
|
overrideprotectedvirtual |
Implements cgv::render::context.
Definition at line 3566 of file gl_context.cxx.
|
mutableprotected |
font used to draw textual info
Definition at line 141 of file gl_context.h.
Referenced by get_info_font_face().
|
protected |
font size to draw textual info
Definition at line 143 of file gl_context.h.
Referenced by get_info_font_size(), and gl_context().
|
mutableprotected |
Definition at line 58 of file gl_context.h.
|
protected |
Definition at line 58 of file gl_context.h.
|
protected |
Definition at line 57 of file gl_context.h.
|
protected |
Definition at line 147 of file gl_context.h.
|
protected |
Definition at line 148 of file gl_context.h.