summaryrefslogtreecommitdiff
path: root/themes/src/Renderer2d.h
diff options
context:
space:
mode:
authorMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 09:34:00 -0500
committerMatt Kosarek <matt.kosarek@canonical.com>2025-12-29 09:34:00 -0500
commitbf4b3a5c35152c1292757134123b3363d0f81bf6 (patch)
tree7796e03d309c43115596f78d553a74f911f82218 /themes/src/Renderer2d.h
parent25c93a0ab9c855f75ee48df635fb5422c8eaba95 (diff)
Renamed PascalCase files to snake_case
Diffstat (limited to 'themes/src/Renderer2d.h')
-rw-r--r--themes/src/Renderer2d.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/themes/src/Renderer2d.h b/themes/src/Renderer2d.h
deleted file mode 100644
index 7432894..0000000
--- a/themes/src/Renderer2d.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#pragma once
-
-#include "WebglContext.h"
-#include "types.h"
-#include "Shader.h"
-#include "mathlib.h"
-
-struct WebglContext;
-
-/// Responsible for rendering Mesh2Ds
-struct Renderer2d {
- WebglContext* context = NULL;
- Mat4x4 projection;
- u32 shader;
- Vector4 clearColor;
-
- struct {
- i32 position;
- i32 color;
-
- // TODO: vMatrix is not standard and does not belong here
- i32 vMatrix;
- } attributes;
-
- struct {
- i32 projection;
- i32 model;
- } uniforms;
-
- /// Load with the provided context and shader programs. If the shaders are NULL, the default
- /// shader is used
- void load(WebglContext* context, const char* vertexShader = NULL, const char* fragmentShader = NULL);
- void render();
- void unload();
- f32 get_width();
- f32 get_height();
-};
-
-struct Vertex2D {
- Vector2 position;
- Vector4 color;
- Mat4x4 vMatrix;
-};
-
-struct Mesh2D {
- u32 vao;
- u32 vbo;
- u32 ebo = 0;
- u32 numVertices = 0;
- u32 numIndices = 0;
- Mat4x4 model;
-
- void load(Vertex2D* vertices, u32 numVertices, Renderer2d* renderer);
- void load(Vertex2D* vertices,
- u32 numVertices,
- u32* indices,
- u32 numIndices,
- Renderer2d* renderer);
- void render(Renderer2d* renderer, GLenum drawType = GL_TRIANGLES);
- void unload();
-};