PDA

View Full Version : A simple question



02-25-2003, 07:33 PM
I want to build a example about 3D texture in vc++6. But there is a error, error C2065: 'GL_TEXTURE_3D'(the first parameter of the function glTexParameteri) : undeclared identifier, and a warning, warning C4013: 'glTexImage3D' undefined; assuming extern returning int.
Why? Is it a problem about the programming environment configuration? And how can i deal with it?

shinpaughp
02-25-2003, 07:59 PM
glTexImage3D is an extension. Look here (http://www.opengl.org/developers/faqs/technical/extensions.htm) for info about using extensions in OpenGL which is a link to the FAQs section. Also download glext.h at the bottom of the linked page which contains all the header info for all extension to date (I think).

02-26-2003, 02:08 AM
Thank you very much. But there are still problems as follow:
warning C4013: 'glTexImage3D' undefined; assuming extern returning int
Linking...
tex3d.obj : error LNK2001: unresolved external symbol _glTexImage3D
tex3d.exe : fatal error LNK1120: 1 unresolved externals

mikael_aronsson
02-26-2003, 04:13 AM
Hi !

opengl32.lib does not have any exported reference to anything beyond OpenGL 1.1, so you need to get the address yourself.

Take a look at the FAQ on this website for more information on how to do it, it does depend on your platform.

Mikael

shinpaughp
02-26-2003, 10:09 AM
What is your graphics card? And show the code where you define glTexImage3D. Did you read the link I provided (all of it)? Also, does your graphics card support OpenGL 1.2?You have to define glTexImage3D as type PFNGLTEXIMAGE3DPROC and then in your code you have to set glTexImage3D by calling wglGetProcAddress("GL_TEXTURE_3D_EXT").

//Global variable
PFNGLTEXIMAGE3DPROC glTexImage3D;

//In your code after GL context has been created
glTexImage3D = wglGetProcAddress("GL_TEXTURE_3D_EXT");




[This message has been edited by shinpaughp (edited 02-26-2003).]

02-26-2003, 05:02 PM
The code uses glTexImage3D without definition. Because the code comes from a book, OpenGL SuperBible, i didn't realize that there would be problems in the code.
My platform is w2k and my graphics card is geforce mx200. It supports OpenGL 1.3.1.
Thank you.

shinpaughp
02-26-2003, 05:26 PM
So, have you tried modifying the given code as stated? The code from the book is not good as is in this case. Extensions are not predefined. The only reason people ask about your GPU is that if it doesn't support a given functionality then you are dependent on software and windows software only supports v1.1 which would mean you are wasting your time. But, as your GPU supports v1.3 modify your code to support the extension.

02-26-2003, 05:59 PM
yeah, it's ok now. I understand what you mean.
Formerly i thought the codes in the book should be verified and i just want to see the result of the code.
And i didn't know much about what the OpenGL's versions differ in. Furthermore i thought the ICD and opengl32.dll would do everything for me.
But now i have made more sense about OpenGL. So I really appreciate your help.

02-26-2003, 06:09 PM
yeah, it's ok now. I understand what you mean.
Formerly i thought the codes in the book should be verified and i just want to see the result of the code.
And i didn't know much about what the OpenGL versions differ in. Furthermore i thought the ICD and opengl32.dll would do everything for me.
But now i have made more sense about OpenGL. So i really appreciate you help.