proj home

Files   Classes   Functions   Hierarchy  

OpenGLtemplated.h

Go to the documentation of this file.
00001 #ifndef OPENGLTEMPLATED
00002 #define OPENGLTEMPLATED
00003 
00012 #include <GL/gl.h>
00013 
00014 #include <cassert>
00015 
00016 
00019 #define CLASSFUNC2xy(cnm,typ,fnname) \
00020 template<> \
00021 class cnm<typ> \
00022 { \
00023 public: \
00024   void operator ()  \
00025   ( \
00026     typ const x,  \
00027     typ const y  \
00028   ) const           \
00029     { fnname(x,y); } \
00030   template< typename U> \
00031   void operator () (U const & pt) \
00032     { fnname(pt.x,pt.y); } \
00033 }
00034 
00037 #define CLASSFUNC3xyz(cnm,typ,fnname) \
00038 template<> \
00039 class cnm<typ> \
00040 { \
00041 public: \
00042   void operator ()  \
00043   ( \
00044     typ const x,  \
00045     typ const y,  \
00046     typ const z   \
00047   ) const           \
00048     { fnname(x,y,z); } \
00049   template< typename U> \
00050   void operator () (U const & pt) \
00051     { fnname(pt.x,pt.y,pt.z); } \
00052 }
00053 
00056 #define CLASSFUNC4xyzw(cnm,typ,fnname) \
00057 template<> \
00058 class cnm<typ> \
00059 { \
00060 public: \
00061   void operator ()  \
00062   ( \
00063     typ const x,  \
00064     typ const y,  \
00065     typ const z,  \
00066     typ const w   \
00067   ) const           \
00068     { fnname(x,y,z,w); } \
00069 }
00070 
00073 #define CLASSFUNC1v(cnm,typ,fnname) \
00074 template<> \
00075 class cnm<typ> \
00076 { \
00077 public: \
00078   void operator() (typ const *v ) const \
00079     { fnname(v); } \
00080 }
00081 
00082 
00083 
00084 
00085 
00086 
00091 template< typename T >
00092 class glTranslateT
00093 {
00094 public:
00095  
00097   void operator () (T const x, T const y) const
00098     { assert(false); }
00099 };
00100 
00105 template< typename T >
00106 class glVertex2T
00107 {
00108 public:
00109  
00111   void operator () (T const x, T const y) const
00112     { assert(false); }
00113 };
00114 
00119 template< typename T >
00120 class glVertex3T
00121 {
00122 public:
00123   
00125   void operator () (T const x, T const y, T const z) const
00126     { assert(false); }
00127 };
00128 
00133 template< typename T >
00134 class glVertex4T
00135 {
00136 public:
00137   
00139   void operator () 
00140   (
00141     T const x, 
00142     T const y, 
00143     T const z, 
00144     T const w
00145   ) const
00146     { assert(false); }
00147 };
00148 
00153 template< typename T >
00154 class glVertex2Tv
00155 {
00156 public:
00157   
00159   void operator () ( T const *v ) const 
00160     { assert(false); }
00161 };
00162 
00167 template< typename T >
00168 class glVertex3Tv
00169 {
00170 public:
00171   
00173   void operator () ( T const *v ) const 
00174     { assert(false); }
00175 };
00176 
00181 template< typename T >
00182 class glVertex4Tv
00183 {
00184 public:
00185   
00187   void operator () ( T const *v ) const 
00188     { assert(false); }
00189 };
00190 
00195 template< typename T >
00196 class glNormal3T
00197 {
00198 public:
00199   
00201   void operator () (T const x, T const y, T const z) const
00202     { assert(false); }
00203 };
00204 
00209 template< typename T >
00210 class glNormal3Tv
00211 {
00212 public:
00213   
00215   void operator () ( T const *v ) const 
00216     { assert(false); }
00217 };
00218 
00223 template< typename T >
00224 class glColor3T
00225 {
00226 public:
00227   
00229   void operator () 
00230   (
00231     T const x, 
00232     T const y, 
00233     T const z 
00234   ) const
00235     { assert(false); }
00236 };
00237 
00242 template< typename T >
00243 class glColor3Tv
00244 {
00245 public:
00246   
00248   void operator () ( T const *v ) const 
00249     { assert(false); }
00250 };
00251 
00256 template< typename T >
00257 class glColor4T
00258 {
00259 public:
00260   
00262   void operator () 
00263   (
00264     T const x, 
00265     T const y, 
00266     T const z, 
00267     T const w
00268   ) const
00269     { assert(false); }
00270 };
00271 
00276 template< typename T >
00277 class glColor4Tv
00278 {
00279 public:
00280   
00282   void operator () ( T const *v ) const 
00283     { assert(false); }
00284 };
00285 
00286 
00287 
00288 
00289 
00290 
00291 //******************************************************
00292 //  Implementation
00293 
00294 
00295 CLASSFUNC3xyz(glTranslateT,GLdouble,glTranslated);
00296 CLASSFUNC3xyz(glTranslateT,GLfloat,glTranslatef);
00297 
00298 CLASSFUNC2xy(glVertex2T,GLdouble,glVertex2d);
00299 CLASSFUNC2xy(glVertex2T,GLfloat,glVertex2f);
00300 CLASSFUNC2xy(glVertex2T,GLint,glVertex2i);
00301 CLASSFUNC2xy(glVertex2T,GLshort,glVertex2s);
00302 
00303 CLASSFUNC3xyz(glVertex3T,GLdouble,glVertex3d);
00304 CLASSFUNC3xyz(glVertex3T,GLfloat,glVertex3f);
00305 CLASSFUNC3xyz(glVertex3T,GLint,glVertex3i);
00306 CLASSFUNC3xyz(glVertex3T,GLshort,glVertex3s);
00307 
00308 CLASSFUNC4xyzw(glVertex4T,GLdouble,glVertex4d);
00309 CLASSFUNC4xyzw(glVertex4T,GLfloat,glVertex4f);
00310 CLASSFUNC4xyzw(glVertex4T,GLint,glVertex4i);
00311 CLASSFUNC4xyzw(glVertex4T,GLshort,glVertex4s);
00312 
00313 CLASSFUNC1v(glVertex2Tv,GLdouble,glVertex2dv);
00314 CLASSFUNC1v(glVertex2Tv,GLfloat,glVertex2fv);
00315 CLASSFUNC1v(glVertex2Tv,GLint,glVertex2iv);
00316 CLASSFUNC1v(glVertex2Tv,GLshort,glVertex2sv);
00317 
00318 CLASSFUNC1v(glVertex3Tv,GLdouble,glVertex3dv);
00319 CLASSFUNC1v(glVertex3Tv,GLfloat,glVertex3fv);
00320 CLASSFUNC1v(glVertex3Tv,GLint,glVertex3iv);
00321 CLASSFUNC1v(glVertex3Tv,GLshort,glVertex3sv);
00322 
00323 CLASSFUNC1v(glVertex4Tv,GLdouble,glVertex4dv);
00324 CLASSFUNC1v(glVertex4Tv,GLfloat,glVertex4fv);
00325 CLASSFUNC1v(glVertex4Tv,GLint,glVertex4iv);
00326 CLASSFUNC1v(glVertex4Tv,GLshort,glVertex4sv);
00327 
00328 CLASSFUNC3xyz(glNormal3T,GLbyte,glNormal3b);
00329 CLASSFUNC3xyz(glNormal3T,GLdouble,glNormal3d);
00330 CLASSFUNC3xyz(glNormal3T,GLfloat,glNormal3f);
00331 CLASSFUNC3xyz(glNormal3T,GLint,glNormal3i);
00332 CLASSFUNC3xyz(glNormal3T,GLshort,glNormal3s);
00333 
00334 CLASSFUNC1v(glNormal3Tv,GLbyte,glNormal3bv);
00335 CLASSFUNC1v(glNormal3Tv,GLdouble,glNormal3dv);
00336 CLASSFUNC1v(glNormal3Tv,GLfloat,glNormal3fv);
00337 CLASSFUNC1v(glNormal3Tv,GLint,glNormal3iv);
00338 CLASSFUNC1v(glNormal3Tv,GLshort,glNormal3sv);
00339 
00340 CLASSFUNC3xyz(glColor3T,GLbyte,glColor3b);
00341 CLASSFUNC3xyz(glColor3T,GLdouble,glColor3d);
00342 CLASSFUNC3xyz(glColor3T,GLfloat,glColor3f);
00343 CLASSFUNC3xyz(glColor3T,GLint,glColor3i);
00344 CLASSFUNC3xyz(glColor3T,GLshort,glColor3s);
00345 CLASSFUNC3xyz(glColor3T,GLubyte,glColor3ub);
00346 CLASSFUNC3xyz(glColor3T,GLuint,glColor3ui);
00347 CLASSFUNC3xyz(glColor3T,GLushort,glColor3us);
00348 
00349 CLASSFUNC1v(glColor3Tv,GLbyte,glColor3bv);
00350 CLASSFUNC1v(glColor3Tv,GLdouble,glColor3dv);
00351 CLASSFUNC1v(glColor3Tv,GLfloat,glColor3fv);
00352 CLASSFUNC1v(glColor3Tv,GLint,glColor3iv);
00353 CLASSFUNC1v(glColor3Tv,GLshort,glColor3sv);
00354 CLASSFUNC1v(glColor3Tv,GLubyte,glColor3ubv);
00355 CLASSFUNC1v(glColor3Tv,GLuint,glColor3uiv);
00356 CLASSFUNC1v(glColor3Tv,GLushort,glColor3usv);
00357 
00358 CLASSFUNC4xyzw(glColor4T,GLbyte,glColor4b);
00359 CLASSFUNC4xyzw(glColor4T,GLdouble,glColor4d);
00360 CLASSFUNC4xyzw(glColor4T,GLfloat,glColor4f);
00361 CLASSFUNC4xyzw(glColor4T,GLint,glColor4i);
00362 CLASSFUNC4xyzw(glColor4T,GLshort,glColor4s);
00363 CLASSFUNC4xyzw(glColor4T,GLubyte,glColor4ub);
00364 CLASSFUNC4xyzw(glColor4T,GLuint,glColor4ui);
00365 CLASSFUNC4xyzw(glColor4T,GLushort,glColor4us);
00366 
00367 CLASSFUNC1v(glColor4Tv,GLbyte,glColor4bv);
00368 CLASSFUNC1v(glColor4Tv,GLdouble,glColor4dv);
00369 CLASSFUNC1v(glColor4Tv,GLfloat,glColor4fv);
00370 CLASSFUNC1v(glColor4Tv,GLint,glColor4iv);
00371 CLASSFUNC1v(glColor4Tv,GLshort,glColor4sv);
00372 CLASSFUNC1v(glColor4Tv,GLubyte,glColor4ubv);
00373 CLASSFUNC1v(glColor4Tv,GLuint,glColor4uiv);
00374 CLASSFUNC1v(glColor4Tv,GLushort,glColor4usv);
00375 
00376 
00377 #undef CLASSFUNC1v
00378 #undef CLASSFUNC2xy
00379 #undef CLASSFUNC3xyz
00380 #undef CLASSFUNC4xyzw
00381 
00382 #endif
00383 
00384 

Generated on Fri Mar 4 00:49:27 2011 for Chelton Evans Source by  doxygen 1.5.8