-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphic.h
53 lines (39 loc) · 1.21 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
48
49
50
#ifndef _GRAPHIC_H_
#define _GRAPHIC_H_
#include <ultra64.h>
// The screen size
#define SCREEN_HT 240
#define SCREEN_WD 320
#define MAX_GRAPHICS_TASKS 10
// The maximum length of the display list of one task
#define MAX_DISPLAY_LIST_COMMANDS 2048
// 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 MAX_OBJECTS 120
#define FOVY 45
#define ASPECT (f32)SCREEN_WD/(f32)SCREEN_HT
#define NEAR_PLANE 10
#define FAR_PLANE 6000
// 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 int transform_tail;
extern Gfx * displayListPtr;
extern GraphicsTask * gfxSwitchTask();
extern void gfxRCPInit();
extern void gfxClearCfb();
extern void gfxSetBackgroundColor();
extern Gfx setup_rdpstate[];
extern Gfx setup_rspstate[];
#endif /* _GRAPHIC_H_ */