While porting my SDL game to windows I’ve noticed that SDL’s directx
graphics support is awesome slow compared to the windlib driver. I ran a
small benchmark to verify my suspicion: I ran testwin.exe which comes
with the sdl package with different parameters (see below for the results).
The biggest problem is running directx fullscreen with doublebuffer
enabled. Windib is about 10x faster there! What’s the reason for this
odd behaviour? DirectX is somewhat unusable because of its speed right
now…
Here are the results with directx:-----------------------------------------------
testwin -speedy -hw -flip -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in video memory)
Double-buffering enabled
(image surface located in video memory)
Time: 1622 milliseconds
testwin -speedy -hw -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in video memory)
(image surface located in video memory)
Time: 73 milliseconds
testwin -speedy -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 498 milliseconds
testwin -speedy -flip -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in video memory)
Double-buffering enabled
(image surface located in video memory)
Time: 1605 milliseconds
testwin -speedy -hw -flip
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 156 milliseconds
testwin -speedy -hw
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 258 milliseconds
testwin -speedy -flip
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 252 milliseconds
testwin -speedy
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 251 milliseconds
and here with windlib:
testwin -speedy -hw -flip -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 158 milliseconds
testwin -speedy -hw -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 158 milliseconds
testwin -speedy -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 158 milliseconds
testwin -speedy -flip -fullscreen
Set fullscreen 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 160 milliseconds
testwin -speedy -hw -flip
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 139 milliseconds
testwin -speedy -hw
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 141 milliseconds
testwin -speedy -flip
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 148 milliseconds
testwin -speedy
Set 640x480x32 mode
(video surface located in system memory)
(image surface located in system memory)
Time: 143 milliseconds
Bye,
Michael Prager