aboutsummaryrefslogtreecommitdiff
path: root/src/scene33.c
blob: 00bd1776faae95d59519620dcb8e9b1abbff7050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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;
}