21 #include "hx3d/graphics/geometries/base_geometry.hpp" 28 addAttribute(
"Position",
Attribute(
"a_position", GL_FLOAT, 3));
29 addAttribute(
"Color",
Attribute(
"a_color", GL_FLOAT, 4));
30 addAttribute(
"Texture",
Attribute(
"a_texture", GL_FLOAT, 2));
31 addAttribute(
"Normal",
Attribute(
"a_normal", GL_FLOAT, 3));
34 void BaseGeometry::addAttribute(std::string name,
Attribute attribute) {
35 _attributes[name].create(attribute);
38 void BaseGeometry::setAttribute(std::string name, std::vector<float> values) {
39 _attributes[name].set(values);
43 return _attributes[name];
46 void BaseGeometry::setIndices(std::vector<GLushort> values) {
54 void BaseGeometry::setFaceCulling(
Culling culling) {
55 _cullingType = culling;
58 void BaseGeometry::uploadAll() {
59 for (
auto& a: _attributes) {
Culling
Face culling type.
Attribute specialized array buffer.
void set(const std::vector< T > &values)
Set the buffer values.
virtual void upload() override
Upload the data to the GPU.