This topic is now archived and is closed to further replies.

Brother Erryn

Strange binding behavior

Recommended Posts

I have a "draw" loop that works like this (yes, this is VB):
    While i < submeshcount + 1
        glEnable GL_TEXTURE_2D
        glPolygonMode GL_FRONT_AND_BACK, GL_FILL
        glBindTexture GL_TEXTURE_2D, texture(i + 1)
        glDisable GL_CULL_FACE
        glEnable GL_DEPTH_TEST
        For j = 0 To vertexcounts(i) / 3 - 1
            glBegin GL_TRIANGLES
                glColor4f Colors(j * 12 + 1), Colors(j * 12 + 2), Colors(j * 12 + 3), Colors(j * 12 + 4)
Now it draws both submeshes (collections of vertices) just fine. It''s the texturing that''s amiss. If I trace this, it seems to do as it should...first binding texture "1", then number "2". These are the correct ones. If I specify 1 or 2 for the binding, it will obediently use that texture...but I can''t get it to use one texture for one submesh, and the other for the second. Did I do something off?

Share this post

Link to post
Share on other sites
Err...ummm...actually, that code was in there, I was just a bit overzealous with my code trimming.

I did figure out the real problem, and it wasn''t much better. Stupid coding on my part.

Share this post

Link to post
Share on other sites