static void destroy(void);
static void start(long trans_time);
static void draw(void);
+static void keypress(int key);
static struct screen scr = {
"rtxonoff",
init,
destroy,
start, 0,
- draw
+ draw,
+ keypress
};
static float cam_theta = -29, cam_phi = 35;
-static float cam_dist = 6;
+static float cam_dist = 10;
static const char *car_fname[2] = {"data/ldiablo.obj", 0};
static const char *cartex_fname[2] = {"data/ldiablo.png", 0};
if(!(tex_car[i].pixels = img_load_pixels(cartex_fname[i],
&tex_car[i].width, &tex_car[i].height, IMG_FMT_RGB24))) {
fprintf(stderr, "failed to load car texture: %s\n", cartex_fname[i]);
+ return -1;
}
convimg_rgb24_rgb16(tex_car[i].pixels, (unsigned char*)tex_car[i].pixels,
tex_car[i].width, tex_car[i].height);
static void destroy(void)
{
+ int i;
+
+ for(i=0; i<2; i++) {
+ free(mesh_car[i].varr);
+ free(mesh_car[i].iarr);
+ }
}
static void start(long trans_time)
static void draw(void)
{
int i;
+ static float vdir[3];
float t = (float)time_msec / 16.0f;
update();
swap_buffers(fb_pixels);
}
+
+static void keypress(int key)
+{
+}