OpenGL fast texture drawing with vertex buffer objects. Is this the way to do it?

Posted by Matthew Mitchell on Stack Overflow See other posts from Stack Overflow or by Matthew Mitchell
Published on 2010-05-31T15:51:09Z Indexed on 2010/05/31 15:53 UTC
Read the original article Hit count: 214

Filed under:
|
|
|
|

Hello. I am making a 2D game with OpenGL. I would like to speed up my texture drawing by using VBOs.

Currently I am using the immediate mode. I am generating my own coordinates when I rotate and scale a texture. I also have the functionality of rounding the corners of a texture, using the polygon primitive to draw those.

I was thinking, would it be fastest to make a VBO with vertices for the sides of the texture with no offset included so I can then use glViewport, glScale (Or glTranslate? What is the difference and most suitable here?) and glRotate to move the drawing position for my texture. Then I can use the same VBO with no changes to draw the texture each time. I could only change the VBO when I need to add coordinates for the rounded corners.

Is that the best way to do this? What things should I look out for while doing it? Is it really fastest to use GL_TRIANGLES instead of GL_QUADS in modern graphics cards?

Thank you for any answer.

© Stack Overflow or respective owner

Related posts about c++

Related posts about opengl