Jump to content
  • Advertisement
Sign in to follow this  
Kyall

glDrawElements - textures or whatnot

This topic is 4617 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'm making a gl engine for my game. And I've been reading continious things about this glDrawElements thing. I only have a vague idea how to use it so I would like someone to explain it to me. But more importantly... does texturing work in glDrawElements. Basically, for my game I have textured terrains and characters. Will using the glDrawElements function allow me to keep my textures correct or not? If not I can't use it, but if so.. how? please explain.

Share this post


Link to post
Share on other sites
Advertisement
Yes you can use textures with glDrawElements but you will need to look up vertex arrays or VBO. Look into a tutorial on how to use/setup vertex arrays.

Share this post


Link to post
Share on other sites
The only thing to keep in mind if you're having more than one set of texture coordinates is that vertices with different tex coords are different vertices. However, you can give each vertex a whole lot of texture coords, but will have to look up on how to get them to be blended and used the way you want. Once you get past the initial hassle of changing to shaders or vertex/fragment programs it is a lot more comfortable and giving a lot more control and options, anyway.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!