GUI - glDrawPixels or GL_QUADS?

Started by
4 comments, last by V-man 12 years, 4 months ago
Hi all

In my game I have a 2D GUI wich I draw in the glOrtho mode and with glBegin(GL_QUADS), this works very well. My question is if it would be better to draw the 2D GUI with glDrawPixels concidering performance. Is there any difference?

thx
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
Advertisement
On todays hardware and drivers, glDrawPixels performs just fine. In the old days, such as on a matrox G200, the performance would drop to 1 - 3 FPS.If you plan on one day updating and going with GL 4.2 core profile, you should know that glDrawPixels is gone.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Ok, so I stay with the glBegin(GL_QUADS) one. I dont want to change the gui rendering since glDrawPixels hasn't any advantages (and will be oboslete in future like V-man mentioned).

thanks
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
You should note that glBegin style rendering is also deprecated in core profiles (as is, I believe, the GL_QUADS primitive type).

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

And what is the state of the art way to render 2d stuff in future with opengl, vertex arrays?
------------------------<< deltasoft games >>Homepage: http://www.deltasoftgames.ch
Plain old vertex arrays are gone as well. Everything must be done through VBO + VAO.
Of course, that is a core profile thing.

You can still create compatibility profile on Windows.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement