Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGl multitexturing error

Started by Cibressus Apr 24, 2004 at 11:00 AM 9 replies 1.6k views
Original Post
Cibressus
Cibressus
I just dled nehe''s lesson 22, have''nt changed the code or anything, and i''m compiling it to see if it will compile on my machine. i get htese errors and i have no idea how to fix them. --------------------Configuration: lesson22 - Win32 Debug-------------------- Compiling... lesson22.cpp c:\documents and settings\all users\documents\lesson22\lesson22.cpp(44) : error C2372: ''glMultiTexCoord1fARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2057) : see declaration of ''glMultiTexCoord1fARB'' c:\documents and settings\all users\documents\lesson22\lesson22.cpp(45) : error C2372: ''glMultiTexCoord2fARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2065) : see declaration of ''glMultiTexCoord2fARB'' c:\documents and settings\all users\documents\lesson22\lesson22.cpp(46) : error C2372: ''glMultiTexCoord3fARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2073) : see declaration of ''glMultiTexCoord3fARB'' c:\documents and settings\all users\documents\lesson22\lesson22.cpp(47) : error C2372: ''glMultiTexCoord4fARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2081) : see declaration of ''glMultiTexCoord4fARB'' c:\documents and settings\all users\documents\lesson22\lesson22.cpp(48) : error C2372: ''glActiveTextureARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2053) : see declaration of ''glActiveTextureARB'' c:\documents and settings\all users\documents\lesson22\lesson22.cpp(49) : error C2372: ''glClientActiveTextureARB'' : redefinition; different types of indirection c:\program files\microsoft visual studio\vc98\include\gl\gl.h(2054) : see declaration of ''glClientActiveTextureARB'' Error executing cl.exe. lesson22.exe - 6 error(s), 0 warning(s)
Cibressus
Cibressus
btw i''m using the mesa distro of opengl version 6.0
noVum
noVum
Mesa? Mesa is a software implementation of GL. You don''t want to use that if you have a 3D accelerator
JTippetts
JTippetts
Those function pointers already been defined in gl.h. When using OpenGL extensions, it is necessary to define function pointers to the various functions required just that lesson does, but multitexturing was incorporated into the standard awhile ago, and those functions are already defined in the gl.h header. Try commenting out the declarations of those various function pointers and the code where their values are assigned in your application, and see if it works.
Cibressus
Cibressus
then do you know were i can find a hardwere distro of opengl?
Cibressus
Cibressus
when you say function pointers i assume you mean something like #define GL_FALSE 0x0

i don''t have any of those in my code, but i''m going to look through gl.h for the multitexture thingies and put those in my code.
Cibressus
Cibressus
All i could find in my gl.h header that looks something like multi-texturing is

typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);

but htats not a #define

here's the code were i'm getting the erros if that helps any.

PFNGLMULTITEXCOORD1FARBPROC glMultiTexCoord1fARB = NULL;
PFNGLMULTITEXCOORD2FARBPROC glMultiTexCoord2fARB = NULL;
PFNGLMULTITEXCOORD3FARBPROC glMultiTexCoord3fARB = NULL;
PFNGLMULTITEXCOORD4FARBPROC glMultiTexCoord4fARB = NULL;
PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB= NULL;


EDIT: after a bit more looking i did find these.

#ifndef GL_ARB_multitexture
#define GL_ARB_multitexture 1

#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
#define GL_TEXTURE2_ARB 0x84C2
#define GL_TEXTURE3_ARB 0x84C3
#define GL_TEXTURE4_ARB 0x84C4
#define GL_TEXTURE5_ARB 0x84C5
#define GL_TEXTURE6_ARB 0x84C6
#define GL_TEXTURE7_ARB 0x84C7
#define GL_TEXTURE8_ARB 0x84C8
#define GL_TEXTURE9_ARB 0x84C9
#define GL_TEXTURE10_ARB 0x84CA
#define GL_TEXTURE11_ARB 0x84CB
#define GL_TEXTURE12_ARB 0x84CC
#define GL_TEXTURE13_ARB 0x84CD
#define GL_TEXTURE14_ARB 0x84CE
#define GL_TEXTURE15_ARB 0x84CF
#define GL_TEXTURE16_ARB 0x84D0
#define GL_TEXTURE17_ARB 0x84D1
#define GL_TEXTURE18_ARB 0x84D2
#define GL_TEXTURE19_ARB 0x84D3
#define GL_TEXTURE20_ARB 0x84D4
#define GL_TEXTURE21_ARB 0x84D5
#define GL_TEXTURE22_ARB 0x84D6
#define GL_TEXTURE23_ARB 0x84D7
#define GL_TEXTURE24_ARB 0x84D8
#define GL_TEXTURE25_ARB 0x84D9
#define GL_TEXTURE26_ARB 0x84DA
#define GL_TEXTURE27_ARB 0x84DB
#define GL_TEXTURE28_ARB 0x84DC
#define GL_TEXTURE29_ARB 0x84DD
#define GL_TEXTURE30_ARB 0x84DE
#define GL_TEXTURE31_ARB 0x84DF
#define GL_ACTIVE_TEXTURE_ARB 0x84E0
#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2

i'm not to sure how to use these, i'm going to try and copy and paste them in my code.

[edited by - cibressus on April 24, 2004 12:58:39 PM]
Cibressus
Cibressus
no, that did''nt help at all, i''m going to check in the red book to see what it says and the opengl game programing book.
Cibressus
Cibressus
ok that did''nt help i tried


glMultiTexCoord2fARB = (PFNGMULTITEXCOORD2FARBPROC)wglGetProcAddress("glMultiTexCoord2fARB ");
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActivateTextureARB");
glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)wglGetProcAddress("glClientActiveTextureARB");


_the_phantom_
_the_phantom_
quote:
Original post by Cibressus
then do you know were i can find a hardwere distro of opengl?


Assuming you have a card which can do hardware accelration of OpenGL (so any Nvidia or ATI card) you already have the best you are going to get hardware wise.

From a programming point of view, you have to link to the 1.1 librays/header files and then access anything beyond 1.1 as extensions because the lib file hasnt been updated since 1.1

I''m guessing the problem you have is that the Mesa library defines the functions (Because it does it work in software) however the NeHe example expects to have to find and load the extensions, thus is defines those function pointers at the top of the CPP file.
Remove those lines and the problem should go away while you are using Mesa (however it will be slow) and you''d be better off leaving them and linking to standard lib/h files which come with VC6 so you can use hardware mode.
Cibressus
Cibressus
could someone post some code were they have gotten multi-texturing to work?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.