-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
159 lines (106 loc) · 3.38 KB
/
main.cpp
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#include "decal.h"
#include "model64.h"
#include <libdragon.h>
#include <dragonfs.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/gl_integration.h>
#include <malloc.h>
#include <math.h>
#include <malloc.h>
#include "Core/App.hpp"
// Set this to 1 to enable rdpq debug output.
// The demo will only run for a single frame and stop.
//#define DEBUG_RDP 0
// ;
// //static GLuint textures[4];
// static const GLfloat light_pos[8][4] = {
// { 1, 1, 0, 0 },
// { -1, 0, 0, 0 },
// { 0, 0, 1, 0 },
// { 0, 0, -1, 0 },
// { 8, 3, 0, 1 },
// { -8, 3, 0, 1 },
// { 0, 3, 8, 1 },
// { 0, 3, -8, 1 },
// };
// static const char *texture_path[4] = {
// "rom:/circle0.sprite",
// "rom:/diamond0.sprite",
// "rom:/pentagon0.sprite",
// "rom:/triangle0.sprite",
// };
// static sprite_t *sprites[4];
// static rdpq_font_t *fnt1;
// static model64_t *model;
using Quasar::Core::App;
static App *app;
// static Camera *camera;
//GLfloat objectX = 0.0f;
// void setup()
// {
// fnt1 = rdpq_font_load("rom:/Pacifico.font64");
// model = model64_load("rom:/fractal-pyramid.model64");
// for (uint32_t i = 0; i < 4; i++)
// {
// sprites[i] = sprite_load(texture_path[i]);
// }
// }
// void set_light_positions(float rotation)
// {
// glPushMatrix();
// glRotatef(rotation*5.43f, 1, 0, 1);
// for (int i = 0; i < 7; i++)
// {
// glLightfv(GL_LIGHT0 + i, GL_POSITION, light_pos[i]);
// }
// glPopMatrix();
// }
// void render()
// {
// // camera->transform(&camera);
// set_light_positions(0.0f);
// glEnable(GL_BLEND);
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// glPushMatrix();
// glDisable(GL_BLEND);
// gl_context_end();
// glFlush();
// // rdpq_font_begin(RGBA32(0xED, 0xAE, 0x49, 0xFF));
// // rdpq_font_position(20, 50);
// // rdpq_font_print(fnt1, "");
// // rdpq_font_end();
// rdpq_detach_show();
// }
int main(void)
{
app = new App();
// setup();
while (1)
{
app->Update();
//controller_scan();
// struct controller_data pressed = get_keys_pressed();
// struct controller_data held = get_keys_held();
// get_controllers_present();
// float y = pressed.c[0].y / 128.f;
// float x = pressed.c[0].x / 128.f;
// // Squares of each component of a vector added together = its magnitude.
// float mag = (x*x) + (y*y);
// // Since I'm such a nice guy, I'll let the player set this in the menu. You're welcome, I love you.
// float deadZone = 0.01f;
// float sensitivity = 3.5f;
// // If the magnitude of our stick exceeds the dead zone.
// if (fabsf(mag) > deadZone) {
// camera.rotation[CAMERA_AXIS_X] += -y * sensitivity;
// camera.rotation[CAMERA_AXIS_Y] = camera.rotation[CAMERA_AXIS_Y] - (-x * sensitivity);
// }
// if (held.c->C_up && !held.c->C_down) {
// camera.position[CAMERA_AXIS_Z] -= 0.25f;
// }
// else if (!held.c->C_up && held.c->C_down) {
// camera.position[CAMERA_AXIS_Z] += 0.25f;
// }
//render();
}
}