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

Multitexturing in Visual Basic 6

Started by AndyEsser May 31, 2006 at 6:04 AM 5 replies 1.3k views
Original Post
AndyEsser
AndyEsser
I've reached the stage in my program where i need to incorporate multitexturing but all the tutorials i find are, obviously, for C/C++ so I'm having to try and reverse engineer them for Visual Basic but I'm having some problems. glActiveTextureARB This line of code doesn't work in VB6 and neither do any of the other bits of code for multitexturing. Now my question is "are they named something different in VB or does VB just not support it?" My graphics card supports gl_arb_multitexture but VB doesn't understand that line of code. Any suggestions? Or any snippets of code would be much appreciated. Thanks
fat-tony
fat-tony

Is this the first time you've used an OpenGL extension in VB? Perhaps the "headers" aren't up to date? I've never used OpenGL + VB, but it seems like a likely cause.

AndyEsser
AndyEsser
Yea this is the first time i've used an extension, but I have no idea how to update the headers. But thanks for your help, I'll see what I can do :P
GoldenEagle
GoldenEagle
I'm not especially familier with the operation/usage of OpenGL extentions (having never actually tried to use them), but as I understand it, the extra functions are essentially exported by the drivers for the video card via a "customized" OpenGL32.dll.

In C++ these can be accessed by either including the functions in a header and linking with the correct link library (assuming such a link library exists, which I don't think it does), or by using the LoadLibrary/GetProcAddress Win32 APIs (which is better anyway, in case the extention you're trying to use doesn't exist in the DLL).

If VB6, I believe you'll need to use a Declare Function statement to define the extention's prototype and the library to import from (OpenGL32.dll). I think VB6's error handling will allow you to catch an error if the function doesn't exist. The real trick here is figuring out what prototype to give VB6. Converting a C++ prototype to a VB6 Declare can be a bit difficult, especially if the function has anything to do with pointers.

If I'm wrong about any of this, will someone please correct me? (Especially the part about how you call the extentions from C++.)
AndyEsser
AndyEsser
Thanks everyone, I'll see if I can get it to link to the right prototype, I'll let you know how it goes.

thanks for all your replies

Andy
Smit
Smit
I have no idea if the following will work, but it's on the right path...

Declare Sub glActiveTextureARB Lib "opengl32.lib" ( ByVal Texture As Integer )
AndyEsser
AndyEsser
Thanks for that, haven't tested it properly but it didn't throw up any errors when i put it in. I think the problem I'm having is that the VB6 "header" file 'vbogl.tlb' is only for OpenGL 1.2, which I'm guessing doesn't contain these extensions. I fear I may have to write my own library with similar declare functions as above.

Wahey!!

Thanks guys

Topic Locked

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

Sign in to reply to this topic.