Bad Performance

Would creating an openGL context and drawing 2D graphics from an SDL setup have better performance than just drawing 2D graphics using SDL functions?

Jason Hawsey---------------------------------
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.

Would creating an openGL context and drawing 2D graphics from an SDL setup have better performance than just drawing 2D graphics using SDL functions?

As long as your users have decent graphics cards (i.e., which can do
hardware accelerated OpenGL), then yes, doing so is far faster, as where
possible OpenGL is hardware accelerated by default.

The other option is to use SDL_VIDEODRIVER to use one of hardware
accelerated 2D drivers, but in addition to a decent graphics card these
also require that you run in fullscreen and that your program is run with
root permissions.

JamesOn Sun, 10 Oct 2004 20:55:35 -0700, Jason Hawsey wrote:

Would creating an openGL context and drawing 2D graphics from an SDL
setup have better performance than just drawing 2D graphics using SDL
functions?

As long as your users have decent graphics cards (i.e., which can do
hardware accelerated OpenGL), then yes, doing so is far faster, as
where
possible OpenGL is hardware accelerated by default.

One important point needs to be made here. As long as all of your
application’s graphics are static (not changing) then everything above
is true. However, suppose your application changes these graphics (not
many games do - and when they do, they accomplish it using some kind of
palette changes) then you will clog the BUS to the system’s video
memory with all kinds of minor changes to your graphics.

I have seen an application that insisted on using OpenGL, AND
constantly mutating its graphics (which were applied as textures to 3D
objects.) If you MUST do this in your application, you can actually do
it faster by keeping a local copy of the image in a "software surface,"
modify that copy, then use OpenGL functions to upload the new texture
in place of the old one. Using the OpenGL texture uploading routines
ensures that the actual transmission of the new image is sent in as
fast a way as possible. Keeping a local copy of the surface speeds up
performance because it prevents your system from ever retrieving that
image data from video memory, in the case that you check those values.

I realize now, after writing this, that you are probably not doing this.On Oct 11, 2004, at 2:52 AM, James Gregory wrote:

On Sun, 10 Oct 2004 20:55:35 -0700, Jason Hawsey wrote: