Lesson 06 glGenTextures Help
Hello, and thank you for reading my post.
I am a somewhat experienced programmer for 2 years in c++ and JAVA2. I have just begun my study of opengl on my own initiative in college. This is an excellent site, and it is very useful for an introduction to 3d graphics.
I have been completeing Lessons 1-5. They have run perfectly. When I tried Lesson 06 (texturing), I have encountered the following errors:
****************************************
C:\MSDEV\Projects\Prog06\Lesson6.cpp(65) : error C2065: ''glGenTextures'' : undeclared identifier
C:\MSDEV\Projects\Prog06\Lesson6.cpp(65) : error C2064: term does not evaluate to a function
C:\MSDEV\Projects\Prog06\Lesson6.cpp(68) : error C2065: ''glBindTexture'' : undeclared identifier
C:\MSDEV\Projects\Prog06\Lesson6.cpp(68) : error C2064: term does not evaluate to a function
C:\MSDEV\Projects\Prog06\Lesson6.cpp(133) : error C2064: term does not evaluate to a function
Error executing cl.exe.
Lesson6.obj - 5 error(s), 0 warning(s)
*****************************************
It would appear that the crucial lines of code start here at around line 65:
-----------------------------------------
if (TextureImage[0]=LoadBMP("Data/NeHe.bmp"))
{
Status=TRUE; // Set The Status To TRUE
glGenTextures(1, &texture[0]); // Create The Texture
// Typical Texture Generation Using Data From The Bitmap
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
}
-------------------------------------------
I hope that these lines are helpful, and do not confuse. I hope that the following information may also prove useful...
I have copied and pasted the source code DIRECTLY from NeHe''s code to see if it runs.. it does not. So that rules out a typo bug... I have also tried code from "OpenGL Programming Guide", third edition by Woo, Neider, Davis, and Shreiner that has to do with texture mapping. This also does not work.
I am running Microsoft Visual C++ 4.0 with the following links:
opengl32.lib glu32.lib glut32.lib
I hope I have not overwhelmed anyone here. Any help would be greatly appreciated. I have reached a road block on my education of OpenGL. If you want a gift for your help, I will send you candy, or ciggerettes, as I have taken up this nasty habit because of these F***ING errors.. UGH!
that, and I have a Comp Sci Discrete Structures paper due in about a half hour... ^_^
well, thats all the info I can give you at this time... It seems that I am not the only one with problems on Lesson 06, but the other forum members have not included enough information as I have.
any help would be greatly appreciated.
Thank you
~Stuart Anderson
Thanks for listening!
It looks like you have an outdated version of the gl.h header file. In OpenGL 1.0, glGenTextures() and glBindTexture() didn''t exist. So check your gl.h header, somewhere near the top there should be a version define, similar to this one:
#define GL_VERSION_1_1
If you have version 1.0 instead of 1.1, then you need to update your headers and libs.
#define GL_VERSION_1_1
If you have version 1.0 instead of 1.1, then you need to update your headers and libs.
GREAT!!!
now, do you want ciggerettes, or candy?
~stu
now, do you want ciggerettes, or candy?
~stu
Thanks for listening!
GREAT!!!
now, do you want ciggerettes, or candy?
~stu
now, do you want ciggerettes, or candy?
~stu
Thanks for listening!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement