LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-17-2004, 03:20 PM   #1
Darktyco
Member
 
Registered: Aug 2003
Location: michigan
Distribution: slackware
Posts: 59

Rep: Reputation: 15
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!
 
Old 04-19-2004, 11:20 AM   #2
Darktyco
Member
 
Registered: Aug 2003
Location: michigan
Distribution: slackware
Posts: 59

Original Poster
Rep: Reputation: 15
Hmmm, does anyone at least have any hints about enabling hardware acceleration in SDL?
 
Old 04-20-2004, 08:43 AM   #3
gizmo_thunder
Member
 
Registered: Apr 2004
Posts: 101

Rep: Reputation: 15
SDL_SetVideoMode( width, height, bps, SDL_FULLSCREEN | SDL_OPENGL | SDL_HWPALETTE |SDL_HWACCEL);
 
Old 04-24-2004, 07:36 PM   #4
Darktyco
Member
 
Registered: Aug 2003
Location: michigan
Distribution: slackware
Posts: 59

Original Poster
Rep: Reputation: 15
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!
 
Old 04-25-2004, 12:30 AM   #5
gizmo_thunder
Member
 
Registered: Apr 2004
Posts: 101

Rep: Reputation: 15
If you want to draw on the surface with a pixel remove the SDL_OPENGL flag from
the above function call.
 
Old 04-26-2004, 12:15 AM   #6
Darktyco
Member
 
Registered: Aug 2003
Location: michigan
Distribution: slackware
Posts: 59

Original Poster
Rep: Reputation: 15
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!
 
Old 05-03-2004, 05:44 PM   #7
HAL 0006
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
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.
 
Old 04-06-2005, 04:12 PM   #8
Algot
LQ Newbie
 
Registered: Aug 2004
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
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)?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Funny experience with mplayer and dga driver J_Szucs Linux - Software 0 07-28-2004 02:15 AM
Video Driver Poblems with Red Hat 8.0 (trident video driver) AstroJim Linux - Newbie 1 05-20-2004 03:25 PM
HELP! Couldn't initialize SDL: No available video device orktes Linux - Software 6 03-24-2004 02:04 PM
SDL: Could not initialize video zot Linux - Hardware 0 06-24-2003 09:05 AM
SDL Video Modes to string array verigoth Programming 4 05-24-2002 03:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration