diff options
author | Matthew Kosarek <mattkae@protonmail.com> | 2021-05-16 19:50:15 -0400 |
---|---|---|
committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-05-16 19:50:15 -0400 |
commit | a00c0aab1eb5a7a55bef8ca08115bdd722ab5699 (patch) | |
tree | 45b5c4cc8c380d0630a8e0185af7229f26dc754a /shared_cpp/OrthographicRenderer.h | |
parent | 4941a1874b6ca9d142d94df70b2aec5e0b35b94e (diff) |
Moved the frontend directory up so that it no longer exists
Diffstat (limited to 'shared_cpp/OrthographicRenderer.h')
-rw-r--r-- | shared_cpp/OrthographicRenderer.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/shared_cpp/OrthographicRenderer.h b/shared_cpp/OrthographicRenderer.h new file mode 100644 index 0000000..cef5305 --- /dev/null +++ b/shared_cpp/OrthographicRenderer.h @@ -0,0 +1,43 @@ +#pragma once + +#include "WebglContext.h" +#include "types.h" +#include "Shader.h" +#include "mathlib.h" + +struct WebglContext; + +struct OrthographicRenderer { + Mat4x4 projection; + uint32 shader; + + struct { + int32 position; + int32 color; + } attributes; + + struct { + int32 projection; + int32 model; + } uniforms; + + void load(WebglContext* context); + void render(); + void unload(); +}; + +struct OrthographicVertex { + Vector2 position; + Vector4 color; +}; + +struct OrthographicShape { + uint32 vao; + uint32 vbo; + uint32 numVertices = 0; + Mat4x4 model; + + void load(OrthographicVertex* vertices, uint32 numVertices, OrthographicRenderer* renderer); + void render(OrthographicRenderer* renderer, GLenum drawType = GL_TRIANGLES); + void unload(); +};
\ No newline at end of file |