Recent

Author Topic: Port To linux  (Read 3057 times)

azrael11

  • New Member
  • *
  • Posts: 18
Port To linux
« on: January 07, 2013, 01:00:31 pm »
I have a game project almost complete with Lazarus.... in Win 32...
and i want to port it to linux... mint 32...

For setting the screen resolution in win32 port i use this function
Code: [Select]
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....

Thank you ...

gato2707

  • New Member
  • *
  • Posts: 42
Re: Port To linux
« Reply #1 on: January 08, 2013, 03:02:21 am »
Did you try change Form property WindowState to wsFullScreen?

azrael11

  • New Member
  • *
  • Posts: 18
Re: Port To linux
« Reply #2 on: January 08, 2013, 10:01:16 am »
Did you try change Form property WindowState to wsFullScreen?

The point is to control the resolution and the color bit of the current computer so i can change to feet in my program and when it finish go back with the previus resolution and bit color...

Thanks...

Zittergie

  • Full Member
  • ***
  • Posts: 112
    • XiX Music Player
Re: Port To linux
« Reply #3 on: January 17, 2013, 06:42:32 pm »
Until you find a solution, you can maybe use 'xrandr' command to get/set the resolution.
Be the difference that makes a difference

azrael11

  • New Member
  • *
  • Posts: 18
Re: Port To linux
« Reply #4 on: January 20, 2013, 12:14:10 pm »
Until you find a solution, you can maybe use 'xrandr' command to get/set the resolution.

This is great idea... i use it and have same great results...

But i am much happier if someone just get this in pure pascal....

Thank you for your help...

 

TinyPortal © 2005-2018