Problem running in DGA mode

Hi all. I just started work on an SDL app, and am having some
problems. I’m trying to do something fairly simple - create a custom
mouse pointer. I am initializing SDL with all the right flags to do
double-buffering, fullscreen, and hardware surface. However, the frame
rates that I was seeing were awful - something on the order of 10fps. I
figured out that the surface I was getting didn’t support hardware
surfaces and reported my video memory at zero (I’ve got a 16MB riva
TNT). Well, my guess is that when the surfaces aren’t created in video
memory, then the SDL_Flip function is going to be very slow, since it
probably falls back on creating the back buffer in system memory, and
then copying the whole thing to video memory when the flip function is
called. This right? This would explain my horrible frame rates
(SDL_Flip alone takes about 50ms).

After reading this newsgroup, I figured out that what I wanted was to

run it in DGA mode. I’ve got version 4.0.1 of X, and I’ve got it
running with the DGA extension turned on. The “dga” program works fine,
so I think that’s all set up okay. However, when I run my program, I
still see very bad frame rates, and it’s still reporting my surface as
being in system memory (I AM logged in as root). Also, when I set
SDL_VIDEODRIVER to dga, the program is unable to initialize SDL. Is
there some way for me to ask the library exactly WHY it was unable to
initialize? Is there something obvious that I’m doing wrong? Or maybe
someone has some general tips to get this thing working.

Thanks for any help,
Eric Wittmann

After reading this newsgroup, I figured out that what I wanted was to
run it in DGA mode. I’ve got version 4.0.1 of X, and I’ve got it
running with the DGA extension turned on. The “dga” program works fine,
so I think that’s all set up okay. However, when I run my program, I
still see very bad frame rates, and it’s still reporting my surface as
being in system memory (I AM logged in as root). Also, when I set
SDL_VIDEODRIVER to dga, the program is unable to initialize SDL. Is
there some way for me to ask the library exactly WHY it was unable to
initialize? Is there something obvious that I’m doing wrong? Or maybe
someone has some general tips to get this thing working.

I’ve never had a problem initializing DGA here, as long as I am running
as root and using XFree86 4.0. I’ll be happy to log into your system and
debug with you, just let me know when and where: @slouken

Make sure that your DISPLAY environment variable is set to “:0”

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Eric Wittmann wrote:

    Hi all.  I just started work on an SDL app, and am having some

problems. I’m trying to do something fairly simple - create a custom
mouse pointer. I am initializing SDL with all the right flags to do
double-buffering, fullscreen, and hardware surface. However, the frame
rates that I was seeing were awful - something on the order of 10fps. I
figured out that the surface I was getting didn’t support hardware
surfaces and reported my video memory at zero (I’ve got a 16MB riva
TNT). Well, my guess is that when the surfaces aren’t created in video
memory, then the SDL_Flip function is going to be very slow, since it
probably falls back on creating the back buffer in system memory, and
then copying the whole thing to video memory when the flip function is
called. This right? This would explain my horrible frame rates
(SDL_Flip alone takes about 50ms).

    After reading this newsgroup, I figured out that what I wanted was to

run it in DGA mode. I’ve got version 4.0.1 of X, and I’ve got it
running with the DGA extension turned on. The “dga” program works fine,
so I think that’s all set up okay. However, when I run my program, I
still see very bad frame rates, and it’s still reporting my surface as
being in system memory (I AM logged in as root). Also, when I set
SDL_VIDEODRIVER to dga, the program is unable to initialize SDL. Is
there some way for me to ask the library exactly WHY it was unable to
initialize? Is there something obvious that I’m doing wrong? Or maybe
someone has some general tips to get this thing working.

Thanks for any help,
Eric Wittmann

If you install the RPM’s of SDL and so on it does not support DGA.
You can rebuild the rpm from the source using:

./autogen.sh
./configure --prefix=/usr
su -c “make rpm”

Ray Kelm wrote:

If you install the RPM’s of SDL and so on it does not support DGA.
You can rebuild the rpm from the source using:

./autogen.sh
./configure --prefix=/usr
su -c “make rpm”

Yup...I think you're right about this.  I had apparantly installed an

RPM version of SDL a while ago, which was installed in /usr/lib.
However, when I recompiled it recently, it installed to /usr/local/lib.
I was doing everything right, but my program was using the wrong
library. Doh! Everything seems to work well now, and I’m getting more
on the order of 40+ fps instead of 9. :slight_smile: Much improved.

Eric

I’ve got to try that! Are you using XFree86 4.0? And if so how did you
install it? (RPM, debian package, source) I’ve been thinking about
trying XFree86 4, but the warnings on the debian packages scared me
away. Thanks.

Sorry, if this is too far off-topic. Reply to me off list if you think
it is.

-ArthurFrom: ericw@mirrorworlds.com (Eric Wittmann)
Subject: [SDL] Re: Problem running in DGA mode
Date: Wed, 13 Sep 2000 10:07:44 -0400

Everything seems to work well now, and I’m getting more
on the order of 40+ fps instead of 9. :slight_smile: Much improved.

Eric

If you install the RPM’s of SDL and so on it does not support DGA.

This will change with the next release of SDL. :slight_smile:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software