altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
isosphere.h
Go to the documentation of this file.
1 #include "include.h"
2 
3 #ifndef ISOSPHERE_H
4 #define ISOSPHERE_H
5 
6 // Icosphere? IsoSphere? oh wells
7 class IsoSphere
8 {
9 public:
10  IsoSphere();
11  int load(Graphics &gfx, char *texture_str, char *heightmap, int depth, float scale);
12  void drawTriangle(const vec3 &v1, const vec3 &v2, const vec3 &v3, float scale, unsigned char *image, int width, int height);
13  void subdivide(const vec3 &v1, const vec3 &v2, const vec3 &v3, int depth, float scale, unsigned char *image, int width, int height);
14  void generate(int depth, float scale, unsigned char *image, int width, int height);
15  void render(Graphics &gfx);
16  void destroy(Graphics &gfx);
17 
18 private:
19  bool loaded;
21  unsigned int *index_array;
22 
23  unsigned int num_vert;
24  unsigned int num_index;
25 
26  int iso_tex;
27  int ibo;
28  int vbo;
29 };
30 
31 #endif