/[gzz]/gzz/gfx/libmosaic/Mosaic.hxx
ViewVC logotype

Diff of /gzz/gfx/libmosaic/Mosaic.hxx

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

revision 1.9 by benja, Fri Sep 13 11:48:31 2002 UTC revision 1.10 by tjl, Fri Dec 13 12:14:54 2002 UTC
# Line 82  namespace Mosaic { Line 82  namespace Mosaic {
82              if(!id) throw InvalidTexture();              if(!id) throw InvalidTexture();
83              glBindTexture(target, id);              glBindTexture(target, id);
84          }          }
85            void unbind(GLenum target = GL_TEXTURE_2D) {
86                glBindTexture(target, 0);
87            }
88          /** Compare two Ids -- usual semantics.          /** Compare two Ids -- usual semantics.
89           */           */
90          bool operator==(const Id &t) const { return id == t.id; }          bool operator==(const Id &t) const { return id == t.id; }
# Line 257  namespace Mosaic { Line 260  namespace Mosaic {
260          }          }
261          void setGLPixelModes() {          void setGLPixelModes() {
262              glPixelStorei(GL_UNPACK_ALIGNMENT, 1);              glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
263                glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
264          }          }
265    
266          void *getPointer() {          void *getPointer() {
# Line 353  namespace Mosaic { Line 357  namespace Mosaic {
357          }          }
358          void reload() {          void reload() {
359              texid.bind();              texid.bind();
360                glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
361              content->setGLPixelModes();              content->setGLPixelModes();
362              glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);              glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
363              glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);              glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
# Line 364  namespace Mosaic { Line 369  namespace Mosaic {
369              glEnable(GL_TEXTURE_2D);              glEnable(GL_TEXTURE_2D);
370    
371              content->call_gluBuild2DMipmaps();              content->call_gluBuild2DMipmaps();
372                glPopClientAttrib();
373                texid.unbind();
374    
375          }          }
376          int getWidth() { return content->getWidth(); }          int getWidth() { return content->getWidth(); }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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