libgoatvr

view src/mesh.h @ 8:3d9ec6fe97d7

- added distortion mesh generation for the OpenHMD module (unfinished) - changed internal implementation function naming to use the vrimp_ prefix - added an opengl helper function to load extension entry points
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 13:22:53 +0300
parents
children
line source
1 #ifndef MESH_H_
2 #define MESH_H_
4 struct vertex {
5 float x, y, z;
6 float tx, ty;
7 };
9 struct mesh {
10 int prim;
11 struct vertex *varr;
12 unsigned int *iarr;
13 int num_verts, num_faces;
14 unsigned int vbo, ibo;
15 };
17 int vrimp_mesh_init(struct mesh *m);
18 void vrimp_mesh_destroy(struct mesh *m);
20 void vrimp_mesh_draw(struct mesh *m);
22 int vrimp_mesh_barrel_distortion(struct mesh *m, int usub, int vsub, float aspect,
23 float lens_center_offset, float scale, const float *dist_factors,
24 float tex_scale_x, float tex_scale_y);
27 #endif /* MESH_H_ */