Jump to content
  • Advertisement
Sign in to follow this  

Multitexturing in Visual Basic 6

This topic is 4372 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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++.)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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 )

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!