Why directx is more lower than windib?

Hi everyone,
I am new to SDL.
I had compiled the example “testsprint”, and tested it on my
computer( Windows XP )
But I found that
at windows mode , the fps of windib is 20 times more than directx,
and with -fast(fullscreen) param, the fps of directx is still at 60,
but the fps of windib can come 200,
So, who can tell me why this happen and why there are so many pepole
say directx is faster than windib?
The below is the list of results.

testsprint -width 800 -height 600 -bpp 32 -hw -flip 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE
acceleration
205.80 frames per second

testsprint -width 800 -height 600 -bpp 32 -hw -flip -directx 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE
acceleration
10.83 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE
acceleration
195.55 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast -directx 1000
Screen is at 32 bits per pixel
Screen is in video memory
Screen has double-buffering enabled
Sprite is in video memory
Sprite blit uses hardware acceleration
59.61 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast -directx 1000
Screen is at 32 bits per pixel

Screen is in video memory
Screen has double-buffering enabled
Sprite is in video memory
Sprite blit uses hardware acceleration
59.61 frames per second

As you can see from your tests the hardware acceleration of DirectX is used
only in this test, the other test that gave 10fps is using some strange slow
rendering path.

The 60fps limit of this case may be dued to the vertical blank sync, check
if your screen mode is refreshed at 60hz, and/or try to disable the sync in
the GFX card drivers to see if directx can perform more than software mode,
and it should be able to do so at least on XP.On Thu, Oct 9, 2008 at 2:50 PM, Guo Xu wrote:


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)

Hi Gabriele
Thank you for you reply
I cannot find the option of vertical blank sync on my “NVIDIA Control
Panel” 1.5.30.22, may be I should install a newer driver.
BTW, now a lot of large games, like WOW, both have the windows mode and
fullscreen mode,
And they also use DirectX for rendering, but their render speed in
windows mode is not slower than fullscreen mode ,why?

2008/10/9 Gabriele Greco <gabriele.greco at darts.it>>

On Thu, Oct 9, 2008 at 2:50 PM, Guo Xu <@Guo_Xu> wrote:

testsprint -width 800 -height 600 -bpp 32 -fast -directx 1000
Screen is at 32 bits per pixel

Screen is in video memory
Screen has double-buffering enabled
Sprite is in video memory
Sprite blit uses hardware acceleration
59.61 frames per second

As you can see from your tests the hardware acceleration of DirectX is used
only in this test, the other test that gave 10fps is using some strange slow
rendering path.

The 60fps limit of this case may be dued to the vertical blank sync, check
if your screen mode is refreshed at 60hz, and/or try to disable the sync in
the GFX card drivers to see if directx can perform more than software mode,
and it should be able to do so at least on XP.


Ing. Gabriele Greco, DARTS Engineering
Tel: +39-0105761240 Fax: +39-0105760224
s-mail: Via G.T. Invrea 14 - 16129 GENOVA (ITALY)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi Gabriele
Thank you for you reply
I cannot find the option of vertical blank sync on my “NVIDIA Control
Panel” 1.5.30.22, may be I should install a newer driver.
BTW, now a lot of large games, like WOW, both have the windows mode and
fullscreen mode,
And they also use DirectX for rendering, but their render speed in
windows mode is not slower than fullscreen mode ,why?

Those are 3d games, you can make fast 3d openGL games, fast both windowed &
fullscreen with SDL, but that’s a total different story since you could not
use SDL_BlitSurface, SDL_FillRect and so on in GL mode.

2d acceleration of SDL at the moment is not very used nor supported, it
works only on Win32 and in fullscreen mode, it uses ancient DX5 API, so in
the latest version it’s disabled by default.

Most 2d games works well on modern computer doing everything in software and
then doing the final blit to videoram, with SDL this is the ONLY way to go
if you want to use also alpha channel surfaces.

This will change with SDL 1.3/2.0 that will provide a backend for
opengl/directx accelerated 2d gfx, if you feel confortable with SDL 2d API
just stick with it and use software mode (IE open the window with something
similar to SDL_SetVideoMode(w, h, 0, SDL_SWSURFACE)) if your game is too
slow (I doubt it will) you can always try to use SDL 1.3 snapshots or the
glSDL extension you can find here http://olofson.net/mixed.html.

2d acceleration provided by a 3d backend like the SDL 1.3 one or glSDL have
also the big advantage that works also on Linux and Mac.On Thu, Oct 9, 2008 at 3:23 PM, Guo Xu wrote:


Bye,
Gabry

The screen is redrawn at 60 fps on the hardware (i.e. actually only 60
frames are sent to the physical display) so there is no actual
difference between 60fps and 200fps. You should try to time the
rendering and SwapBuffers() calls separately because SwapBuffers()
waits for the next actual frame to be sent to the hardware. And, vsync
is switched off not in

Thank you Gabriele and Alexander? I will post the result after I do a new
test.

2008/10/10 Alexander Shpilkin > The screen is redrawn at 60 fps on the hardware (i.e. actually only 60

frames are sent to the physical display) so there is no actual
difference between 60fps and 200fps. You should try to time the
rendering and SwapBuffers() calls separately because SwapBuffers()
waits for the next actual frame to be sent to the hardware. And, vsync
is switched off not in


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi Gabriele, Alexander
I Installed a new nvidia driver, it can close the vertical blank sync.
And I use glSDL extension did a newer test,
here is the result:

testsprint -width 800 -height 600 -bpp 32 -hw -flip 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE acceleration
217.93 frames per second

testsprint -width 800 -height 600 -bpp 32 -hw -flip -directx 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE acceleration
68.63 frames per second

testsprint -width 800 -height 600 -bpp 32 -hw -flip -gl 1000
Screen is at 24 bits per pixel
Screen is in system memory
Sprite is in system memory
1246.23 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast 1000
Screen is at 32 bits per pixel
Screen is in system memory
Sprite is in system memory
Sprite blit uses RLE acceleration
212.30 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast -directx 1000
Screen is at 32 bits per pixel
Screen is in video memory
Screen has double-buffering enabled
Sprite is in video memory
Sprite blit uses hardware acceleration
151.63 frames per second

testsprint -width 800 -height 600 -bpp 32 -fast -gl 1000
Screen is at 24 bits per pixel
Screen is in system memory
Sprite is in system memory
1247.44 frames per second

As Gabriele said, the opengl rendering is much more faster.
And I will try to separate the rendering and swapbuffer later, it will be
looked better.
Thanks a lot for your advice.

2008/10/10 Guo Xu <@Guo_Xu>> Thank you Gabriele and Alexander? I will post the result after I do a new

test.

2008/10/10 Alexander Shpilkin

The screen is redrawn at 60 fps on the hardware (i.e. actually only 60

frames are sent to the physical display) so there is no actual
difference between 60fps and 200fps. You should try to time the
rendering and SwapBuffers() calls separately because SwapBuffers()
waits for the next actual frame to be sent to the hardware. And, vsync
is switched off not in


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

But I found that
at windows mode , the fps of windib is 20 times more than directx,

For some to me unknown reason the hardware acceleration is
disabled for windowed mode when using the directx interface.
The commit message is very unspecific about why this was removed,
and I’ve not yet experienced any trouble when re-enabling hw
acceleration for windowed mode.