Re: glBegin/glEnd faster than glDrawElements?

Andreas Umbach <[email protected]> Sun, 06 Nov 2005 02:18:25 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
On 11/1/05, William Woodbury <[email protected]> wrote:
>
> Hello,
> Under what circumstances is this possible? I have arrays of point, normal,
> and uv data which represent a grid. I also have an array which represents
> my
> primatives (triangles, 2 for each grid square). When I draw the entire
> array
> using glDrawElements, it is slower than when I use glBegin/glEnd and loop
> through the entire grid.
>
> How is this possible?


That entirely depends on your benchmarking. Note that you can't just measure
the time of excecution from glBegin to glEnd(), because the driver's likely
not done any work between those, except preparing & filling some command
queue. The only way to benchmark this is to measure the impact the change
has on your frame rate. Also, make sure you have a sane frame rate (e.g.
between 10 - 50 fps, vsync off, etc.etc.) otherwise other factors can throw
your benchmarking way off.

- Andreas