-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.h
64 lines (44 loc) · 1.96 KB
/
app.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* app.h - class declaration of PSX_App */
#include <stdlib.h>
#include <libgte.h>
#include <libgpu.h>
#include <libgs.h>
#include <libetc.h>
#ifndef APP_H_INCLUDED
#define APP_H_INCLUDED
const int OT_LENGTH = 10; // the length of the order table
const int PACKETMAX = 1000; // number of total packets possible
const int PACKET_SIZE = 64;
class PSX_App
{
public:
PSX_App(); // constructor
void init(const u_int w, const u_int h); // initialize the system
void setBgColor(u_char r, u_char g, u_char b); // set bg clear color
void drawPixel(const int x, const int y,
const int r, const int g, const int b);
void drawLine(const int x0, const int y0,
const int x1, const int y1,
const int r, const int g, const int b);
void drawRect(const int topLeftX, const int topLeftY,
const int bottomRightX, const int bottomRightY,
const int r, const int g, const int b);
void drawTriangle(const int bottomLeftX, const int bottomLeftY,
const int middleX, const int middleY,
const int bottomRightX, const int bottomRightY,
const int r, const int g, const int b);
//void draw(); // where you actually draw stuff to the screen
void drawFrame(void); // process a frame
private:
GsOT myOT[2]; // order table - 2 for double buffer
GsOT_TAG myOT_TAG[2][1<<OT_LENGTH];
PACKET GPUPacketArea[2][PACKETMAX];
u_long __ramsize;// = 0x00200000; // force 2MB of RAM
u_long __stacksize;// = 0x00004000; // force 16KB of stack
short CurrentBuffer; // keep track of the current buffer
u_int screen_width; // screen width and height
u_int screen_height;
u_char bgcolor[3]; // r, g, b for background color
//u_int prio; // used in GsSort functions
};
#endif // APP_H_INCLUDED