4 #include <cgv/render/context.h>
5 #include <cgv/render/vertex_buffer.h>
6 #include <cgv/render/shader_program.h>
7 #include <cgv/render/attribute_array_binding.h>
8 #include <cgv/render/textured_material.h>
10 #include "lib_begin.h"
28 enum VertexAttributeID
36 struct vertex_attribute
38 VertexAttributeID vertex_attribute_id;
40 type_descriptor element_type;
46 struct CGV_API attribute_array
48 std::vector<vertex_attribute> vas;
49 attribute_array_binding* aab_ptr;
52 void add_attribute(type_descriptor element_type, uint32_t vbo_index,
53 size_t byte_offset,
size_t element_count, uint32_t stride,
54 VertexAttributeID vertex_attribute_id, std::string name =
"");
59 DrawCallType draw_call_type;
61 uint32_t material_index;
63 uint32_t vertex_offset;
67 uint32_t instance_count;
86 std::vector<vertex_buffer*>
vbos;
88 std::vector<attribute_array>
aas;
92 void draw(
context& ctx,
const draw_call& dc,
const draw_call* prev_dc = 0,
const draw_call* next_dc = 0,
bool use_materials =
true);
97 const std::vector<textured_material*>& get_materials()
const;
99 const std::vector<vertex_buffer*>& get_vbos()
const;
101 const std::vector<attribute_array>& get_aas()
const;
103 const std::vector<texture*>& get_textures()
const;
105 const std::vector<draw_call>& get_draw_calls()
const;
107 std::vector<textured_material*>& ref_materials();
109 std::vector<vertex_buffer*>& ref_vbos();
111 std::vector<attribute_array>& ref_aas();
113 std::vector<texture*>& ref_textures();
115 std::vector<draw_call>& ref_draw_calls();
119 void draw_all(
context& ctx,
bool skip_opaque =
false,
bool skip_blended =
false,
bool use_materials =
true);
126 #include <cgv/config/lib_end.h>