Advertisement

Linux GameDe

Started by November 15, 2000 07:47 AM
10 comments, last by Spiral Guru 23 years, 10 months ago
Hey guys! I''m considering starting to port my work to Linux. I''m a DirectX and OpenGL programmer, and from what I can figure, it''ll be OpenGL I use (ofcoruse). Can anybody help me get a grip of what I''ve got to get a grip of to get going with Linux gamedev? I''ve always put my windows specific code behind interfaces, so I''m just looking to replace that...what do I need to learn? Can anybody recommend a good book? Do I need to port my OpenGL code, or will that go straight over..? Thanks! Spiral Guru
That should go straight over. You might want to look at the "green book" (Opengl for Xwindows or something like that) by Mark Kilgard. It provides a lot of good information. Also, pick up a reference manual for programming under X11 (To help with mouse/keyboard events etc...). Oreilly used to make some good ones but I''m not sure if they''re still in print.
Advertisement
I''m not an OpenGL programmer, so hopefully someone more qualified will be along shortly to confirm or deny what i say, but it sounds like you have a few options:



GLX, which i believe will help you do all the setup to get your old OpenGL code running under X... The counterpart is GLW on Windows.



SDL actually has facilities for OpenGL, and is a very nice thing to know. The upside to it is also that in the future, you can write with SDL the first time and porting is as simple as a recompile.



Xlib. Useful to know, but kinda overkill for the game programmer when the above are available. I''m sure someone will disagree with me on that, though.



-benc
There has to be a GLUT implementation for Linux...
GLUT works with windows too...

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Thanks guys!

I think the first thing for me to do is get some XWindows coding in first. That shouldn''t take me too long, I hope, surely no longer than Win32 took!

Then, going by what you''ve said, I''m going to look into this ''green book'', OpenGL for XWindows.

I''ll also be looking into those other options you pointed out, so thanks!

One more thing, what IDE do you guys code under on Linux??? Or, do you...use a text based one...!?! Arrrr! I have enough of that gnu stuff on the PS2...

Spiral Guru
I''ve done some porting for OpenGL apps to and from
Windows/Linux

If you are porting an OpenGL app from Windows to Linux then things only get easier.

What you''ll need to know are some Xlib specifics.

Most importantly how to fetch XEvents (aka Messages for you Windows coders). You''ll want to handle the KeyPress,
KeyRelease, Expose, and
VisibiltiyChange XEvents (amoung other things). ButtonPress
ButtonRelease and MotionNotify XEvents would be nice too.

If you read the glx intro manual, it shows you how to
set up a Window (XLib''s window object) for OpenGL operations.
glx is the glue between Xlib and OpenGL, just like glw is
with respect to Windows.

You''ll need to put your program into a main loop style
run level, WndProc() would be replaced with your main
event manager.

glut is not recommended for games, as it severly limits
things, but a good start if you want to get things ported
in a hurry for viability tests.

If you like DirectX and prefer wrappers you can take a look
at SDL, it''s portable to Windows and Linux but it''s rather
highlevel and may hinder performance a bit.
Tara Milana - WP Entertainmenthttp://wolfpack.twu.net/Comp graphics artist and programmer.
Advertisement
quote: Original post by Spiral Guru

One more thing, what IDE do you guys code under on Linux??? Or, do you...use a text based one...!?! Arrrr! I have enough of that gnu stuff on the PS2...

Spiral Guru


I''m going to install Linux in a near future so i looked for an IDE and i found that :

http://anjuta.sourceforge.net/

I haven''t tested it yet but the screenshot seems rather cool.

Hope it will help!

Thanks guys?

I take it glx is ''OpenGL for XWindows''?

OK. So, I need to go download glx, and with that I''ll get an intro manual to get me going with it (plus some XWindows basics).

I think I have KDE installed, that should be fine to use as far as I know...

I''ll get back here when I''ve had chance to try this stuff out!

Thanks for the help!

Spiral Guru
Guys!

I''ve just been snooping around at opengl.org and I came across this with repect to GLX:

"..[you] also need an OpenGL hardware accelerator driver.."
Well, OK, but the driver I have (for my VooDoo 2) is a Windows driver.

As I''m so new to Linux, could you let me know where I can get Linux drivers for my card?

Apparently, GLX is part of many Linux distributions...so how do I check I have it at home on my Red Hat setup?

Thanks!

Spiral Guru
Well, i personally use vim, and the GNU toolchain, but if you want an IDE, i hear good things about KDevelop, but i also like Code Crusader.



Oh, and of course, the old standby IDE, Emacs (or XEmacs). Yeah, i know what you're saying; "But Emacs is a text editor!," but with a little lisp and a little love, i hear this can be a damn good IDE (or operating system for that matter), though it's not for everyone.



-benc

Edited by - shelrem on November 16, 2000 1:23:10 PM

This topic is closed to new replies.

Advertisement