I have a question. I want to use textures but my compiler says :
“Call to undefined function ‘glGenTextures’”
“Call to undefined function ‘glBindTexture’”
I tried with
“PROC glGenTextures = wglGetProcAddress( “glGenTextures” );”
But then compiler says “Extra parameter in call.”
Please, ¿Could anybody help me?.My e-mail : ccastro@rslcom.es
Thanks:
Carlos
You are doing everything right, except that you don’t declare glGenTextures as a functionpointer with proper number and types of arguments.
You need to declare glGenTextures, for example, as a pointer to a function that takes first an unsigned integer, and then a pointer to an array of unsigned integers. That is what the function looks like. Same with glBindTextures, but with other types/numbers of arguments.
Here the prototypes for each of the two functions you mention:
void glGenTextures(GLsizei n,GLuint * textures)
void glBindTexture(GLenum target, GLuint texture)
Originally posted by Bob: You are doing everything right, except that you don’t declare glGenTextures as a functionpointer with proper number and types of arguments.
Thank you Bob, but how can I do that?. The pieze of code :
First off, did you include gl.h?
If you are implicitly loading the library you should not need to get the address of any functions except for the extensions.
The only time you would need to get the procedure address is if you are explicitly loading the opengl library dynamically. And then you should use GetProcAddress rather than wglGetProcAddress. Use wglGetProcAddress only to get extension procedure addresses.
Are you loading the library implicitly or explicitly? That is, are you using LoadLibrary to explicitly load the opengl library? Or are you letting windows link it implicitly?
Originally posted by DFrey: Are you loading the library implicitly or explicitly? That is, are you using LoadLibrary to explicitly load the opengl library? Or are you letting windows link it implicitly?
I am not using LoadLibrary, these are my includes :
Ok if you are linking to the library implicitly, I’m curious then as to why you were trying to get the procedure address for glGenTextures. Did you have to get the procedure address of glBegin before it would work? You shouldn’t have to since glBegin and glGenTextures are both declared in gl.h and then defined by the implicit linkage. Are you adding in the glu32.lib and opengl32.lib?
[This message has been edited by DFrey (edited 11-03-2000).]
All gl* functions should be “defined” in opengl32.lib, glu* in glu32.lib. Either you are using a very old version of the opengl build, or I don’t know. Are you sure you’ve got Opengl 1.1 libraries? glGenTextures is included, you don’t have to link to it yourself.
Originally posted by Michael Steinberg: I’ve got no ****ing idea where to find them, but I can send them to you, if you’re using VC++ 6
I am using Borland C++ Buider…
I tried to open opengl32.lib with notepad and I found the name of all the gl* functions, but the string “glGenTextures” does not appear, so I think the problem was a very old version of opengl after all.
Somebody know where can I download the files for Borland C++ Builder?
I found a way to get a Borland .lib file from a dll.
In a ms-dos shell type :
impdef opengl32.def opengl32.dll
implib opengl32.lib opengl32.def
del opengl32.def
implib glu32.lib glu32.dll
but I still need an updated version for Borland’s gl.h
I tried to define the new functions in gl.h:
WINGDIAPI void APIENTRY glGenTextures (GLsizei n, GLuint * textures);
WINGDIAPI void APIENTRY glBindTexture (GLenum target, GLuint texture);
but compiler said “unable to open file UUID.lib”