GEL
2
GEL is a library for Geometry and Linear Algebra
|
00001 #ifndef __GLGRAPHICS_IDBUFFERWIREFRAMERENDERER_H__ 00002 #define __GLGRAPHICS_IDBUFFERWIREFRAMERENDERER_H__ 00003 00004 #include <GL/glew.h> 00005 #include <CGLA/Vec3uc.h> 00006 #include <CGLA/Vec3f.h> 00007 #include <HMesh/Manifold.h> 00008 00009 namespace GLGraphics 00010 { 00012 class IDBufferWireframeRenderer 00013 { 00014 const HMesh::Manifold& mesh; 00015 00016 GLint id_attrib; 00017 GLint popp_attrib; 00018 GLint disp_attrib; 00019 int XSZ, YSZ; 00020 float thickness; 00021 float transition; 00022 00023 GLuint vs,fs; 00024 GLuint line_prog; 00025 GLuint idmap; 00026 00027 GLuint vertex_buffername; 00028 GLuint colors_buffername; 00029 GLuint line_id_attrib; 00030 GLuint line_vertex_pos; 00031 GLuint line_disp_attrib; 00032 GLuint line_opp_attrib; 00033 00034 int triangles, quads; 00035 public: 00036 00037 CGLA::Vec3uc id_get(unsigned int i) 00038 { 00039 i = i+1; 00040 return CGLA::Vec3uc(i&0xff, (i&0xff00)/256, (i&0xff0000)/65536); 00041 } 00042 00043 IDBufferWireframeRenderer(int _XSZ, int _YSZ, 00044 const HMesh::Manifold& mesh, 00045 float _thickness=0.0, 00046 float _transition=1.8, 00047 int atten_mode=0); 00048 00049 ~IDBufferWireframeRenderer(); 00050 00051 void draw(const CGLA::Vec3f& color, 00052 const CGLA::Vec3f& clear_color); 00053 }; 00054 00055 } 00056 #endif