projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
- added mesh operations: apply_mesh_xform, append_mesh, indexify_mesh (untested)...
[dosdemo]
/
src
/
infcubes.c
diff --git
a/src/infcubes.c
b/src/infcubes.c
index
cfa665b
..
3df25fe
100644
(file)
--- a/
src/infcubes.c
+++ b/
src/infcubes.c
@@
-8,6
+8,7
@@
#include "polyfill.h"
#include "imago2.h"
#include "gfxutil.h"
#include "polyfill.h"
#include "imago2.h"
#include "gfxutil.h"
+#include "mesh.h"
static int init(void);
static void destroy(void);
static int init(void);
static void destroy(void);
@@
-26,6
+27,7
@@
static struct screen scr = {
static float cam_theta = -29, cam_phi = 35;
static float cam_dist = 5;
static struct pimage tex_crate;
static float cam_theta = -29, cam_phi = 35;
static float cam_dist = 5;
static struct pimage tex_crate;
+static struct g3d_mesh mesh_cube;
struct screen *infcubes_screen(void)
{
struct screen *infcubes_screen(void)
{
@@
-54,6
+56,10
@@
static int init(void)
int b = *src++;
*dst++ = PACK_RGB16(r, g, b);
}
int b = *src++;
*dst++ = PACK_RGB16(r, g, b);
}
+
+ if(gen_cube_mesh(&mesh_cube, 1.0f, 3) == -1) {
+ return -1;
+ }
return 0;
}
return 0;
}
@@
-99,7
+105,8
@@
static void draw(void)
draw_cube(-6);
g3d_polygon_mode(G3D_TEX);
draw_cube(-6);
g3d_polygon_mode(G3D_TEX);
- draw_cube(1);
+ /*draw_cube(1);*/
+ draw_mesh(&mesh_cube);
swap_buffers(fb_pixels);
}
swap_buffers(fb_pixels);
}