/[libvob]/libvob/include/vob/vobs/Pixel.hxx
ViewVC logotype

Diff of /libvob/include/vob/vobs/Pixel.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by tjl, Tue Mar 11 11:24:28 2003 UTC revision 1.2 by tjl, Tue Mar 11 12:10:31 2003 UTC
# Line 32  Pixel.hxx Line 32  Pixel.hxx
32  #include <vob/Types.hxx>  #include <vob/Types.hxx>
33    
34  #include <vob/Vec23.hxx>  #include <vob/Vec23.hxx>
35    #include <vob/glerr.hxx>
36    
37    
38  #ifndef VOB_DEFINED  #ifndef VOB_DEFINED
# Line 45  namespace Vobs { Line 46  namespace Vobs {
46  struct DrawPixels {  struct DrawPixels {
47      enum { NTrans = 1 };      enum { NTrans = 1 };
48    
49        int w, h;
50        Token format;
51        Token type;
52        GLubyte *bytes;
53    
54      template<class F> void params(F &f) {      template<class F> void params(F &f) {
55            f(w, h, format, type, bytes);
56        }
57    
58        template<class T> void render(const T &t) const {
59            glPushAttrib(GL_PIXEL_MODE_BIT);
60            glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
61            glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
62            glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
63            ZPt p = t.transform(ZPt(0,0,0));
64            glRasterPos3f(p.x, p.y, p.z);
65            glDrawPixels(w, h, format, type, bytes);
66            GLERR
67            glPopClientAttrib();
68            glPopAttrib();
69      }      }
70  };  };
71    VOB_DEFINED(DrawPixels);
72    
73  }  }
74  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26