Jump to content
  • Advertisement

Archived

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

Brother Erryn

Strange binding behavior

This topic is 5770 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 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)
                etc.
            glEnd
        Next
    Wend 
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
Advertisement
Guest Anonymous Poster
try adding i = i + 1

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

  • 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!