/[gzz]/gzz/gfx/libcallgl/callgl.cxx
ViewVC logotype

Diff of /gzz/gfx/libcallgl/callgl.cxx

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

revision 1.22 by tjl, Wed Oct 16 08:41:33 2002 UTC revision 1.23 by tjl, Wed Oct 16 20:58:38 2002 UTC
# Line 99  namespace CallGL { Line 99  namespace CallGL {
99        return u;        return u;
100      }      }
101    
102      vector<GLint> getiv(vector<string> v, unsigned i, int reserve = 0) {      template<class Int> vector<Int> getiv(vector<string> v, unsigned i, int reserve = 0) {
103        vector<GLint> u;        vector<Int> u;
104        u.reserve(reserve);        u.reserve(reserve);
105        for (; i < v.size(); i++)        for (; i < v.size(); i++)
106          u.insert(u.end(), (GLint)atoi(v[i].c_str()));          u.insert(u.end(), (GLint)atoi(v[i].c_str()));
# Line 218  namespace CallGL { Line 218  namespace CallGL {
218            glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]),            glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]),
219                         w, h, atoi(v[6].c_str()), getToken(v[7]),                         w, h, atoi(v[6].c_str()), getToken(v[7]),
220                         GL_FLOAT, &pixels[0]);                         GL_FLOAT, &pixels[0]);
221            } else if (checkfunc(v, "TexImage2D_ushort", 8, true)) {
222              int w = atoi(v[4].c_str());
223              int h = atoi(v[5].c_str());
224              vector<GLushort> pixels = getiv<GLushort>(v, 8, w * h);
225              if (pixels.size() != (unsigned)(w * h)) {
226                cerr << "TexImage2D dimensions " << w << "x" << h << " do not match the size " << pixels.size() << " of data\n";
227                return false;
228              }
229              glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]),
230                           w, h, atoi(v[6].c_str()), getToken(v[7]),
231                           GL_UNSIGNED_SHORT, &pixels[0]);
232          } else if (checkfunc(v, "ColorTableEXT", 5, true)) {          } else if (checkfunc(v, "ColorTableEXT", 5, true)) {
233            vector<GLfloat> pixels = getfv(v, 5);            vector<GLfloat> pixels = getfv(v, 5);
234            glColorTableEXT(            glColorTableEXT(

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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