PDA

View Full Version : getting .h and .LIB to do multi-texturing.



austin@x-plane.com
08-18-2001, 03:57 PM
Hello.

I am not able to multi-texture on Windows. (app runs fine on Mac)


I have OpenGL 1.2.1, acoording to glGetString(GL_VERSION).
I have "GL_ARB_multitexture" as one of my extensions reported by glGetString(GL_EXTENSIONS).

Sounds like I am ready to rock for multi-texture, right?

Well, here is the link error:

Link Error : Undefined symbol: _glMultiTexCoord2fARB@12 in HL_GRAPH.CPP
Link Error : Undefined symbol: _glMultiTexCoord2fvARB@8 in HL_GRAPH.CPP
Link Error : Undefined symbol: _glActiveTextureARB@4 in DRPLANE.CPP


I have included:

#include <c:\x-code\libinc\OpenGL-1.2\gl12.h>
#include <c:\x-code\libinc\OpenGL-1.2\glext12.h>

and the library OpenGl32.DLL, though I do not know how to confirm the version.

In case you are going to say I need to get the function pointer, when I say:

"PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB=NULL;"

I get compile error:

"Error : identifier 'glMultiTexCoord2fARB(unsigned int, float, float)' redeclared
was declared as: '__stdcall void (unsigned int, float, float)'
now declared as: '__stdcall void (*)(unsigned int, float, float)'
Hl_MNW.CPP line 14 PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;"


So it seems the sompiler has what it needs WITHOUT the "PFNGLMULTITEXCOORD2FARBPROC", but I still cannot link...
perhaps I need a newer opengl32.dll?

If so, where do I get it, exactly?

DFrey
08-18-2001, 04:38 PM
Ok this is a simple problem. Windows does not have an OpenGL 1.2 lib available at the moment. Your header is declaring glMultiTexCoord2fARB as a function. That's not going to work with a 1.1 lib. You need to declare glMultiTexCoord2fARB only as a function pointer and then get the procedure address from the 1.2 dll.


[This message has been edited by DFrey (edited 08-19-2001).]

austin@x-plane.com
08-18-2001, 06:24 PM
OK!

Excellent!

Now the next question:

HOW????

please show sample code.

zed
08-18-2001, 10:54 PM
http://www.opengl.org/developers/code/features/OGLextensions/OGLextensions.html

tfpsly
08-19-2001, 04:46 AM
Or you can use another compiler that does support opengl1.2 development header & lib.

tfpsly
08-19-2001, 04:48 AM
The reason is that Ms wants coders to use d3d instead of ogl, so they won't ease ogl coders life.

Bob
08-19-2001, 07:04 AM
A compiler with newer library files won't work. The problem is in opengl32.dll.

austin@x-plane.com
08-19-2001, 08:16 AM
I tried the instructions in the link you mentioned.

It did not compile.

Here is the code, letter for letter, from the documentation link you gave me, which I had already tried before I ever posted:

PFNGLPOINTPARAMETERFEXTPROC glPointParameterfEXT;
PFNGLPOINTPARAMETERFVEXTPROC glPointParameterfvEXT;


Here is the error from the compiler:


Error : identifier 'glPointParameterfEXT(unsigned int, float)' redeclared
was declared as: '__stdcall void (unsigned int, float)'
now declared as: '__stdcall void (*)(unsigned int, float)'
Hl_MNW.CPP line 14 PFNGLPOINTPARAMETERFEXTPROC glPointParameterfEXT;

Error : identifier 'glPointParameterfvEXT(unsigned int, const float *)' redeclared
was declared as: '__stdcall void (unsigned int, const float *)'
now declared as: '__stdcall void (*)(unsigned int, const float *)'
Hl_MNW.CPP line 15 PFNGLPOINTPARAMETERFVEXTPROC glPointParameterfvEXT;


So, the code that is listed in the documentation is not working in my case. (Wintel, CodeWarrior 6, OGL 1.2.1)

There seems to be an issue concerning VOID versus VOID POINTER, but I am not clear on where is WAS decalred, which one it SHOULD BE, or how to decalre it PROPERLY myself.

austin@x-plane.com
08-19-2001, 08:17 AM
You need to declare glMultiTexCoord2fARB only as a function pointer and then get the procedure address from the 1.2 dll.


Well isn't that exactly what the souce code does that I posted above?

DFrey
08-19-2001, 08:44 AM
In one of your OpenGL headers or source files, glMultiTexCoord2fARB is being declared as a function, comment it out (do a search to find it). Somewhere else glMultiTexCoord2fARB is being declared as a function pointer, that is correct, leave it alone. Then when initializing, after you have a valid render context current, use wglGetProcAddress to retrieve the procedure address.

[This message has been edited by DFrey (edited 08-19-2001).]

austin@x-plane.com
08-19-2001, 09:38 AM
In your one of your OpenGL headers or source files, glMultiTexCoord2fARB is being declared as a function, comment it out (do a search to find it).

HOLY TOLEDO!

I have NOT declaredd it as a function... this seems to point the finger at my gl.h files??? But how could such an error have gotten through???

Very interesting indeed! I will try your advice at once!

austin@x-plane.com
08-19-2001, 10:07 AM
[QUOTE]Originally posted by DFrey:
[B]In one of your OpenGL headers or source files, glMultiTexCoord2fARB is being declared as a function, comment it out (do a search to find it)

OK FINALLY.

I did this and it works.

The culprit was: "glext12.h".

I guess it has to do with me having the 1.2 .h file, but MS not supporting the 1.2 in the libs and dlls.

I would be willing to remove the 1.2 .h file altogether, but i need the various constans, etc, that are there.