Skip to main content
gamedev.net
🔒 Locked

OpenGL rendering

Started by Cityhunter 2 replies 350+ views
Original Post
Cityhunter
Cityhunter
Hi, I was wondering about GL''s draw element. It allows for one index array to be passed in, does anyone know what happens to the uv array? The draw element uses the index array for the vertex data but what happens to the uv data? Does GL use the same index for the uv or does it just not support uv? Also how does everyone do model rendering? Display list? Vertex array? Or do you write your own index array loop? What''s the fastest way? Thanks
Ready4Dis
Ready4Dis
Vertex arrays are faster. And you have to use glTexCoordPointer to set the Texture Array pointer, and glEnableClientState(GL_TEXCOORD_POINTER).

I think I may have the syntax a tiny bit messy, but it should be very similar to what i showed you.

Billy - BillyB@mrsnj.com
Cityhunter
Cityhunter
once I have the texcoord pointer ready and enable. I''m trying to draw my model using an index array. However GL''s drawElement only takes in one index array, and the index for the vertex data and uv data are different.
Yann L
Yann L
the fastest way to render geometry is using vertex arrays with index arrays (and optionally VAR/VAO).

And OpenGL uses the same indices into vertex array, texcoord arrays, as well as any other enabled array.

-> Moved to OpenGL forum. And please do not crosspost !

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.