cgv
Loading...
Searching...
No Matches
cgv::render::gl::gl_context Class Reference

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>

Inheritance diagram for cgv::render::gl::gl_context:
cgv::render::context cgv::render::context_config

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_programref_default_shader_program (bool texture_support=false) override
 return a reference to a shader program used to render without illumination
 
shader_programref_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
 
- Public Member Functions inherited from cgv::render::context
shader_program_baseget_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 voidget_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 rgbaget_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_materialget_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
 
voidadd_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_sourceget_light_source (void *handle) const
 read access to light source
 
const light_source_statusget_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
 
voidget_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_sourceget_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.
 
- Public Member Functions inherited from cgv::render::context_config
 context_config ()
 construct config with default parameters
 
bool self_reflect (cgv::reflect::reflection_handler &srh)
 reflect the shader_path member
 

Protected Member Functions

void ensure_configured () const
 
void destruct_render_objects () override
 
void put_id (void *handle, void *ptr) const override
 
void draw_elements_void (GLenum mode, size_t count, GLenum type, size_t type_size, const void *indices) const
 
template<typename T >
void draw_elements (GLenum mode, size_t count, const T *indices) const
 
cgv::data::component_format texture_find_best_format (const cgv::data::component_format &cf, render_component &rc, const std::vector< cgv::data::data_view > *palettes=0) const override
 
bool texture_create (texture_base &tb, cgv::data::data_format &df) const override
 
bool texture_create (texture_base &tb, cgv::data::data_format &target_format, const cgv::data::const_data_view &data, int level, int cube_side=-1, int num_array_layers=0, const std::vector< cgv::data::data_view > *palettes=0) const override
 
bool texture_create_from_buffer (texture_base &tb, cgv::data::data_format &df, int x, int y, int level) const override
 
bool texture_replace (texture_base &tb, int x, int y, int z_or_cube_side, const cgv::data::const_data_view &data, int level, const std::vector< cgv::data::data_view > *palettes=0) const override
 
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 override
 
bool texture_create_mipmaps (texture_base &tb, cgv::data::data_format &df) const override
 
bool texture_generate_mipmaps (texture_base &tb, unsigned int dim) const override
 
bool texture_destruct (texture_base &tb) const override
 
bool texture_set_state (const texture_base &tb) const override
 
bool texture_enable (texture_base &tb, int tex_unit, unsigned int nr_dims) const override
 
bool texture_disable (texture_base &tb, int tex_unit, unsigned int nr_dims) const override
 
bool texture_bind_as_image (texture_base &tb, int tex_unit, int level, bool bind_array, int layer, AccessType access) const override
 
bool render_buffer_create (render_buffer_base &rc, cgv::data::component_format &cf, int &_width, int &_height) const override
 
bool render_buffer_destruct (render_buffer_base &rc) const override
 
bool frame_buffer_create (frame_buffer_base &fbb) const override
 
bool frame_buffer_attach (frame_buffer_base &fbb, const render_buffer_base &rb, bool is_depth, int i) const override
 
bool frame_buffer_attach (frame_buffer_base &fbb, const texture_base &t, bool is_depth, int level, int i, int z) const override
 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
 
bool frame_buffer_is_complete (const frame_buffer_base &fbb) const override
 check for completeness, if not complete, get the reason in last_error
 
bool frame_buffer_enable (frame_buffer_base &fbb) override
 
bool frame_buffer_disable (frame_buffer_base &fbb) override
 disable the framebuffer object
 
bool frame_buffer_destruct (frame_buffer_base &fbb) const override
 
void frame_buffer_blit (const frame_buffer_base *src_fbb_ptr, const ivec4 &S, frame_buffer_base *dst_fbb_ptr, const ivec4 &_D, BufferTypeBits btbs, bool interpolate) const override
 
int frame_buffer_get_max_nr_color_attachments () const override
 
int frame_buffer_get_max_nr_draw_buffers () const override
 
bool shader_code_create (render_component &sc, ShaderType st, const std::string &source) const override
 
bool shader_code_compile (render_component &sc) const override
 
void shader_code_destruct (render_component &sc) const override
 
bool shader_program_create (shader_program_base &spb) const override
 
void shader_program_attach (shader_program_base &spb, const render_component &sc) const override
 
bool shader_program_link (shader_program_base &spb) const override
 
bool shader_program_set_state (shader_program_base &spb) const override
 
bool shader_program_enable (shader_program_base &spb) override
 
bool shader_program_disable (shader_program_base &spb) override
 
void shader_program_detach (shader_program_base &spb, const render_component &sc) const override
 
bool shader_program_destruct (shader_program_base &spb) const override
 
int get_uniform_location (const shader_program_base &spb, const std::string &name) const override
 
bool set_uniform_void (shader_program_base &spb, int loc, type_descriptor value_type, const void *value_ptr) const override
 
bool set_uniform_array_void (shader_program_base &spb, int loc, type_descriptor value_type, const void *value_ptr, size_t nr_elements) const override
 
int get_attribute_location (const shader_program_base &spb, const std::string &name) const override
 
bool set_attribute_void (shader_program_base &spb, int loc, type_descriptor value_type, const void *value_ptr) const override
 
bool attribute_array_binding_create (attribute_array_binding_base &aab) const override
 
bool attribute_array_binding_destruct (attribute_array_binding_base &aab)
 
bool attribute_array_binding_enable (attribute_array_binding_base &aab) override
 
bool attribute_array_binding_disable (attribute_array_binding_base &aab) override
 
bool set_attribute_array_void (attribute_array_binding_base *aab, int loc, type_descriptor value_type, const vertex_buffer_base *vbb, const void *ptr, size_t nr_elements, unsigned stride_in_bytes) const override
 
bool set_element_array (attribute_array_binding_base *aab, const vertex_buffer_base *vbb) const override
 
bool enable_attribute_array (attribute_array_binding_base *aab, int loc, bool do_enable) const override
 
bool is_attribute_array_enabled (const attribute_array_binding_base *aab, int loc) const override
 
bool vertex_buffer_bind (const vertex_buffer_base &vbb, VertexBufferType _type, unsigned _idx) const override
 
bool vertex_buffer_unbind (const vertex_buffer_base &vbb, VertexBufferType _type, unsigned _idx) const override
 
bool vertex_buffer_create (vertex_buffer_base &vbb, const void *array_ptr, size_t size_in_bytes) const override
 
bool vertex_buffer_resize (vertex_buffer_base &vbb, const void *array_ptr, size_t size_in_bytes) const override
 
bool vertex_buffer_replace (vertex_buffer_base &vbb, size_t offset, size_t size_in_bytes, const void *array_ptr) const override
 
bool vertex_buffer_copy (const vertex_buffer_base &src, size_t src_offset, vertex_buffer_base &target, size_t target_offset, size_t size_in_bytes) const override
 
bool vertex_buffer_copy_back (vertex_buffer_base &vbb, size_t offset, size_t size_in_bytes, void *array_ptr) const override
 
bool vertex_buffer_destruct (vertex_buffer_base &vbb) const override
 
bool check_gl_error (const std::string &where, const cgv::render::render_component *rc=0) const
 
bool check_texture_support (TextureType tt, const std::string &where, const cgv::render::render_component *rc=0) const
 
bool check_shader_support (ShaderType st, const std::string &where, const cgv::render::render_component *rc=0) const
 
bool check_fbo_support (const std::string &where, const cgv::render::render_component *rc=0) const
 
void draw_textual_info () override
 
void rotate_vector_to_target (const dvec3 &vector, const dvec3 &target)
 helper function that multiplies a rotation to modelview matrix such that vector is rotated onto target
 
- Protected Member Functions inherited from cgv::render::context
virtual void process_text (const std::string &text)
 callback method for processing of text from the output stream
 
virtual void draw_text (const std::string &text)
 draw some text at cursor position and update cursor position
 
virtual bool attribute_array_binding_destruct (attribute_array_binding_base &aab) const
 
bool ensure_window_transformation_index (int &array_index)
 

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
 
- Protected Attributes inherited from cgv::render::context
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< vec4bg_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< vec4bg_accum_color_stack
 stack of background accumulation colors
 
std::stack< DepthTestStatedepth_test_state_stack
 stack of depth test states
 
std::stack< CullingModecull_state_stack
 stack of culling mode states
 
std::stack< BlendStateblend_state_stack
 stack of blend states
 
std::stack< BufferMaskbuffer_mask_stack
 stack of buffer masks
 
std::stack< dmat4modelview_matrix_stack
 keep two matrix stacks for model view and projection matrices
 
std::stack< dmat4projection_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_materialcurrent_material_ptr
 store pointer to current material
 
bool current_material_is_textured
 store flag to tell whether current material is textured
 
std::stack< render_inforender_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 Public Member Functions inherited from cgv::render::context
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
 
- Public Attributes inherited from cgv::render::context_config
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 Protected Member Functions inherited from cgv::render::context
static void get_buffer_list (frame_buffer_base &fbb, bool &depth_buffer, std::vector< int > &buffers, int offset=0)
 
- Static Protected Attributes inherited from cgv::render::context
static const unsigned nr_default_light_sources = 2
 number of default light sources
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ gl_context()

Member Function Documentation

◆ announce_external_frame_buffer_change()

void cgv::render::gl::gl_context::announce_external_frame_buffer_change ( void *&  cgv_fbo_storage)
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.

◆ announce_external_viewport_change()

void cgv::render::gl::gl_context::announce_external_viewport_change ( ivec4 cgv_viewport_storage)
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.

◆ attribute_array_binding_create()

bool cgv::render::gl::gl_context::attribute_array_binding_create ( attribute_array_binding_base aab) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3333 of file gl_context.cxx.

◆ attribute_array_binding_destruct()

bool cgv::render::gl::gl_context::attribute_array_binding_destruct ( attribute_array_binding_base aab)
protected

Definition at line 3350 of file gl_context.cxx.

◆ attribute_array_binding_disable()

bool cgv::render::gl::gl_context::attribute_array_binding_disable ( attribute_array_binding_base aab)
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 3373 of file gl_context.cxx.

◆ attribute_array_binding_enable()

bool cgv::render::gl::gl_context::attribute_array_binding_enable ( attribute_array_binding_base aab)
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 3365 of file gl_context.cxx.

◆ check_fbo_support()

bool cgv::render::gl::gl_context::check_fbo_support ( const std::string &  where,
const cgv::render::render_component rc = 0 
) const
protected

Definition at line 1878 of file gl_context.cxx.

◆ check_gl_error()

bool cgv::render::gl::gl_context::check_gl_error ( const std::string &  where,
const cgv::render::render_component rc = 0 
) const
protected

Definition at line 1813 of file gl_context.cxx.

◆ check_shader_support()

bool cgv::render::gl::gl_context::check_shader_support ( ShaderType  st,
const std::string &  where,
const cgv::render::render_component rc = 0 
) const
protected

Definition at line 1843 of file gl_context.cxx.

◆ check_texture_support()

bool cgv::render::gl::gl_context::check_texture_support ( TextureType  tt,
const std::string &  where,
const cgv::render::render_component rc = 0 
) const
protected

Definition at line 1823 of file gl_context.cxx.

◆ clear_background()

void cgv::render::gl::gl_context::clear_background ( bool  color_flag,
bool  depth_flag,
bool  stencil_flag = false,
bool  accum_flag = false 
)
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.

◆ configure_gl()

bool cgv::render::gl::gl_context::configure_gl ( )

◆ destruct_render_objects()

void cgv::render::gl::gl_context::destruct_render_objects ( )
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 845 of file gl_context.cxx.

◆ disable_blending()

void cgv::render::gl::gl_context::disable_blending ( )
overridevirtual

disable blending

Reimplemented from cgv::render::context.

Definition at line 1587 of file gl_context.cxx.

References cgv::render::context::disable_blending().

◆ disable_depth_test()

void cgv::render::gl::gl_context::disable_depth_test ( )
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().

◆ disable_material()

void cgv::render::gl::gl_context::disable_material ( textured_material mat)
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.

◆ draw_edges_of_faces()

void cgv::render::gl::gl_context::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
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().

◆ draw_edges_of_strip_or_fan()

void cgv::render::gl::gl_context::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
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().

◆ draw_elements()

template<typename T >
void cgv::render::gl::gl_context::draw_elements ( GLenum  mode,
size_t  count,
const T *  indices 
) const
inlineprotected

Definition at line 64 of file gl_context.h.

◆ draw_elements_void()

void cgv::render::gl::gl_context::draw_elements_void ( GLenum  mode,
size_t  count,
GLenum  type,
size_t  type_size,
const void indices 
) const
protected

Definition at line 1367 of file gl_context.cxx.

◆ draw_faces()

void cgv::render::gl::gl_context::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
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().

◆ draw_light_source()

void cgv::render::gl::gl_context::draw_light_source ( const cgv::media::illum::light_source l,
float  intensity_scale,
float  light_scale 
)
overridevirtual

◆ draw_strip_or_fan()

void cgv::render::gl::gl_context::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
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().

◆ draw_textual_info()

void cgv::render::gl::gl_context::draw_textual_info ( )
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 686 of file gl_context.cxx.

◆ enable_attribute_array()

bool cgv::render::gl::gl_context::enable_attribute_array ( attribute_array_binding_base aab,
int  loc,
bool  do_enable 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3482 of file gl_context.cxx.

◆ enable_blending()

void cgv::render::gl::gl_context::enable_blending ( )
overridevirtual

enable blending

Reimplemented from cgv::render::context.

Definition at line 1582 of file gl_context.cxx.

References cgv::render::context::enable_blending().

◆ enable_depth_test()

void cgv::render::gl::gl_context::enable_depth_test ( )
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().

◆ enable_material()

void cgv::render::gl::gl_context::enable_material ( textured_material mat)
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().

◆ ensure_configured()

void cgv::render::gl::gl_context::ensure_configured ( ) const
protected

Definition at line 1382 of file gl_context.cxx.

◆ enumerate_program_attributes()

void cgv::render::gl::gl_context::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
overridevirtual

get list of program attributes

get list of program uniforms

Implements cgv::render::context.

Definition at line 773 of file gl_context.cxx.

◆ enumerate_program_uniforms()

void cgv::render::gl::gl_context::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
overridevirtual

get list of program uniforms

Implements cgv::render::context.

Definition at line 748 of file gl_context.cxx.

◆ finish_render_pass()

void cgv::render::gl::gl_context::finish_render_pass ( )
overridevirtual

Reimplemented from cgv::render::context.

Definition at line 661 of file gl_context.cxx.

◆ frame_buffer_attach() [1/2]

bool cgv::render::gl::gl_context::frame_buffer_attach ( frame_buffer_base fbb,
const render_buffer_base rb,
bool  is_depth,
int  i 
) const
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2625 of file gl_context.cxx.

◆ frame_buffer_attach() [2/2]

bool cgv::render::gl::gl_context::frame_buffer_attach ( frame_buffer_base fbb,
const texture_base t,
bool  is_depth,
int  level,
int  i,
int  z 
) const
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().

◆ frame_buffer_blit()

void cgv::render::gl::gl_context::frame_buffer_blit ( const frame_buffer_base src_fbb_ptr,
const ivec4 S,
frame_buffer_base dst_fbb_ptr,
const ivec4 _D,
BufferTypeBits  btbs,
bool  interpolate 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2584 of file gl_context.cxx.

◆ frame_buffer_create()

bool cgv::render::gl::gl_context::frame_buffer_create ( frame_buffer_base fbb) const
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2505 of file gl_context.cxx.

◆ frame_buffer_destruct()

bool cgv::render::gl::gl_context::frame_buffer_destruct ( frame_buffer_base fbb) const
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2562 of file gl_context.cxx.

◆ frame_buffer_disable()

bool cgv::render::gl::gl_context::frame_buffer_disable ( frame_buffer_base fbb)
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.

◆ frame_buffer_enable()

bool cgv::render::gl::gl_context::frame_buffer_enable ( frame_buffer_base fbb)
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2524 of file gl_context.cxx.

◆ frame_buffer_get_max_nr_color_attachments()

int cgv::render::gl::gl_context::frame_buffer_get_max_nr_color_attachments ( ) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2717 of file gl_context.cxx.

◆ frame_buffer_get_max_nr_draw_buffers()

int cgv::render::gl::gl_context::frame_buffer_get_max_nr_draw_buffers ( ) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2727 of file gl_context.cxx.

◆ frame_buffer_is_complete()

bool cgv::render::gl::gl_context::frame_buffer_is_complete ( const frame_buffer_base fbb) const
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().

◆ get_attribute_location()

int cgv::render::gl::gl_context::get_attribute_location ( const shader_program_base spb,
const std::string &  name 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3228 of file gl_context.cxx.

◆ get_current_font_face()

media::font::font_face_ptr cgv::render::gl::gl_context::get_current_font_face ( ) const
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().

◆ get_current_font_size()

float cgv::render::gl::gl_context::get_current_font_size ( ) const
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().

◆ get_info_font_face()

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().

◆ get_info_font_size()

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().

◆ get_max_window_transformation_array_size()

unsigned cgv::render::gl::gl_context::get_max_window_transformation_array_size ( ) const
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.

◆ get_modelview_matrix()

dmat4 cgv::render::gl::gl_context::get_modelview_matrix ( ) const
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.

◆ get_projection_matrix()

dmat4 cgv::render::gl::gl_context::get_projection_matrix ( ) const
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.

◆ get_render_api()

RenderAPI cgv::render::gl::gl_context::get_render_api ( ) const
overridevirtual

return the used rendering API

Implements cgv::render::context.

Definition at line 364 of file gl_context.cxx.

◆ get_uniform_location()

int cgv::render::gl::gl_context::get_uniform_location ( const shader_program_base spb,
const std::string &  name 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2899 of file gl_context.cxx.

◆ get_window_z()

double cgv::render::gl::gl_context::get_window_z ( int  x_window,
int  y_window 
) const
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().

◆ init_render_pass()

void cgv::render::gl::gl_context::init_render_pass ( )
overridevirtual

Reimplemented from cgv::render::context.

Definition at line 577 of file gl_context.cxx.

◆ is_attribute_array_enabled()

bool cgv::render::gl::gl_context::is_attribute_array_enabled ( const attribute_array_binding_base aab,
int  loc 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3505 of file gl_context.cxx.

◆ on_lights_changed()

◆ perform_screen_shot()

void cgv::render::gl::gl_context::perform_screen_shot ( )
overridevirtual

Reimplemented from cgv::render::context.

Definition at line 730 of file gl_context.cxx.

◆ pop_pixel_coords()

void cgv::render::gl::gl_context::pop_pixel_coords ( )
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().

◆ pop_window_transformation_array()

void cgv::render::gl::gl_context::pop_window_transformation_array ( )
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().

◆ prepare_attributes()

◆ push_pixel_coords()

void cgv::render::gl::gl_context::push_pixel_coords ( )
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.

◆ put_id()

void cgv::render::gl::gl_context::put_id ( void handle,
void ptr 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 283 of file gl_context.cxx.

◆ read_frame_buffer()

◆ recover_from_external_frame_buffer_change()

void cgv::render::gl::gl_context::recover_from_external_frame_buffer_change ( void cgv_fbo_storage)
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.

◆ recover_from_external_viewport_change()

void cgv::render::gl::gl_context::recover_from_external_viewport_change ( const ivec4 cgv_viewport_storage)
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.

◆ ref_default_shader_program()

shader_program & cgv::render::gl::gl_context::ref_default_shader_program ( bool  texture_support = false)
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().

◆ ref_surface_shader_program()

shader_program & cgv::render::gl::gl_context::ref_surface_shader_program ( bool  texture_support = false)
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().

◆ release_attributes()

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

◆ render_buffer_create()

bool cgv::render::gl::gl_context::render_buffer_create ( render_buffer_base rc,
cgv::data::component_format cf,
int _width,
int _height 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2453 of file gl_context.cxx.

◆ render_buffer_destruct()

bool cgv::render::gl::gl_context::render_buffer_destruct ( render_buffer_base rc) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2491 of file gl_context.cxx.

◆ resize_gl()

void cgv::render::gl::gl_context::resize_gl ( )

Definition at line 517 of file gl_context.cxx.

◆ rotate_vector_to_target()

void cgv::render::gl::gl_context::rotate_vector_to_target ( const dvec3 vector,
const dvec3 target 
)
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().

◆ set_attribute_array_void()

bool cgv::render::gl::gl_context::set_attribute_array_void ( attribute_array_binding_base aab,
int  loc,
type_descriptor  value_type,
const vertex_buffer_base vbb,
const void ptr,
size_t  nr_elements,
unsigned  stride_in_bytes 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3420 of file gl_context.cxx.

◆ set_attribute_void()

bool cgv::render::gl::gl_context::set_attribute_void ( shader_program_base spb,
int  loc,
type_descriptor  value_type,
const void value_ptr 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3234 of file gl_context.cxx.

◆ set_bg_accum_color()

void cgv::render::gl::gl_context::set_bg_accum_color ( vec4  rgba)
overridevirtual

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_bg_color()

void cgv::render::gl::gl_context::set_bg_color ( vec4  rgba)
overridevirtual

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_bg_depth()

void cgv::render::gl::gl_context::set_bg_depth ( float  d)
overridevirtual

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_bg_stencil()

void cgv::render::gl::gl_context::set_bg_stencil ( int  s)
overridevirtual

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().

◆ set_blend_func()

void cgv::render::gl::gl_context::set_blend_func ( BlendFunction  src_factor,
BlendFunction  dst_factor 
)
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().

◆ set_blend_func_separate()

void cgv::render::gl::gl_context::set_blend_func_separate ( BlendFunction  src_color_factor,
BlendFunction  dst_color_factor,
BlendFunction  src_alpha_factor,
BlendFunction  dst_alpha_factor 
)
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().

◆ set_blend_state()

◆ set_buffer_mask()

void cgv::render::gl::gl_context::set_buffer_mask ( BufferMask  mask)
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_color()

◆ set_color_mask()

void cgv::render::gl::gl_context::set_color_mask ( bvec4  flags)
overridevirtual

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().

◆ set_cull_state()

void cgv::render::gl::gl_context::set_cull_state ( CullingMode  culling_mode)
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().

◆ set_depth_func()

void cgv::render::gl::gl_context::set_depth_func ( CompareFunction  func)
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_depth_mask()

void cgv::render::gl::gl_context::set_depth_mask ( bool  flag)
overridevirtual

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().

◆ set_depth_range()

void cgv::render::gl::gl_context::set_depth_range ( const dvec2 depth_range = dvec2(0, 1),
int  array_index = -1 
)
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.

◆ set_depth_test_state()

void cgv::render::gl::gl_context::set_depth_test_state ( DepthTestState  state)
overridevirtual

◆ set_element_array()

bool cgv::render::gl::gl_context::set_element_array ( attribute_array_binding_base aab,
const vertex_buffer_base vbb 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3384 of file gl_context.cxx.

◆ set_material()

void cgv::render::gl::gl_context::set_material ( const cgv::media::illum::surface_material mat)
overridevirtual

◆ set_modelview_matrix()

void cgv::render::gl::gl_context::set_modelview_matrix ( const dmat4 V)
overridevirtual

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_projection_matrix()

void cgv::render::gl::gl_context::set_projection_matrix ( const dmat4 P)
overridevirtual

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().

◆ set_uniform_array_void()

bool cgv::render::gl::gl_context::set_uniform_array_void ( shader_program_base spb,
int  loc,
type_descriptor  value_type,
const void value_ptr,
size_t  nr_elements 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3096 of file gl_context.cxx.

◆ set_uniform_void()

bool cgv::render::gl::gl_context::set_uniform_void ( shader_program_base spb,
int  loc,
type_descriptor  value_type,
const void value_ptr 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2923 of file gl_context.cxx.

◆ set_viewport()

void cgv::render::gl::gl_context::set_viewport ( const ivec4 viewport,
int  array_index = -1 
)
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().

◆ shader_code_compile()

bool cgv::render::gl::gl_context::shader_code_compile ( render_component sc) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2772 of file gl_context.cxx.

◆ shader_code_create()

bool cgv::render::gl::gl_context::shader_code_create ( render_component sc,
ShaderType  st,
const std::string &  source 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2752 of file gl_context.cxx.

◆ shader_code_destruct()

void cgv::render::gl::gl_context::shader_code_destruct ( render_component sc) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2742 of file gl_context.cxx.

◆ shader_program_attach()

void cgv::render::gl::gl_context::shader_program_attach ( shader_program_base spb,
const render_component sc 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2805 of file gl_context.cxx.

◆ shader_program_create()

bool cgv::render::gl::gl_context::shader_program_create ( shader_program_base spb) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2797 of file gl_context.cxx.

◆ shader_program_destruct()

bool cgv::render::gl::gl_context::shader_program_destruct ( shader_program_base spb) const
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2891 of file gl_context.cxx.

◆ shader_program_detach()

void cgv::render::gl::gl_context::shader_program_detach ( shader_program_base spb,
const render_component sc 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2814 of file gl_context.cxx.

◆ shader_program_disable()

bool cgv::render::gl::gl_context::shader_program_disable ( shader_program_base spb)
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2880 of file gl_context.cxx.

◆ shader_program_enable()

bool cgv::render::gl::gl_context::shader_program_enable ( shader_program_base spb)
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2861 of file gl_context.cxx.

◆ shader_program_link()

bool cgv::render::gl::gl_context::shader_program_link ( shader_program_base spb) const
overrideprotectedvirtual

Reimplemented from cgv::render::context.

Definition at line 2823 of file gl_context.cxx.

◆ shader_program_set_state()

bool cgv::render::gl::gl_context::shader_program_set_state ( shader_program_base spb) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2848 of file gl_context.cxx.

◆ tesselate_arrow() [1/2]

void cgv::render::gl::gl_context::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 
)
overridevirtual

◆ tesselate_arrow() [2/2]

void cgv::render::gl::gl_context::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 
)
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

Parameters
[in]lengththe total length of the radius
[in]aspectis defined as R/L
[in]rel_tip_radiusis defined as r/R
[in]tip_aspectis 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().

◆ texture_bind_as_image()

bool cgv::render::gl::gl_context::texture_bind_as_image ( texture_base tb,
int  tex_unit,
int  level,
bool  bind_array,
int  layer,
AccessType  access 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2433 of file gl_context.cxx.

◆ texture_create() [1/2]

bool cgv::render::gl::gl_context::texture_create ( texture_base tb,
cgv::data::data_format df 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 1924 of file gl_context.cxx.

◆ texture_create() [2/2]

bool cgv::render::gl::gl_context::texture_create ( texture_base tb,
cgv::data::data_format target_format,
const cgv::data::const_data_view data,
int  level,
int  cube_side = -1,
int  num_array_layers = 0,
const std::vector< cgv::data::data_view > *  palettes = 0 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 1994 of file gl_context.cxx.

◆ texture_create_from_buffer()

bool cgv::render::gl::gl_context::texture_create_from_buffer ( texture_base tb,
cgv::data::data_format df,
int  x,
int  y,
int  level 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2048 of file gl_context.cxx.

◆ texture_create_mipmaps()

bool cgv::render::gl::gl_context::texture_create_mipmaps ( texture_base tb,
cgv::data::data_format df 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2206 of file gl_context.cxx.

◆ texture_destruct()

bool cgv::render::gl::gl_context::texture_destruct ( texture_base tb) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2325 of file gl_context.cxx.

◆ texture_disable()

bool cgv::render::gl::gl_context::texture_disable ( texture_base tb,
int  tex_unit,
unsigned int  nr_dims 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2407 of file gl_context.cxx.

◆ texture_enable()

bool cgv::render::gl::gl_context::texture_enable ( texture_base tb,
int  tex_unit,
unsigned int  nr_dims 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2376 of file gl_context.cxx.

◆ texture_find_best_format()

cgv::data::component_format cgv::render::gl::gl_context::texture_find_best_format ( const cgv::data::component_format cf,
render_component rc,
const std::vector< cgv::data::data_view > *  palettes = 0 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 1782 of file gl_context.cxx.

◆ texture_generate_mipmaps()

bool cgv::render::gl::gl_context::texture_generate_mipmaps ( texture_base tb,
unsigned int  dim 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2308 of file gl_context.cxx.

◆ texture_replace()

bool cgv::render::gl::gl_context::texture_replace ( texture_base tb,
int  x,
int  y,
int  z_or_cube_side,
const cgv::data::const_data_view data,
int  level,
const std::vector< cgv::data::data_view > *  palettes = 0 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2108 of file gl_context.cxx.

◆ texture_replace_from_buffer()

bool cgv::render::gl::gl_context::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
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2151 of file gl_context.cxx.

◆ texture_set_state()

bool cgv::render::gl::gl_context::texture_set_state ( const texture_base tb) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 2338 of file gl_context.cxx.

◆ update_window_transformation_array()

void cgv::render::gl::gl_context::update_window_transformation_array ( )
protected

Definition at line 1650 of file gl_context.cxx.

◆ vertex_buffer_bind()

bool cgv::render::gl::gl_context::vertex_buffer_bind ( const vertex_buffer_base vbb,
VertexBufferType  _type,
unsigned  _idx 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3557 of file gl_context.cxx.

◆ vertex_buffer_copy()

bool cgv::render::gl::gl_context::vertex_buffer_copy ( const vertex_buffer_base src,
size_t  src_offset,
vertex_buffer_base target,
size_t  target_offset,
size_t  size_in_bytes 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3618 of file gl_context.cxx.

◆ vertex_buffer_copy_back()

bool cgv::render::gl::gl_context::vertex_buffer_copy_back ( vertex_buffer_base vbb,
size_t  offset,
size_t  size_in_bytes,
void array_ptr 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3634 of file gl_context.cxx.

◆ vertex_buffer_create()

bool cgv::render::gl::gl_context::vertex_buffer_create ( vertex_buffer_base vbb,
const void array_ptr,
size_t  size_in_bytes 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3574 of file gl_context.cxx.

◆ vertex_buffer_destruct()

bool cgv::render::gl::gl_context::vertex_buffer_destruct ( vertex_buffer_base vbb) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3647 of file gl_context.cxx.

◆ vertex_buffer_replace()

bool cgv::render::gl::gl_context::vertex_buffer_replace ( vertex_buffer_base vbb,
size_t  offset,
size_t  size_in_bytes,
const void array_ptr 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3605 of file gl_context.cxx.

◆ vertex_buffer_resize()

bool cgv::render::gl::gl_context::vertex_buffer_resize ( vertex_buffer_base vbb,
const void array_ptr,
size_t  size_in_bytes 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3593 of file gl_context.cxx.

◆ vertex_buffer_unbind()

bool cgv::render::gl::gl_context::vertex_buffer_unbind ( const vertex_buffer_base vbb,
VertexBufferType  _type,
unsigned  _idx 
) const
overrideprotectedvirtual

Implements cgv::render::context.

Definition at line 3566 of file gl_context.cxx.

Member Data Documentation

◆ info_font_face

cgv::media::font::font_face_ptr cgv::render::gl::gl_context::info_font_face
mutableprotected

font used to draw textual info

Definition at line 141 of file gl_context.h.

Referenced by get_info_font_face().

◆ info_font_size

float cgv::render::gl::gl_context::info_font_size
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().

◆ max_nr_indices

cgv::type::uint64_type cgv::render::gl::gl_context::max_nr_indices
mutableprotected

Definition at line 58 of file gl_context.h.

◆ max_nr_vertices

cgv::type::uint64_type cgv::render::gl::gl_context::max_nr_vertices
protected

Definition at line 58 of file gl_context.h.

◆ progs

shader_program cgv::render::gl::gl_context::progs[4]
protected

Definition at line 57 of file gl_context.h.

◆ show_help

bool cgv::render::gl::gl_context::show_help
protected

Definition at line 147 of file gl_context.h.

◆ show_stats

bool cgv::render::gl::gl_context::show_stats
protected

Definition at line 148 of file gl_context.h.


The documentation for this class was generated from the following files: