Avara3D 0.2.0
C++ API reference
OGLDebugLines.h
1//
2// OGLDebugLines.h
3// avara3d
4//
5// Created by Morgan Davis on 1/4/26.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_RENDER_BACKEND_OPENGL_OGLDEBUGLINES_H
10#define AVARA3D_RENDER_BACKEND_OPENGL_OGLDEBUGLINES_H
11
12#include <vector>
13
14#include "a3d/Math.h"
15#include "a3d/mesh/Line.h"
16#include "a3d/render/backend/opengl/GLTypes.h"
17
18namespace a3d {
19
20 class OGLMemoryTracker;
21
22 struct OGLDebugLines {
23
24 // [Internal Types]
25
26 struct Vertex {
27 math::vec3 pos;
28 math::vec3 color;
29 };
30
31 // [Internal Lifecycle Functions]
32
33 explicit OGLDebugLines(OGLMemoryTracker& memoryTracker);
34
35 // [Internal Member Functions]
36
37 void ensureBuffers();
38 void upload(const std::vector<Line>& lines);
39 void destroy();
40
41 // [Internal Member Variables]
42
43 OGLMemoryTracker& memoryTracker;
44 gl::uint_t vbo = 0;
45 gl::uint_t vao = 0;
46 gl::sizei_t vertexCount = 0;
47 std::vector<Vertex> cpuVerts = {};
48 };
49
50}
51
52#endif // AVARA3D_RENDER_BACKEND_OPENGL_OGLDEBUGLINES_H