22 |
using std::vector; |
using std::vector; |
23 |
|
|
24 |
using std::cerr; |
using std::cerr; |
|
using std::cout; |
|
25 |
|
|
26 |
ExtCalls ext_calls; |
ExtCalls ext_calls; |
27 |
|
|
214 |
int w = atoi(v[4].c_str()); |
int w = atoi(v[4].c_str()); |
215 |
int h = atoi(v[5].c_str()); |
int h = atoi(v[5].c_str()); |
216 |
vector<GLfloat> pixels = getfv(v, 8, w * h); |
vector<GLfloat> pixels = getfv(v, 8, w * h); |
217 |
/* XXX: need to multiply with the number of components, too |
if (pixels.size() % (unsigned)(w * h)) { |
|
if (pixels.size() != (unsigned)(w * h)) { |
|
218 |
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match the size " << pixels.size() << " of data\n"; |
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match the size " << pixels.size() << " of data\n"; |
219 |
return false; |
return false; |
220 |
} |
} |
|
*/ |
|
221 |
glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]), |
glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]), |
222 |
w, h, atoi(v[6].c_str()), getToken(v[7]), |
w, h, atoi(v[6].c_str()), getToken(v[7]), |
223 |
GL_FLOAT, &pixels[0]); |
GL_FLOAT, &pixels[0]); |
225 |
int w = atoi(v[4].c_str()); |
int w = atoi(v[4].c_str()); |
226 |
int h = atoi(v[5].c_str()); |
int h = atoi(v[5].c_str()); |
227 |
vector<GLushort> pixels = getiv<GLushort>(v, 8, w * h); |
vector<GLushort> pixels = getiv<GLushort>(v, 8, w * h); |
228 |
if (pixels.size() != (unsigned)(w * h)) { |
if (pixels.size() % (unsigned)(w * h)) { |
229 |
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match the size " << pixels.size() << " of data\n"; |
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match the size " << pixels.size() << " of data\n"; |
230 |
return false; |
return false; |
231 |
} |
} |
242 |
} else if (checkfunc(v, "TexEnv", 3, true)) { |
} else if (checkfunc(v, "TexEnv", 3, true)) { |
243 |
if (v.size() > 4) { |
if (v.size() > 4) { |
244 |
vector<GLfloat> params = getfv(v, 3, 4); |
vector<GLfloat> params = getfv(v, 3, 4); |
|
// XXX: Note: according to c++/98, the type of params.begin() |
|
|
// is implementation defined and may be other than GLfloat* |
|
245 |
glTexEnvfv(getToken(v[1]), getToken(v[2]), ¶ms[0]); |
glTexEnvfv(getToken(v[1]), getToken(v[2]), ¶ms[0]); |
246 |
} else { |
} else { |
247 |
glTexEnvf(getToken(v[1]), getToken(v[2]), getTokenf(v[3])); |
glTexEnvf(getToken(v[1]), getToken(v[2]), getTokenf(v[3])); |
342 |
case 4: glColor3d(atof(v[1].c_str()), |
case 4: glColor3d(atof(v[1].c_str()), |
343 |
atof(v[2].c_str()), |
atof(v[2].c_str()), |
344 |
atof(v[3].c_str())); break; |
atof(v[3].c_str())); break; |
345 |
|
default: |
346 |
|
cerr << "Ignoring extra arguments to Color\n"; |
347 |
case 5: glColor4d(atof(v[1].c_str()), |
case 5: glColor4d(atof(v[1].c_str()), |
348 |
atof(v[2].c_str()), |
atof(v[2].c_str()), |
349 |
atof(v[3].c_str()), |
atof(v[3].c_str()), |
350 |
atof(v[4].c_str())); break; |
atof(v[4].c_str())); break; |
|
default: |
|
|
cerr << "Ignoring extra arguments to Color\n"; |
|
351 |
} |
} |
352 |
} else if (checkfunc(v, "Normal", 3)) { |
} else if (checkfunc(v, "Normal", 3)) { |
353 |
glNormal3d(atof(v[1].c_str()), |
glNormal3d(atof(v[1].c_str()), |
357 |
glLineWidth(atof(v[1].c_str())); |
glLineWidth(atof(v[1].c_str())); |
358 |
} else if (checkfunc(v, "PointSize", 1)) { |
} else if (checkfunc(v, "PointSize", 1)) { |
359 |
glPointSize(atof(v[1].c_str())); |
glPointSize(atof(v[1].c_str())); |
|
} else if (checkfunc(v, "Scale", 3)) { |
|
|
glScaled(atof(v[1].c_str()), |
|
|
atof(v[2].c_str()), |
|
|
atof(v[3].c_str())); |
|
|
} else if (checkfunc(v, "Rotate", 4)) { |
|
|
glRotated(atof(v[1].c_str()), |
|
|
atof(v[2].c_str()), |
|
|
atof(v[3].c_str()), |
|
|
atof(v[4].c_str())); |
|
360 |
|
|
361 |
#ifdef GL_REGISTER_COMBINERS_NV |
#ifdef GL_REGISTER_COMBINERS_NV |
362 |
|
|