diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-09-17 15:30:21 +0200 | 
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-09-17 15:30:21 +0200 | 
| commit | f28e9c3e03a9f94764b3811f7c4aa01991943fc7 (patch) | |
| tree | 569850adf97494f5ce31dfe31a4c2703f378a144 /src/renderer/opengl/GlIndexBuffer.cpp | |
| parent | b46a0d9369fbaa1938f0968ab216bc2d564a9c37 (diff) | |
switch to software renderer
Diffstat (limited to 'src/renderer/opengl/GlIndexBuffer.cpp')
| -rw-r--r-- | src/renderer/opengl/GlIndexBuffer.cpp | 44 | 
1 files changed, 0 insertions, 44 deletions
diff --git a/src/renderer/opengl/GlIndexBuffer.cpp b/src/renderer/opengl/GlIndexBuffer.cpp deleted file mode 100644 index c5bd713..0000000 --- a/src/renderer/opengl/GlIndexBuffer.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include <renderer/opengl/GlIndexBuffer.hpp> - -#include <GL/glew.h> -#include <string.h> -#include <stdio.h> -#include <assert.h> - -void GlIndexBuffer::Init() { -    m_CurrentIndex = 0; -    m_Indices.reserve(16384); -    glGenBuffers(1, &m_Id); -    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_Id); -} - -uint32_t *GlIndexBuffer::GetData() { -    return m_Indices.data(); -} - -uint32_t GlIndexBuffer::GetCount() { -    uint32_t count = static_cast<uint32_t>(m_Indices.size()); -    return count; -} - -void GlIndexBuffer::Reset() { -    m_CurrentIndex = 0; -    m_Indices.clear(); -} - -void GlIndexBuffer::PushRectangle() { -    uint32_t current_index = m_CurrentIndex; -    m_Indices.push_back(current_index + 0); -    m_Indices.push_back(current_index + 1); -    m_Indices.push_back(current_index + 2); -    m_Indices.push_back(current_index + 0); -    m_Indices.push_back(current_index + 2); -    m_Indices.push_back(current_index + 3); -    m_CurrentIndex += 4; -} - -void GlIndexBuffer::TransferData() { -    size_t size = m_Indices.size() * sizeof(uint32_t); -    glBufferData(GL_ELEMENT_ARRAY_BUFFER, size, m_Indices.data(), GL_STATIC_DRAW); -} -  | 
