How to get double buffering under Linux?

Hi!

I cannot get double buffering under Linux. It doesn’t work under dga or svgalib
(fbcon not tested). This question may not be SDL specific, but maybe someone
here has the answer.

Looking at the sources of SDL’s dga driver, I found the line

if ( mode->mode.imageHeight >= (current->h*2) )

where mode->mode is a XDGAMode structure. This test obviously fails. Where does
DGA get the value of imageHeight from? Do I have to setup specific DGA modes in
XF86Config? I’m running XFree86 4.0.1g, with a virtual size of 1280x1024. The
display I want to be double buffered is 640x480. Everything else works fine, I
get a hwsurface and my game run much faster, but flickering is unacceptable.

Any ideas?–
Benjamin Niemann (Pink)
pink at odahoda.de
http://www.odahoda.de

Hi!

I cannot get double buffering under Linux. It doesn’t work under dga or svgalib
(fbcon not tested). This question may not be SDL specific, but maybe someone
here has the answer.

Try fbcon.

Looking at the sources of SDL’s dga driver, I found the line

if ( mode->mode.imageHeight >= (current->h*2) )

where mode->mode is a XDGAMode structure. This test obviously fails. Where does
DGA get the value of imageHeight from?

It gets the value from the X server. Although from the mode that you have,
there should be plenty of video memory available for double-buffered 640x480.
What are the values in the mode->mode structure?

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

Hi!

Looking at the sources of SDL’s dga driver, I found the line

if ( mode->mode.imageHeight >= (current->h*2) )

where mode->mode is a XDGAMode structure. This test obviously fails. Where does
DGA get the value of imageHeight from?

It gets the value from the X server. Although from the mode that you have,
there should be plenty of video memory available for double-buffered 640x480.
What are the values in the mode->mode structure?

To avoid hacking up the SDL code, I wrote a small proggy spitting out the
results of XDGAQueryModes(). This is the output:

Mode: 1280x1024 (1280x1024) at 16 bpp (60.019001 refresh, 2560 pitch) num: 1
Imagesize: 1280x1024
RGB: 0x0000f800 0x000007e0 0x0000001f (4 - truecolor)
Flags: XDGAConcurrentAccess XDGAPixmap XDGAFlipRetrace
Mode: 1024x768 (1024x768) at 16 bpp (84.996002 refresh, 2560 pitch) num: 2
Imagesize: 1280x768
RGB: 0x0000f800 0x000007e0 0x0000001f (4 - truecolor)
Flags: XDGAConcurrentAccess XDGAPixmap XDGAFlipRetrace
Mode: 800x600 (800x600) at 16 bpp (85.136002 refresh, 2560 pitch) num: 3
Imagesize: 1280x600
RGB: 0x0000f800 0x000007e0 0x0000001f (4 - truecolor)
Flags: XDGAConcurrentAccess XDGAPixmap XDGAFlipRetrace
Mode: 640x480 (640x480) at 16 bpp (85.008003 refresh, 2560 pitch) num: 4
Imagesize: 1280x480
RGB: 0x0000f800 0x000007e0 0x0000001f (4 - truecolor)
Flags: XDGAConcurrentAccess XDGAPixmap XDGAFlipRetrace

If I understand the SDL code correctly, mode #4 is chosen for my 640x480
display. Obviously the imageHeight is too small for double buffering. Any
chance to for imageHeight to a larger value?