Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
X GUI

Win32 to X11 Migration? 7

Hos writes "I had a good, original idea for a game that I wanted to write for X11. Unfortunately I know nothing about X programming, so I decided to write a prototype version using the Win32 API. Now that this works, I would like to port it to X11 and complete it. Can anyone recommend any good references for beginning X programming? I've seen the Xlib and Motif O'Reilly books at the book store. Should I get these? Are there any libraries I should avoid? Any good websites? " As near as I can understand it, moving between X and Win32 isn't exactly a direct affair. Would you all suggest this? Or would porting first to GTK for Win32 and then moving that code to the Unix make more sense?
This discussion has been archived. No new comments can be posted.

Win32 to X11 Migration?

Comments Filter:
  • Honestly I think you may be better off using Qt or Java or as someooone mentioned OpenGL. Here is why:

    Java is a fairly easy language to learn. I had a 3 week course and feel I know it about as well as C. There are many predefined methods in Java and it does lots of clean up for you, and allows you to concentrate on your programming more rather than malloc/free like C/C++. Java does threads better than C++ also, as threads are built in. Also if you stick with the JDK 1.2 you can write your code once and then run it anywhere.

    If you want more speed then there is Qt. Qt is a cross platform C++ programming API. I have not done any programming with it, but KDE is based on Qt so that right there shoudl tell you how powerful it is if you have ever used kde. While I am on the subject of kde, kde also have libs of its own that you can use to port programs to also. (kdelibs)

    Mesa/OpenGL. Be careful here as I am not sure but Mesa is not exactly the same as OpenGL, so if you use OpenGL you should be able to compile on Mesa, but you may have some debugging there.

    Gtk+ /Gtk-: You can use Gtk+ to program in C for Lilnux and other Unix flavors. I have use it and found it to be quite decent. There are a few things that it does need work on thou, in particular its text widget. It is easy to learn thou. There is also Gnome libs, which adds to Gtk.

  • Have a look at http://www.gtk.org/ halfway down the left side fo the page. They have some decent tutorials that taught me the basics in a matter of a few hours. May not get you porting info but it will get you familiar with one of the x toolkits.
  • Wine implements most of the Win32 API. Have you tried to compile your program under Linux with the Wine libs?
  • While others talk about Java, GTk, and Qt, why not try Tk (! Tcl)?

    Tk has been available for years on both UNIX and Windows, and it also has port/integration with several well-used scripting languages such as Tcl, Perl, and Python.

    I won't recommend Tcl as base language, but Tk with _other_ glue language is should be a good candidate for development.
  • Use OpenGL for the game itself. That's fully portable between Win32 and X11, as well as having many other advantages (speed, simplicity, flexibility, etc.) For the surrounding bits (if there are any) such as menus etc., either use glut [sgi.com] if your needs are relatively simple, or one of the newer toolkits like Gtk+ or Qt otherwise. Avoid Xlib/Xt/Motif like the plague. As you say, Gtk already has a Win32 version available, although it wasn't fully stable last time I looked at it. Qt also has a Win32 version, but you may need a $1500 development license (has this changed with the new license? I haven't checked). Qt also limits you to using C++.

    Oh yeah, don't be put off OpenGL if you're doing a 2D game -- although it excels at 3D, it's just as good in 2 dimensions, too!

Our OS who art in CPU, UNIX be thy name. Thy programs run, thy syscalls done, In kernel as it is in user!

Working...