Advertisement

Multi-texturing

Started by August 04, 2002 12:44 AM
5 comments, last by ATronic 22 years, 6 months ago
Hi, I''ve been working on getting a program of mine to support multi-texturing using OpenGL. The thing is, wglGetProcAddress always returns NULL pointers, and I know I have support for multi-texturing. I even tried directly copying other people''s code to make sure I hadn''t made a typo... same result. Anyone here have an idea as to why? Alex Broadwin A-Tronic Software & Design ----- "if you fail in life, you were destined to fail. If you suceed in life, call me." "The answer is out there." "Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Here''s my func :

// **********************************************
bool Init_MultiTexturing_Extension(void) // Initialisation du multi-texturing
{
// Pour donner le nom de l''extension
char *Extension;

Extension = (char *) glGetString(GL_EXTENSIONS);

if (!(strstr(Extension, "GL_ARB_multitexture")) == 1)
{
// L''extension "GL_ARB_multitexture" n''est pas supportée ==> PAS DE MULTITEXTURING
KillGLWindow();
MessageBox(NULL,"GL_ARB_multitexture","ERREUR : Extension non supportée :",MB_ICONERROR);
exit (0);
}

else
{
// L''extension "GL_ARB_multitexture" est supportée ==> MULTITEXTURING

// Initialisation du MultiTexturing
glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC) wglGetProcAddress("glMultiTexCoord2fARB");
glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC) wglGetProcAddress("glActiveTextureARB");
glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC) wglGetProcAddress("glClientActiveTextureARB");

if (!glActiveTextureARB || !glMultiTexCoord2fARB || !glClientActiveTextureARB)
{
// Une erreur ???
KillGLWindow();
MessageBox(NULL,"GL_ARB_multitexture","ERREUR : Impossible d''initialiser l''extension",MB_ICONERROR);
exit (0);
}
}

return true;

}


And in your "InitGL()"

// Initialisation du MultiTexturing si l''extension est supportée
if (!Init_MultiTexturing_Extension())
{
MultiTexturing = false;
}
else MultiTexturing = true;

========================
Leyder Dylan
http://ibelgique.ifrance.com/Slug-Production/
========================Leyder Dylan (dylan.leyder@slug-production.be.tf http://users.skynet.be/fa550206/Slug-Production/Index.htm/
Advertisement
Here again: are you sure that your rendering context is valid ?
My rendering context is valid. I''ll try your function Yann L.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
quote:

I''ll try your function Yann L.


I did not post it
Heh. Wrong person. I''m trying Leyder Dylan''s.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Advertisement
On my card (gf3, with latest detonator drivers) multi texturing only works when the desktop colour depth is set to 32 bits. If its set to anything else, wglGetProcAddress() returns NULL. Try messing with your display properties.

This topic is closed to new replies.

Advertisement