int i=0;
while(1)
{
+ GFX.begin_frame();
i++;
- sceGuStart(GU_DIRECT, GFX.display_list);
- sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
-
sceGumLoadIdentity();
sceGumRotateX(0.001f*i);
sceGumRotateY(0.001f*i);
cube.num_faces*3, cube.indices, cube.vertices);
-
- sceGuFinish();
- sceGuSync(0,0);
-
- GFX.update_fps();
- GFX.swap_buffers();
+ GFX.end_frame();
}
GFX.cleanup();
fbp0=sceGuSwapBuffers();
}
+void Gfx::begin_frame()
+{
+ sceGuStart(GU_DIRECT, GFX.display_list);
+ sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
+}
+
+void Gfx::end_frame()
+{
+ sceGuFinish();
+ sceGuSync(0,0);
+
+ update_fps();
+ swap_buffers();
+}
+
void Gfx::perspective(float fov, float aspect, float znear, float zfar)
{
// setup projection matrix
void update_fps();
void swap_buffers();
+
+ void begin_frame();
+ void end_frame();
// Camera controls;
void perspective(float fov, float aspect, float znear, float zfar);