Brunot
Loading...
Searching...
No Matches
IndexBuffer.h
Go to the documentation of this file.
1// File: IndexBuffer.h
2// Description: Buffer that holds data for the faces for OpenGL
3// Author(s): Ori Balashov (ori.balashov@digipen.edu) Pair programmed with Aidan
4// Aidan Hartman (aidan.hartman@digipen.edu) Pair programmed with Ori
5// 2025 / 10 / 03
6// (C) Digipen 2025
7// ____ __ __ __
8// /\__ _\/\ \ /\ \/\ \
9// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
10// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
11// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
12// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
13// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
14#pragma once
15
16
17using GLuint = unsigned int;
18
20{
21public:
22 IndexBuffer(const unsigned int* data, unsigned int bytes, unsigned int indexCount);
24
25 // ! warning: copy and move operators all do shallow copies
26 IndexBuffer(const IndexBuffer& other) = default;
27 IndexBuffer(IndexBuffer&& other) noexcept = default;
28 auto operator=(const IndexBuffer& other) -> IndexBuffer& = default;
29 auto operator=(IndexBuffer&& other) noexcept -> IndexBuffer& = default;
30
31 auto activate() const -> void;
32 auto deactivate() const -> void;
33
34 auto getID() const -> GLuint;
35
36 auto count() const -> unsigned int
37 {
38 return elementCount;
39 }
40
41private:
43 unsigned int elementCount;
44};
unsigned int GLuint
Definition IndexBuffer.h:17
auto activate() const -> void
Definition IndexBuffer.cpp:33
auto operator=(const IndexBuffer &other) -> IndexBuffer &=default
IndexBuffer(IndexBuffer &&other) noexcept=default
auto operator=(IndexBuffer &&other) noexcept -> IndexBuffer &=default
~IndexBuffer()
Definition IndexBuffer.cpp:28
auto count() const -> unsigned int
Definition IndexBuffer.h:36
auto deactivate() const -> void
Definition IndexBuffer.cpp:39
IndexBuffer(const unsigned int *data, unsigned int bytes, unsigned int indexCount)
Definition IndexBuffer.cpp:18
unsigned int elementCount
Definition IndexBuffer.h:43
GLuint ID
Definition IndexBuffer.h:42
auto getID() const -> GLuint
Definition IndexBuffer.cpp:44
IndexBuffer(const IndexBuffer &other)=default