Hymn to Beauty
C++ 3D Engine
OpenGLVertexDescription.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "../Interface/VertexDescription.hpp"
4
5#include <glad/glad.h>
6#include <vector>
7
8namespace Video {
9
12 public:
16 GLuint location;
17
19 GLenum type;
20
22 GLint size;
23
25 GLboolean normalized;
26
28 uintptr_t offset;
29 };
30
32
37 OpenGLVertexDescription(unsigned int attributeCount, const VertexDescription::Attribute* attributes, bool indexBuffer);
38
41
43
46 unsigned int GetStride() const;
47
49
52 const std::vector<OpenGLAttribute>& GetAttributes() const;
53
54 private:
56
57 unsigned int stride;
58 std::vector<OpenGLAttribute> attributes;
59};
60
61}
OpenGL implementation of VertexDescription.
Definition: OpenGLVertexDescription.hpp:11
OpenGLVertexDescription(unsigned int attributeCount, const VertexDescription::Attribute *attributes, bool indexBuffer)
Create new OpenGL vertex description.
Definition: OpenGLVertexDescription.cpp:10
unsigned int GetStride() const
Get the stride between vertices.
Definition: OpenGLVertexDescription.cpp:55
~OpenGLVertexDescription() final
Destructor.
Definition: OpenGLVertexDescription.cpp:51
const std::vector< OpenGLAttribute > & GetAttributes() const
Get the attributes.
Definition: OpenGLVertexDescription.cpp:59
Describes how a vertex buffer is accessed by a shader.
Definition: VertexDescription.hpp:8
Definition: Editor.hpp:18
Describes an OpenGL attribute in a vertex array object.
Definition: OpenGLVertexDescription.hpp:14
GLuint location
The location of the attribute in the vertex shader.
Definition: OpenGLVertexDescription.hpp:16
GLboolean normalized
Whether the values should be normalized when accessed.
Definition: OpenGLVertexDescription.hpp:25
GLenum type
The type of each component in the attribute.
Definition: OpenGLVertexDescription.hpp:19
GLint size
The number of components in the attribute.
Definition: OpenGLVertexDescription.hpp:22
uintptr_t offset
The offset to the first component in the buffer.
Definition: OpenGLVertexDescription.hpp:28
Describes an attribute used in a vertex shader.
Definition: VertexDescription.hpp:18