}
convimg_rgb24_rgb16(tex_outer.pixels, (unsigned char*)tex_outer.pixels, tex_outer.width, tex_outer.height);
+ /*
if(gen_cube_mesh(&mesh_cube, 1.0f, 3) == -1) {
return -1;
}
+ */
+ if(load_mesh(&mesh_cube, "data/bevelbox.obj") == -1) {
+ return -1;
+ }
return 0;
}
swap_buffers(fb_pixels);
}
-
-static void draw_cube(float sz)
-{
- float hsz = sz * 0.5f;
- g3d_begin(G3D_QUADS);
- g3d_color3b(255, 0, 0);
- g3d_normal(0, 0, 1);
- g3d_texcoord(0, 0); g3d_vertex(-hsz, -hsz, hsz);
- g3d_texcoord(1, 0); g3d_vertex(hsz, -hsz, hsz);
- g3d_texcoord(1, 1); g3d_vertex(hsz, hsz, hsz);
- g3d_texcoord(0, 1); g3d_vertex(-hsz, hsz, hsz);
- g3d_color3b(0, 255, 0);
- g3d_normal(1, 0, 0);
- g3d_texcoord(0, 0); g3d_vertex(hsz, -hsz, hsz);
- g3d_texcoord(1, 0); g3d_vertex(hsz, -hsz, -hsz);
- g3d_texcoord(1, 1); g3d_vertex(hsz, hsz, -hsz);
- g3d_texcoord(0, 1); g3d_vertex(hsz, hsz, hsz);
- g3d_color3b(0, 0, 255);
- g3d_normal(0, 0, -1);
- g3d_texcoord(0, 0); g3d_vertex(hsz, -hsz, -hsz);
- g3d_texcoord(1, 0); g3d_vertex(-hsz, -hsz, -hsz);
- g3d_texcoord(1, 1); g3d_vertex(-hsz, hsz, -hsz);
- g3d_texcoord(0, 1); g3d_vertex(hsz, hsz, -hsz);
- g3d_color3b(255, 0, 255);
- g3d_normal(-1, 0, 0);
- g3d_texcoord(0, 0); g3d_vertex(-hsz, -hsz, -hsz);
- g3d_texcoord(1, 0); g3d_vertex(-hsz, -hsz, hsz);
- g3d_texcoord(1, 1); g3d_vertex(-hsz, hsz, hsz);
- g3d_texcoord(0, 1); g3d_vertex(-hsz, hsz, -hsz);
- g3d_color3b(255, 255, 0);
- g3d_normal(0, 1, 0);
- g3d_texcoord(0, 0); g3d_vertex(-hsz, hsz, hsz);
- g3d_texcoord(1, 0); g3d_vertex(hsz, hsz, hsz);
- g3d_texcoord(1, 1); g3d_vertex(hsz, hsz, -hsz);
- g3d_texcoord(0, 1); g3d_vertex(-hsz, hsz, -hsz);
- g3d_color3b(0, 255, 255);
- g3d_normal(0, -1, 0);
- g3d_texcoord(0, 0); g3d_vertex(hsz, -hsz, hsz);
- g3d_texcoord(1, 0); g3d_vertex(-hsz, -hsz, hsz);
- g3d_texcoord(1, 1); g3d_vertex(-hsz, -hsz, -hsz);
- g3d_texcoord(0, 1); g3d_vertex(hsz, -hsz, -hsz);
- g3d_end();
-}