PDA

View Full Version : Full screen speed problems???



jdarling
28-09-2006, 09:00 PM
I have uploaded a test project to my site that shows better then I can explain (http://www.eonclash.com/JumpStart/FPC/SpeedTest.zip). Basically when in windowed mode everything is ok (well the speeds are around 60-70 FPS on my system). When switched to full screen (ALT+ENTER) the FPS drops to about 2. The ONLY thing that this app is doing is drawing a single image onto the screen. No transparency, scaling at full screen is all. Any ideas on how to make it faster w/o going to GL+SDL (I know that that will speed things up).

grudzio
29-09-2006, 01:40 AM
I've got 220 fps in windowed mode and 70 fps in fullscreen. Strangely on Linux I've got 220 fps both in windowed and fullscreen mode. What is more strange, on winXP, when I changed the wideo driver with the code below

FullScreen := false;
SDL_putenv('SDL_VIDEODRIVER=windib'); //added line
InitSDL;
GameRunning := true;

I've got 345 fps in windowed and 490 fps in fullscreen mode. This is pure magic for me because directx should be faster than the GDI driver and it is not. Anyway, it worked for me so maybe it will work for you. :D

Two last remarks:
I. My fps measurements are underestimated - I outputed the fps values to the file.
II. my specs:
processor AMD Sempron 2800
graphics card Geforce 6600 128 MB
RAM 768 MB
OS windows XP and Linux Mandriva 2006

savage
29-09-2006, 06:48 AM
I wonder if this is because Microsoft's backward compatability with DirectX 5 ( which is what I think SDL uses ) has been crippled.

grudzio
29-09-2006, 09:08 AM
I wonder if this is because Microsoft's backward compatability with DirectX 5 ( which is what I think SDL uses ) has been crippled.
Probably. One more reason for using OpenGL :wink:
Another interesting thing is that directx is hardware accelerated, GDI is not and it is faster. And there is no difference when using hadware and software surfaces.

jdarling
30-09-2006, 01:55 PM
I'm busy making a few changes to allow the selection of SDL Rendering Contexts. Its still odd that in DX full screen is WAY (as in <10%) slower then windowed mode. The change to DIB did speed things up across the board. In the actual application I'm now pulling 50 FPS in full screen and 49 in windowed mode.

Any idea of what all the options that can be passed are? I've been searching around, but the kids arn't giving me the time required to discover them all yet :). I think I'm going to build in a startup script that will let you setup all the different environment options if you so desire.

PS: When complete if I post up some source of a Lua and SDL test could someone try to cross compile it for Linux and see how it works. I would, but the HD in my old faithful Linux box finally shot craps :(.

EDIT: I almost forgot to say thanks greatly grudzio for the idea of forcing the render context. I just wish I knew why SDL didn't select the fastest context it could by default. Even if there is a way to select it from code that would be good :)

grudzio
30-09-2006, 10:36 PM
In my opinion the most usefull environment options are
SDL_VIDEODRIVER=driver name
SDL_AUDIODRIVER=driver name
SDL_VIDEO_CENTERED=
SDL_VIDEO_WINDOW_POS=x,y or center (where x and y are window coordinates - topleft I suppose)
Here
(http://www.libsdl.org/cgi/docwiki.cgi/Environment_20variables)you can find all other options. Note that on Windows SDL_putenv must be called before SDL_init

When complete if I post up some source of a Lua and SDL test could someone try to cross compile it for Linux and see how it works.

I can test it, no problem.


I just wish I knew why SDL didn't select the fastest context it could by default.
I think that it is impossible for SDL to detect the fastest driver. And by common sense directx should be faster.