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
16class VertexBuffer;
17class IndexBuffer;
18
19using GLuint = unsigned int;
20using GLint = int;
21
22namespace gfx
23{
30}
31
32class VAO
33{
34public:
35 VAO(const VertexBuffer& vertexBuffer, const IndexBuffer& indexBuffer);
36 ~VAO();
37 // ! warning: copy and move operators all do shallow copies
38 VAO(const VAO& other) = default;
39 VAO(VAO&& other) noexcept = default;
40 auto operator=(const VAO& other) -> VAO& = default;
41 auto operator=(VAO&& other) noexcept -> VAO& = default;
42
43 auto activate() const -> void;
44 auto deactivate() const -> void;
45
46 auto ID() const -> GLuint
47 {
48 return VAOID;
49 }
50
51private:
53
54 int color;
57};
unsigned int GLuint
Definition IndexBuffer.h:17
int GLint
Definition VAO.h:20
Definition IndexBuffer.h:20
int position
Definition VAO.h:55
int color
Definition VAO.h:54
int textureCoord
Definition VAO.h:56
auto operator=(const VAO &other) -> VAO &=default
~VAO()
Definition VAO.cpp:46
auto ID() const -> GLuint
Definition VAO.h:46
GLuint VAOID
Definition VAO.h:52
auto deactivate() const -> void
Definition VAO.cpp:57
VAO(const VAO &other)=default
VAO(const VertexBuffer &vertexBuffer, const IndexBuffer &indexBuffer)
Definition VAO.cpp:23
auto activate() const -> void
Definition VAO.cpp:51
VAO(VAO &&other) noexcept=default
auto operator=(VAO &&other) noexcept -> VAO &=default
Buffer that holds data for the vertices for OpenGL.
Definition VertexBuffer.h:29
Definition VAO.h:23
shaderAttributes
Definition VAO.h:25
@ aColor
Definition VAO.h:28
@ aTextureCoordinate
Definition VAO.h:27
@ aPosition
Definition VAO.h:26