aboutsummaryrefslogtreecommitdiff
path: root/src/scene33.c
diff options
context:
space:
mode:
authorpk33 <pk33@pk33.space>2024-11-14 15:06:07 +0100
committerpk33 <pk33@pk33.space>2024-11-14 15:06:07 +0100
commited2a4bc4400c38ecd11baccac5db328b797b5d68 (patch)
treeb703749d0639f933edca4c3a78209159aa735c25 /src/scene33.c
parent5a54774474f43ae29716751d6415563a59b92c7d (diff)
downloadengine33-ed2a4bc4400c38ecd11baccac5db328b797b5d68.tar.gz
begin 3D rendering, basic camera controlsHEADmaster
Diffstat (limited to 'src/scene33.c')
-rw-r--r--src/scene33.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/scene33.c b/src/scene33.c
new file mode 100644
index 0000000..00bd177
--- /dev/null
+++ b/src/scene33.c
@@ -0,0 +1,45 @@
+#include "logger33.h"
+#include "scene33.h"
+#include "strings33.h"
+
+
+Scene33 __scene = {0,};
+
+
+Error scene33_init( void )
+{
+ Size i;
+
+ Vec4 verts[ GFX33_QUAD_VERTEX_COUNT ] = GFX33_QUAD_VERTICES;
+ ModelEdge33 medge[ GFX33_QUAD_EDGE_COUNT ] = GFX33_QUAD_MEDGES;
+ Size sedge[ GFX33_QUAD_SEDGE_COUNT ] = GFX33_QUAD_SEDGES;
+
+ __scene.cube.vertices = malloc( sizeof(Vec4) * GFX33_QUAD_VERTEX_COUNT );
+ __scene.cube.medges = malloc( sizeof(ModelEdge33) * GFX33_QUAD_EDGE_COUNT );
+ __scene.cube.sedges = malloc( sizeof(Size) * GFX33_QUAD_SEDGE_COUNT );
+
+ memcpy( __scene.cube.vertices, verts, sizeof(Vec4) * GFX33_QUAD_VERTEX_COUNT );
+ memcpy( __scene.cube.medges, medge, sizeof(ModelEdge33) * GFX33_QUAD_EDGE_COUNT );
+ memcpy( __scene.cube.sedges, sedge, sizeof(Size) * GFX33_QUAD_SEDGE_COUNT );
+
+ __scene.cube.vertexCount = GFX33_QUAD_VERTEX_COUNT;
+ __scene.cube.edgeCount = GFX33_QUAD_EDGE_COUNT;
+ __scene.cube.surfaceCount = GFX33_QUAD_SFACE_COUNT;
+
+ __scene.cube.t[2] = 10.0;
+ __scene.cube.s[0] = 1.0;
+ __scene.cube.s[1] = 1.0;
+ __scene.cube.s[2] = 1.0;
+
+ return E33_EXIT_SUCCESS;
+}
+
+
+Error scene33_term( void )
+{
+ free( __scene.cube.vertices );
+ free( __scene.cube.medges );
+ free( __scene.cube.sedges );
+
+ return E33_EXIT_SUCCESS;
+}