curve_drawable
Polyline stored on the GPU, ready to be drawn.
Fields and methods
Members of the struct curve_drawable. Most of what you do with a CGP type goes through the free functions listed below.
Fields
curve_drawable_display_type display_type = curve_drawable_display_type::Curve | Drawing mode, Curve (default) for a GL_LINE_STRIP joining all the points, or Segments for GL_LINES between consecutive pairs of points. |
opengl_shader_structure shader | Shader program used to draw the curve, which must be valid (non-zero id) at draw time. |
opengl_vbo_structure vbo_position | VBO storing the positions of the curve points, bound to shader location 0. |
GLuint vao = 0 | OpenGL id of the Vertex Array Object of the curve, 0 when not initialized. |
affine model | Model transform sent to the uniform model, reset to identity by initialize_data_on_gpu and clear. |
vec3 color | Uniform RGB color of the curve sent to the uniform color, set to red by initialize_data_on_gpu. |
opengl_shader_structure default_shader | Static shader shared by all curve_drawable and used by default in initialize_data_on_gpu, loaded from shaders/single_color by the application. |
Methods
| Uploads the positions into a new VBO and VAO, sets the shader, and resets model to identity and color to red (does nothing but warn if position is empty). src | |
| Deletes the VBO and the VAO, sets the shader id to 0 without deleting the program, and resets model to identity and color to black. src | |
| Sends the uniforms color and model to the shader of the curve. src |
Functions taking a curve_drawable
Draw 1
Functions returning a curve_drawable
None.
Operators
None.