Last post about 2D in OpenGL (so please stop!)

Started by
33 comments, last by vincoof 19 years, 10 months ago
Quote:Original post by Eber Kain

I would think that calling glLoadMatrix is faster than glOrtho or another function that has to re-calculate the matrix every frame.


Sure, but in the method you posted you call glOrtho as often as I do. :) So where's the performance loss ?

And while you're pointing correctly that glLoadMatrix may be faster than glOrtho, I'd like to point that glGetDoublev is much slower than any kind of matrix operation. In general, anything read back from the server side should be discarded when you look for the highest performance.
Advertisement
Optimising this for speed is a complete waste of time. Unless you're switching between 2D and 3D thousands of times per frame, you won't see any noticeable increase in frame rate.

____________________________________________________________www.elf-stone.com | Automated GL Extension Loading: GLee 5.00 for Win32 and Linux

In the code I posted, you call Perspective#D once in your entire program. You then call Render#D before drawing to specify if you want 2D or 3D.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
OKey GRATE so now how d0 I trun this into a gaeM?!?!?!????

(P.S. Thanks, that's awesome, and makes me almost wish I used OpenGL)
I program games professionally. Enough said.
Quote:Original post by Eber Kain
In the code I posted, you call Perspective#D once in your entire program.

Yes it is called thousands of time during the game, but what's important is that it's called once PER FRAME. It's true that optimizing every part of the engine is always a gain, but it's also true that if the performance gain makes almost no difference you'd better spend your time on other optimization things that will significantly improve frame rate, and come back later (probably in the end) on such negligible improvements.

Quote:Original post by Tube
OKey GRATE so now how d0 I trun this into a gaeM?!?!?!????

Sure, I have the three lines of code solution that makes anything a great game everyone would love. Mind me if I post it later ?

This topic is closed to new replies.

Advertisement