void GFX::init()
{
- dList = memalign(16, 640);
+ dList = memalign(16, 2048);
fbp0 = 0;
// Init GU
sceGuFrontFace( GU_CW );
sceGuEnable( GU_CULL_FACE );
sceGuEnable( GU_CLIP_PLANES );
+
+ // set clear color/depth
+ sceGuClearColor( GU_COLOR( 0.0f, 0.0f, 0.0f, 1.0f ) );
+ sceGuClearDepth(0);
+
sceGuFinish();
sceGuSync(0,0);
pspDebugScreenPrintf( fps_display );
}
+
+void GFX::perspective(float fov, float aspect, float znear, float zfar)
+{
+ // setup projection matrix
+ sceGumMatrixMode(GU_PROJECTION);
+ sceGumLoadIdentity();
+ sceGumPerspective(fov, aspect, znear, zfar);
+}
+
+void GFX::look_at(ScePspFVector3 *eye, ScePspFVector3 *center, ScePspFVector3 *up)
+{
+ sceGumMatrixMode(GU_VIEW);
+ sceGumLoadIdentity();
+ sceGumLookAt(eye, center, up);
+}
+
+
void init();
void cleanup();
void update_fps();
+
+ void setup_perspective(float fov, float aspect, float znear, float zfar);
+ void look_at(ScePspFVector3 *eye, ScePspFVector3 *center, ScePspFVector3 *up);
};
#endif