OpenGL is a quick texture drawing with vertex buffer objects. Is this a way to do this?

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

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

I thought it would be faster to do VBO with vertices for the sides of the texture without offset, so I can use glTranslate, glScale and glRotate to move the paint position for my texture. Then I can use the same VBO without changes to paint the texture every time. I could only change VBO when I need to add coordinates for rounded corners.

Is this the best way to do this? What things should I watch with when I do this? Is it really fast to use GL_TRIANGLES instead of GL_QUADS in modern graphics cards?

Thanks for any answer.

+5
source share
2 answers

, ( ) glDrawArrays .. / , . (, , ) .

, , , (), , ) . , . , , . , , , , , ( ).

, GL_QUADS OpenGL. , , QUADS /.

+4

, VBOs, , ( UV ) , ( glColor, ). glClientActiveTexture (GL_TEXTUREn) . glEnableClientState() , , .

+1

All Articles