Page 1 of 1

Porting from Windows to Linux

Posted: Tue Dec 09, 2003 11:03 pm
by Johan_Haegg
When porting from windows to Linux (never written any program in Linux), what can i exchange these commands with:
GetTickCount_()
GetForeGroundWindow_()

Should do about the same thing...

Posted: Wed Dec 10, 2003 2:48 am
by Akuma no Houkon
There are many you can, it depends on what you are using. Are you using KDE, Gnome, etc..., something compatible with all, etc... Try searching for XWindows API Libraries, those are compatible with all windows managers. I havent found exact replacements for either of those but they do exist within X11 (XWindows) API. Probably not built into PureBasic like most windows API are so you will have to LoadLibrary and CallFunction to use them.

Posted: Thu Dec 18, 2003 12:14 am
by Johan_Haegg
Ill try that, as long as they do the same thing i dont have to rewrite loads and loads of code :>

Posted: Thu Dec 18, 2003 12:54 am
by Shannara
I thought there is a compiler definition switch that can be use in the code, so you can keep the same code base but add in alot of #IF/#THEN switches to check what OS it is running on, and execute code based on the OS.

Am I wrong? Maybe Im thinking of another language.

Posted: Thu Dec 18, 2003 1:34 am
by Paul
Fred mentioned that next version of PB Linux will have ElapsedMilliseconds() command which is equivalent to Windows GetTickCount_()