How shuld i port my windows OpenGL Game to linux

hi,
i have programmed my game on Windows in c++, and now i want to port it to linux…
how shuld i do that? Whis x11?

plz help me!!

Krabb

PS: My english is so good :slight_smile:

You should port it “swiftly.”

Now seriously. Use X11 and learn how to program the
Xlib (do a google search). If you have done it for
windows, it should be simple to do it for Xlib.
Everything you need is there, and a lot of sample
code can be found in many places, including MESA3d’s
site (www.mesa3d.org). Look at the examples under
X11 and you will know what I mean.

If you need threads, use POSIX (pthreads) threads,
and if you need sound, use OSS (Open Sound System)
for which there is a ton of documentation online.
Good luck and make it fast, please!

thx for your help!!
now i will google a bit :slight_smile:

Up to now i dont need threds, but may bee later…
Which input libary would you recommend? I need mouse and keybord input.

thx for your answer in advance!

Krabb

i searched a bit and i think X11 is not the best for my Game. I need only one Window(in fullscreen modus, but i dont know if it is possible in Linux), where i could display OpenGL! I need no menues ore something like that. So i think there must be a easier way of doing this! Does anyone know a better way?

may bee i am wrong, because I seached only a short time…

thx for help,
Krabb

If your game is fullscreen, your best bet is to use SDL . That will take care of most of the platform dependencies (even for things like input and sound) for you. A lot of games, including UT2k4, use SDL to one degree or another.

that sounds better :smiley:
And i could use SDL on Windows too…
I think i´ll do it whis SDL, but if you have a better advice i´ll be happy too!

thx, Krabb

By all means, use SDL because it is great. But, you
will still need a display infrastructure, a way to
trap mouse events, etc. SDL will coordinate all of
this, but you still need to pick something for the
above. X11 will kill two birds with one shot; the
keyboard+mouse trapping, and the display issue. You
can make a window full-screen, you can change the
screen’s resolution with a simple function call, you
can trap events, you have OpenGL support, and you can
make the window borders disappear (giving the full
screen effect that you want). You cannot go wrong with
Xlib for linux and it is one touch more portable to
non Linux unixes.

You will need something more than SDL.

i only need the position of the mouse and the pressed keybord/mouse buttons, i think this is possible whis SDL. But the advantage of SDL is, that i could use it on Windows too…
And i want to have an game, which you can play on Windows and on Linux!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.