-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgraphic.h
executable file
·47 lines (36 loc) · 1.17 KB
/
graphic.h
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
#ifndef _GRAPHIC_H_
#define _GRAPHIC_H_
// The screen size
#define SCREEN_HT 240
#define SCREEN_WD 320
#define MAX_GRAPHICS_TASKS 2
#define MAX_OBJECTS 2000
// The maximum length of the display list of one task
#define MAX_DISPLAY_LIST_COMMANDS MAX_OBJECTS * 20
// determines the number of matrices we allocate, because we need one for every
// object we want to position in the world, for each graphics task
#define FOVY 45
#define ASPECT (f32) SCREEN_WD / (f32)SCREEN_HT
#define NEAR_PLANE 10
#define FAR_PLANE 1000
// a 3d position, such as that of an object
typedef struct Vec3d {
float x;
float y;
float z;
} Vec3d;
// a struct to hold graphics data used by the RCP which can change at runtime
typedef struct GraphicsTask {
Mtx projection;
Mtx modelview;
Mtx objectTransforms[MAX_OBJECTS];
Gfx displayList[MAX_DISPLAY_LIST_COMMANDS];
} GraphicsTask;
extern struct GraphicsTask graphicsTasks[MAX_GRAPHICS_TASKS];
extern Gfx* displayListPtr;
extern GraphicsTask* gfxSwitchTask();
extern void gfxRCPInit();
extern void gfxClearCfb(int);
extern Gfx setup_rdpstate[];
extern Gfx setup_rspstate[];
#endif /* _GRAPHIC_H_ */