To use textures ... that's *slightly* complicated.
First of all you need to get some "raw" texture data into your program. It's up to you how you're going to do that ... not sure how VB'll work. Delphi can do it easily from BMP files for you.
Then, upload it to the video card using glTexImage2D. Note: Width/Height must be powers of two (2,4,8,16,32,etc).
Enable texturing with
glEnable(GL_TEXTURE_2D);
For each vertex, specify the texture coordinate (which position on the texture image to use) with glTexCoordinate. Works a lot like glColor. You can still (and should) specify a colour with glColor as well; it'll be blended into the texture. Specify white to leave the texture unchanged.
Hopefully that's all you need to use simple textures.
To use multiple textures at once you need to use texture bindings. You can do that using
glGenTextures
to create a new "texture object".
and
glBindTexture
to activate a texture.
Basically, say you generate two texture bindings, T1 and T2.
If you did
glBindTexture(T1);
glTexImage2D(....., SomeData1, ...);
glBindTexture(T2);
glTexImage2D(....., SomeData2, ...);
Texture T1 would contain the texture data held in SomeData1, T2 the data from SomeData2.
When you wanted to draw polygons using texture 1, just do
glBindTexture(T1);
to activate it, and so on.
Once you've finished with a texture, use
glDeleteTextures
to remove them.
That's the *basics*. You should really look at a proper tutorial if you get any problems.
How to get at TEX files? My LGP tools can convert them to BMP's easily. There's a Delphi unit on my website (PSXTex) that contains the code I used to do it, if that's any help.