Brenta Engine 1.2
Loading...
Searching...
No Matches
vao.hpp
1// SPDX-License-Identifier: MIT
2// Author: Giovanni Santini
3// Mail: giovanni.santini@proton.me
4// Github: @San7o
5
6#pragma once
7
8#include <brenta/buffer.hpp>
9#include <glad/glad.h>
10
11namespace brenta
12{
13
14namespace types
15{
16
22class vao
23{
24public:
25
26 unsigned int vao_id;
27
31 vao();
32
33 constexpr vao(const vao&) = delete;
34 constexpr vao& operator=(const vao&) = delete;
35
36
37 constexpr vao(vao&& other) noexcept
38 {
39 this->vao_id = other.vao_id;
40 other.vao_id = 0;
41 }
42 constexpr vao& operator=(vao&& other) noexcept
43 {
44 this->vao_id = other.vao_id;
45 other.vao_id = 0;
46 return *this;
47 }
48
49 ~vao();
50
51 void init();
52 void destroy();
53 void bind() const;
54 void unbind() const;
55
56 unsigned int get_id() const;
57
71 void set_vertex_data(buffer &buffer, unsigned int index, GLint size,
72 GLenum type, GLboolean is_normalized, GLsizei stride,
73 const void *pointer);
74};
75
76} // namespace types
77
78} // namespace brenta
Buffer wrapper around OpenGL buffer objects.
Definition buffer.hpp:23
Vertex Array Object (VAO)
Definition vao.hpp:23
vao()
Default constructor, does nothing.
Definition vao.cpp:11
void set_vertex_data(buffer &buffer, unsigned int index, GLint size, GLenum type, GLboolean is_normalized, GLsizei stride, const void *pointer)
Set the vertex data.
Definition vao.cpp:56