-#if 0
- /* read back the texture and make sure values are correct */
- glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, tex2);
- CheckError(__LINE__);
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 16; j++) {
- if (tex[i][j][0] != tex2[i][j][0] ||
- tex[i][j][1] != tex2[i][j][1] ||
- tex[i][j][2] != tex2[i][j][2] ||
- tex[i][j][3] != tex2[i][j][3]) {
- printf("tex[%d][%d] %g %g %g %g != tex2[%d][%d] %g %g %g %g\n",
- i, j,
- tex[i][j][0], tex[i][j][1], tex[i][j][2], tex[i][j][3],
- i, j,
- tex2[i][j][0], tex2[i][j][1], tex2[i][j][2], tex2[i][j][3]);
+ if (1) {
+ /* read back the texture and make sure values are correct */
+ GLfloat *tex2 = (GLfloat *)
+ malloc(imgWidth * imgHeight * 4 * sizeof(GLfloat));
+ glGetTexImage(GL_TEXTURE_2D, 0, imgFormat, GL_FLOAT, tex2);
+ CheckError(__LINE__);
+ for (i = 0; i < imgWidth * imgHeight * 4; i++) {
+ if (ftex[i] != tex2[i]) {
+ printf("tex[%d] %g != tex2[%d] %g\n",
+ i, ftex[i], i, tex2[i]);