libgoatvr
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/mesh.h Sat Sep 20 13:22:53 2014 +0300 1.3 @@ -0,0 +1,27 @@ 1.4 +#ifndef MESH_H_ 1.5 +#define MESH_H_ 1.6 + 1.7 +struct vertex { 1.8 + float x, y, z; 1.9 + float tx, ty; 1.10 +}; 1.11 + 1.12 +struct mesh { 1.13 + int prim; 1.14 + struct vertex *varr; 1.15 + unsigned int *iarr; 1.16 + int num_verts, num_faces; 1.17 + unsigned int vbo, ibo; 1.18 +}; 1.19 + 1.20 +int vrimp_mesh_init(struct mesh *m); 1.21 +void vrimp_mesh_destroy(struct mesh *m); 1.22 + 1.23 +void vrimp_mesh_draw(struct mesh *m); 1.24 + 1.25 +int vrimp_mesh_barrel_distortion(struct mesh *m, int usub, int vsub, float aspect, 1.26 + float lens_center_offset, float scale, const float *dist_factors, 1.27 + float tex_scale_x, float tex_scale_y); 1.28 + 1.29 + 1.30 +#endif /* MESH_H_ */