LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   SDL and DGA video driver (https://www.linuxquestions.org/questions/programming-9/sdl-and-dga-video-driver-171374/)

Darktyco 04-17-2004 03:20 PM

SDL and DGA video driver
 
Hi, I am trying to use the DGA video driver with a SDL program I am writing. I'm trying to use DGA in order to speed things up. I've had very little success with this however.

First of all, on a computer running Mandrake 10, I simply get a "No available video device" error when attempting to set the video mode inside the program. However, the dga test program (/usr/X11R6/bin/dga) runs without complaining.

On a second computer running Slackware it gives me the same error unless I load the ATI 3d driver module, at which point it runs but there is a very strange flickering on any portion of the screen that I do not draw to before updating the screen.

Does anyone know how to get this DGA driver working correctly? Or does anyone know a forum that I may find more advice on? Thanks!

Darktyco 04-19-2004 11:20 AM

Hmmm, does anyone at least have any hints about enabling hardware acceleration in SDL?

gizmo_thunder 04-20-2004 08:43 AM

SDL_SetVideoMode( width, height, bps, SDL_FULLSCREEN | SDL_OPENGL | SDL_HWPALETTE |SDL_HWACCEL);

Darktyco 04-24-2004 07:36 PM

Thanks for the reply. The above video mode compiles and loads just fine, but whenever I try to draw to the screen at in the way I was I get a segmentation fault (whenever I attempt to fill in the in the surface with a pixel or perform a flip.) How am I supposed to draw to the screen w/ the above video mode?

Thanks again!

gizmo_thunder 04-25-2004 12:30 AM

If you want to draw on the surface with a pixel remove the SDL_OPENGL flag from
the above function call.

Darktyco 04-26-2004 12:15 AM

Thanks for your posts, but if you don't mind, I still have more questions. When I take out the SDL_OPENGL flag I can draw pixels again, but there is no speedup at all. Actually, when I check the flag with:

Code:

   
if(!(screen->flags & SDL_HWACCEL))
        fprintf(stderr, "No hardware acceleration\n");

the check always fails, which leads me to believe that I'm still not getting a hardware surface or any kind of acceleration (checking for SDL_HWSURFACE fails also.) So what else must I do to obtain a hardware surface? I'm sorry if answering these questions is a big drag. If there are any good sources of information (books, faqs, whatever) other than the stuff at the SDL website (which I've already thoroughly combed through) that might help, please give me the heads up. Thank you again! :)

HAL 0006 05-03-2004 05:44 PM

To use DGA as SDL Video driver, you have to set the environement variable SDL_VIDEODRIVER=dga. It works only in fullscreen, and if dga is properly configured. Some other video drivers are also available.

Check the SDL FAQ for more information.

Algot 04-06-2005 04:12 PM

Quote:

Originally posted by HAL 0006
To use DGA as SDL Video driver, you have to set the environement variable SDL_VIDEODRIVER=dga. It works only in fullscreen, and if dga is properly configured. Some other video drivers are also available.

Check the SDL FAQ for more information.

I get

Call to SDL_SetVideoMode() failed! - SDL_Error: OpenGL not available

if I set SDL_VIDEODRIVER=dga

Does this mean that dga is not properly configured? Or should I blame ATI (I use a radeon 9800 with fglrx 8.10.19)?


All times are GMT -5. The time now is 02:18 AM.