summaryrefslogtreecommitdiff
path: root/themes/Renderer3d.h
diff options
context:
space:
mode:
Diffstat (limited to 'themes/Renderer3d.h')
-rw-r--r--themes/Renderer3d.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/themes/Renderer3d.h b/themes/Renderer3d.h
index add41d7..71fc8fe 100644
--- a/themes/Renderer3d.h
+++ b/themes/Renderer3d.h
@@ -5,6 +5,8 @@
#include "types.h"
#include <string>
+struct Renderer3D;
+
struct Vertex3d {
Vector4 position;
Vector4 color;
@@ -17,12 +19,17 @@ struct Mesh3d {
matte::List<Vertex3d> vertices;
matte::List<u32> indices;
Mat4x4 model;
+
+ void load(Renderer3D* renderer);
+ void render(Renderer3D* renderer);
+ void unload();
};
struct WebglContext;
struct Renderer3D {
WebglContext* context = NULL;
Mat4x4 projection;
+ Mat4x4 view;
u32 shader;
Vector4 clearColor;
@@ -33,6 +40,7 @@ struct Renderer3D {
struct {
i32 projection;
+ i32 view;
i32 model;
} uniforms;
@@ -41,6 +49,6 @@ struct Renderer3D {
void unload();
};
-Mesh3d Mesh3d_fromObj(std::string content);
+Mesh3d Mesh3d_fromObj(Renderer3D* renderer, const char* content, const i32 len);
-#endif \ No newline at end of file
+#endif