Brunot
Loading...
Searching...
No Matches
VAO.h
Go to the documentation of this file.
1// File: VAO.h
2// Description: "Vertex Attribute Object" - Holds information about edges, vertices, and faces for OpenGL
3// Author(s): Aidan Hartman (aidan.hartman@digipen.edu) Pair progamming with Ori
4// Ori Balashov (ori.balashov@digipen.edu) Pair progamming with Aidan
5// 2025 / 10 / 03
6// (C) Digipen 2025
7// ____ __ __ __
8// /\__ _\/\ \ /\ \/\ \
9// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
10// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
11// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
12// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
13// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
14#pragma once
15
16namespace gfx
17{
18class VertexBuffer;
19class IndexBuffer;
20}
21
22using GLuint = unsigned int;
23using GLint = int;
24
25namespace gfx
26{
33}
34
35namespace gfx
36{
37
38
39class VAO
40{
41public:
42 VAO(const VertexBuffer& vertexBuffer, const IndexBuffer& indexBuffer);
43 ~VAO();
44 // ! warning: copy and move operators all do shallow copies
45 VAO(const VAO& other) = default;
46 VAO(VAO&& other) noexcept = default;
47 auto operator=(const VAO& other) -> VAO& = default;
48 auto operator=(VAO&& other) noexcept -> VAO& = default;
49
50 auto activate() const -> void;
51 auto deactivate() const -> void;
52
53 auto ID() const -> GLuint
54 {
55 return VAOID;
56 }
57
58private:
60
61 int color;
64};
65
66}
unsigned int GLuint
Definition IndexBuffer.h:17
int GLint
Definition VAO.h:23
Definition IndexBuffer.h:23
int textureCoord
Definition VAO.h:63
auto operator=(VAO &&other) noexcept -> VAO &=default
VAO(const VertexBuffer &vertexBuffer, const IndexBuffer &indexBuffer)
Definition VAO.cpp:27
~VAO()
Definition VAO.cpp:50
GLuint VAOID
Definition VAO.h:59
auto activate() const -> void
Definition VAO.cpp:55
int position
Definition VAO.h:62
int color
Definition VAO.h:61
auto operator=(const VAO &other) -> VAO &=default
VAO(VAO &&other) noexcept=default
auto ID() const -> GLuint
Definition VAO.h:53
VAO(const VAO &other)=default
auto deactivate() const -> void
Definition VAO.cpp:61
Buffer that holds data for the vertices for OpenGL.
Definition VertexBuffer.h:32
Definition Sprite.h:25
shaderAttributes
Definition VAO.h:28
@ aColor
Definition VAO.h:31
@ aTextureCoordinate
Definition VAO.h:30
@ aPosition
Definition VAO.h:29