aboutsummaryrefslogtreecommitdiff
path: root/include/graphics33.h
blob: af7de8e670d827727c518c7442a43265811c6e78 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __GRAPHICS33_H__
#define __GRAPHICS33_H__


#include "math33.h"


typedef struct Surface33 {
  u32 *data;
  Size w, h;
} Surface33;

typedef struct ModelEdge33 {
  Size vertices[2];
  Size cacheOffset;
} ModelEdge33;

typedef struct Model33 {
  Vec4 *vertices;
  ModelEdge33 *medges;
  Size *sedges;

  Vec3 t;
  Vec3 r;
  Vec3 s;

  Size vertexCount;
  Size edgeCount;
  Size surfaceCount;
} Model33;


Error graphics33_init( void );
Error graphics33_term( void );
void graphics33_update( void );



#define GFX33_QUAD_VERTEX_COUNT 4

#define GFX33_QUAD_VERTICES {\
  { -1.0, -1.0,  0.0, 1.0 },\
  { -1.0,  1.0,  0.0, 1.0 },\
  {  1.0,  1.0,  0.0, 1.0 },\
  {  1.0, -1.0,  0.0, 1.0 }\
}


#define GFX33_QUAD_EDGE_COUNT 5

#define GFX33_QUAD_MEDGES {\
  { {0,1}, 0 },\
  { {1,2}, 0 },\
  { {2,3}, 0 },\
  { {0,3}, 0 },\
  { {1,3}, 0 }\
}

#define GFX33_QUAD_SFACE_COUNT 2
#define GFX33_QUAD_SEDGE_COUNT (GFX33_QUAD_SFACE_COUNT * 3)

#define GFX33_QUAD_SEDGES {\
  0, 4, 3, 1, 2, 4\
}


#endif /** GFX33_H **/