radius(radius)
{}
+ void set_velocity(ScePspFVector3 v) { velocity = v; }
+ void set_position(ScePspFVector3 p) { position = p; }
void draw() const;
void update_position(float dt);
bool collides(const Entity& other);
#include <psptypes.h>
#include <pspdisplay.h>
#include <pspkernel.h>
-
+#include <pspctrl.h>
+#include <stdio.h>
float triangle[]={1,-1,0,-1,-1,0,0,1,0};
int game_main(int argc, char **argv)
{
+ SceCtrlData pad;
GFX.init();
Model ship_model("data/shipdawhip.lob");
ScePspFVector3 camera_up = {0, 1, 0};
GFX.look_at(&camera_pos, &camera_center, &camera_up);
- sceGumMatrixMode(GU_MODEL);
- int i=0;
+ sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
while(1)
{
GFX.begin_frame();
- i++;
- ship.draw();
-
+ sceCtrlPeekBufferPositive(&pad, 1);
+ ship.draw();
+
+ char buf[200];
+ sprintf(buf, "timestamp=%d, LX=%d, LY=%d", pad.TimeStamp, int(pad.Lx), int(pad.Ly));
+ GFX.set_status_string(buf);
GFX.end_frame();
}
if( ((fps_tick_now - fps_tick_last)/((float)tick_resolution)) >= 1.0f )
{
fps_tick_last = fps_tick_now;
- //sprintf( fps_display, "ticks=%f, FPS: %d", ((double)fps_tick_now/(double)tick_resolution), frames_drawn );
- sprintf(fps_display, "FPS: %d", frames_drawn);
+ sprintf(fps_display, "FPS: %d -- %s", frames_drawn, status_string);
+ //sprintf(fps_display, "FPS: %d", frames_drawn);
frames_drawn = 0;
}
pspDebugScreenSetOffset((int)fbp0);
class Gfx: public Singleton<Gfx>
{
void *fbp0; //< frame buffer
-
int frames_drawn;
char fps_display[200];
u32 tick_resolution;
u64 fps_tick_now, fps_tick_last;
+ const char *status_string;
public:
void *display_list;
static const int SCR_WIDTH=480;
void begin_frame();
void end_frame();
+ void set_status_string(const char *str) { status_string = str; }
// Camera controls;
void perspective(float fov, float aspect, float znear, float zfar);