aboutsummaryrefslogtreecommitdiff
path: root/source/30-game/VertexIndex.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2023-10-19 22:50:07 -0700
committerrtk0c <[email protected]>2025-08-16 11:31:16 -0700
commit297232d21594b138bb368a42b5b0d085ff9ed6aa (patch)
tree075d5407e1e12a9d35cbee6e4c20ad34e0765c42 /source/30-game/VertexIndex.hpp
parentd5cd34ff69f7fd134d5450696f298af1a864afbc (diff)
The great renaming: switch to "module style"
Diffstat (limited to 'source/30-game/VertexIndex.hpp')
-rw-r--r--source/30-game/VertexIndex.hpp67
1 files changed, 0 insertions, 67 deletions
diff --git a/source/30-game/VertexIndex.hpp b/source/30-game/VertexIndex.hpp
deleted file mode 100644
index 2d65617..0000000
--- a/source/30-game/VertexIndex.hpp
+++ /dev/null
@@ -1,67 +0,0 @@
-#pragma once
-
-#include "GraphicsTags.hpp"
-#include "RcPtr.hpp"
-#include "SmallVector.hpp"
-
-#include <glad/glad.h>
-#include <cstddef>
-#include <cstdint>
-#include <vector>
-
-struct GpuVertexBuffer : public RefCounted {
- GLuint handle;
- int sizeInBytes;
-
- GpuVertexBuffer();
- ~GpuVertexBuffer();
-
- void Upload(const std::byte* data, size_t sizeInBytes);
-};
-
-struct GpuIndexBuffer : public RefCounted {
- GLuint handle;
- Tags::IndexType indexType;
- int count;
-
- GpuIndexBuffer();
- ~GpuIndexBuffer();
-
- Tags::IndexType GetIndexType() const { return indexType; }
- GLenum GetIndexTypeGL() const { return Tags::FindGLType(indexType); }
-
- void Upload(const std::byte* data, Tags::IndexType type, size_t count);
-};
-
-struct BufferBindings {
- SmallVector<RcPtr<GpuVertexBuffer>, 4> bindings;
-
- int GetMaxBindingIndex() const;
-
- /// Safe. Returns nullptr if the index is not bound to any buffers.
- GpuVertexBuffer* GetBinding(int index) const;
- /// Adds or updates a buffer binding. Setting a binding to nullptr effectively removes the binding.
- void SetBinding(int index, GpuVertexBuffer* buffer);
- void Clear();
-};
-
-struct VertexElementFormat {
- /// NOTE:
- /// "Automatic" means it will be set inside VertexFormat::AddElement()
- /// "Parameter" means it must be set by the user
- /* Automatic */ int offset;
- /* Parameter */ int bindingIndex;
- /* Parameter */ Tags::VertexElementType type;
- /* Parameter */ Tags::VertexElementSemantic semantic;
-
- int GetStride() const;
-};
-
-struct VertexFormat : public RefCounted {
- SmallVector<VertexElementFormat, 4> elements;
- int vertexSize = 0;
-
- const decltype(elements)& GetElements() const { return elements; }
- void AddElement(VertexElementFormat element);
- void RemoveElement(int index);
-};