Fixed normal calculation at edges, more UI changes
[ted.git] / src / terrain.h
blob997800517c6fce9f26425ae01bae8c231e5c6eb4
1 #ifndef TERRAIN_H_
2 #define TERRAIN_H_
4 #include <GL/gl.h>
5 #include "types.h"
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 enum TERRAIN_MODE { FLAT, NORMAL, NORMAL_DEBUG };
13 struct terrain
15 int size;
16 float max_height, min_height;
18 GLfloat *height;
19 struct point *normal;
21 int dirty;
22 unsigned int seed;
24 enum TERRAIN_MODE drawmode;
25 GLuint drawlist;
28 struct index
30 int i,j;
33 struct terrain* terrain_create(int size);
35 void terrain_destroy(struct terrain* t);
37 void terrain_bake(struct terrain *t);
39 void terrain_draw(struct terrain *t);
41 void terrain_smooth(struct terrain *t, float k);
43 void terrain_clear(struct terrain *t);
45 void terrain_fractal(struct terrain *t, float magnitude);
47 void terrain_plasma(struct terrain *t);
49 #ifdef __cplusplus
51 #endif
53 #endif