Stoney
02-05-2006, 10:16 AM
Hi, it's me again, I'm now using Linux Ubuntu 5.10 (http://www.ubuntu.com). My goal is to have my SDL-based engine at nearly the speed as in Windows (well, 30 FPS are the minimum; the basic examples of my engine ran at over 120 FPS on my machine).
My computer:
- 1000 MHz
- 128 MB RAM
- NVidia GeForce 2 GTS (32 MB)
I've installed the nvidia-glx-legacy driver from the Ubuntu repository and it seems to work: I get a NVidia-logo at startup and the glxgears application is working at over 1200 FPS. This Frozen-Bubble game (from KDE) is also running at high speed.
But the compiled examples from my engine only show 8 to 13 FPS. I compiled it with Kylix 3 Open Edition and emulated a few examples with WINE 0.9.12. Both resulted in these low FPS.
Logger says:
*** ERROR *** : @ 12:04:58 MSG : Initialization IN : No video modes available!
STATUS INFO : @ 12:04:58 MSG : Information IN : Video memory: 0 KB
STATUS INFO : @ 12:04:58 MSG : Information IN : Device: Software
My code:
[...]
if SDL_Init(SDL_INIT_VIDEO) <> 0 then
begin
if Log <> nil then LogError('Initialization', 'Could not initialize SDL: ' + SDL_GetError);
Finalize;
end;
If Log <> Nil Then
Begin
Modes := SDL_ListModes(nil, SDL_FULLSCREEN or SDL_HWSURFACE or SDL_SWSURFACE or SDL_ANYFORMAT);
If Modes = PPSDL_Rect(0) Then
Begin
LogError('Initialization', 'No video modes available!');
End Else
Begin
{TMP_X := @Modes;
for i := 0 to Modes[i] - 1 do LogStatus( Format( ' %d x %d', [ Modes[i].w, Modes[i].h ] ) ); } //This is commented, because it hadn't worked
End;
End;
if VideoInfo = nil then
begin
if Log <> nil then LogError('Initialization', 'Could not collect system info -> Application terminated. Error: ' + SDL_GetError);
Finalize;
end;
if VideoInfo.hw_available <> 0 then FFlags := FFlags or SDL_HWSURFACE
else FFlags := FFlags or SDL_SWSURFACE;
if Log <> nil then LogStatus('Information', 'Video memory: '+IntToStr(VideoInfo.video_mem)+ ' KB');
if VideoInfo.blit_hw <> 0 then
begin
FFlags := FFlags or SDL_HWACCEL;
if Log <> nil then LogStatus('Information', 'Device: Hardware accelerated');
end else
begin
if Log <> nil then LogStatus('Information', 'Device: Software');
end;
[...]
Is there a special way of getting SDL working with some more FPS? Or have I made something wrong?
My computer:
- 1000 MHz
- 128 MB RAM
- NVidia GeForce 2 GTS (32 MB)
I've installed the nvidia-glx-legacy driver from the Ubuntu repository and it seems to work: I get a NVidia-logo at startup and the glxgears application is working at over 1200 FPS. This Frozen-Bubble game (from KDE) is also running at high speed.
But the compiled examples from my engine only show 8 to 13 FPS. I compiled it with Kylix 3 Open Edition and emulated a few examples with WINE 0.9.12. Both resulted in these low FPS.
Logger says:
*** ERROR *** : @ 12:04:58 MSG : Initialization IN : No video modes available!
STATUS INFO : @ 12:04:58 MSG : Information IN : Video memory: 0 KB
STATUS INFO : @ 12:04:58 MSG : Information IN : Device: Software
My code:
[...]
if SDL_Init(SDL_INIT_VIDEO) <> 0 then
begin
if Log <> nil then LogError('Initialization', 'Could not initialize SDL: ' + SDL_GetError);
Finalize;
end;
If Log <> Nil Then
Begin
Modes := SDL_ListModes(nil, SDL_FULLSCREEN or SDL_HWSURFACE or SDL_SWSURFACE or SDL_ANYFORMAT);
If Modes = PPSDL_Rect(0) Then
Begin
LogError('Initialization', 'No video modes available!');
End Else
Begin
{TMP_X := @Modes;
for i := 0 to Modes[i] - 1 do LogStatus( Format( ' %d x %d', [ Modes[i].w, Modes[i].h ] ) ); } //This is commented, because it hadn't worked
End;
End;
if VideoInfo = nil then
begin
if Log <> nil then LogError('Initialization', 'Could not collect system info -> Application terminated. Error: ' + SDL_GetError);
Finalize;
end;
if VideoInfo.hw_available <> 0 then FFlags := FFlags or SDL_HWSURFACE
else FFlags := FFlags or SDL_SWSURFACE;
if Log <> nil then LogStatus('Information', 'Video memory: '+IntToStr(VideoInfo.video_mem)+ ' KB');
if VideoInfo.blit_hw <> 0 then
begin
FFlags := FFlags or SDL_HWACCEL;
if Log <> nil then LogStatus('Information', 'Device: Hardware accelerated');
end else
begin
if Log <> nil then LogStatus('Information', 'Device: Software');
end;
[...]
Is there a special way of getting SDL working with some more FPS? Or have I made something wrong?