PDA

View Full Version : Port To linux...



azrael11
07-01-2013, 03:47 PM
hi... Happy new Year....
So finally after two year almost.. with so little time to code... i must say that game project is near to done... ;)

It is writing in Lazarus using GLScene... and the next step before to give it to all... is to porting to linux...
I have a problem...
The function i use in win32 mode to set the screen resolution is the code above...



procedure SetScreen(bpp: byte; width, height, FR: integer);
var
D: TDevMode;
h: HWND;
begin
h := 0;
D.dmDeviceName[0] := 0;
D.dmBitsPerPel := BPP;
D.dmDisplayFrequency := FR;
D.dmPelsWidth := Width;
D.dmPelsHeight := Height;
D.dmFields := DM_BITSPERPEL + DM_PELSWIDTH + DM_PELSHEIGHT +
DM_DISPLAYFREQUENCY;
D.dmSize := SizeOf(D);
if ChangeDisplaySettings(D, CDS_TEST) =
DISP_CHANGE_SUCCESSFUL then
ChangeDisplaySettings(D, CDS_UPDATEREGISTRY)
end;


But the TDevMode uses the Window unit that does't work in linux...
So how can i make that to work in X11.... or any other graph mode...

Thank you ... and keep pascaling...

paul_nicholls
07-01-2013, 08:21 PM
Not sure about that, but I ended up using SDL to do all the windowing stuff for me with my game so it could run under Linux (Ubuntu) as well as Windows.

azrael11
08-01-2013, 08:57 AM
Not sure about that, but I ended up using SDL to do all the windowing stuff for me with my game so it could run under Linux (Ubuntu) as well as Windows.

Thanks paul... i i'll want to find something similar with the code above...
SDL never try it...

paul_nicholls
08-01-2013, 11:26 AM
Thanks paul... i i'll want to find something similar with the code above...
SDL never try it...

Maybe this code will help, I found it when googling:
http://chelive.googlecode.com/svn-history/r16/trunk/Source/Core/CoreDisplay.pas

cheers,
Paul

azrael11
08-01-2013, 07:56 PM
Maybe this code will help, I found it when googling:
http://chelive.googlecode.com/svn-history/r16/trunk/Source/Core/CoreDisplay.pas

cheers,
Paul

Thank you very much my friend ... when i found some time i test it ... from the little look i take i think is what i need...
Thank you for your help....

Wonder from what project is this... ?

paul_nicholls
08-01-2013, 09:19 PM
I translated the text from the front page of the project and it seems to be some 3d game framework project...

Micronix-TRSI
09-01-2013, 01:25 AM
i found on an russian site some linux-ports ... 4 demos
http://rtbt.ru/index.php?board=3.0

GOOD YEAR

azrael11
09-01-2013, 09:58 AM
i found on an russian site some linux-ports ... 4 demos
http://rtbt.ru/index.php?board=3.0

GOOD YEAR

Thank you very much ... i'll check it...
Happy new year ...

Thanks...