glDrawElements - textures or whatnot

Started by
1 comment, last by Trienco 18 years, 5 months ago
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.
I say Code! You say Build! Code! Build! Code! Build! Can I get a woop-woop? Woop! Woop!
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.
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.
f@dzhttp://festini.device-zero.de

This topic is closed to new replies.

Advertisement