Advertisement

[java] Java in Linux

Started by June 12, 2000 12:16 PM
2 comments, last by unixGuy 24 years, 6 months ago
What would be the best way to add a 3d environment to a game that runs on linux... And how would you be able to convert between Linux and windows... I have tried working on a game in Linux then uploading it, going to windows and working on it there, but it''s too tedious. unixGuy - Fighter for the a better OS
unixGuy - Fighter for the better OS
Well an OpenGL based game will get you far. In all reality you''ll want to probably deal with the hassles of creating a platform generic infrastructure that you can easily adapt to different target OS''s. You might want to consider doing that infrastructure in Java though, as Java does have the capability to interface with native code through the JNI (Sorry don''t have any links for the JNI, you might want to check out our FAQ here at the top of this section''s page and maybe Sun''s webpage www.java.sun.com for some further links. Concerning Linux getting up to pace with the rest of the platforms (e.g. Windows and Solaris) as far as Java is concerned there is a browser plugin scheduled for release this Fall, which might help you out. Maybe someone here can offer better information about the availability of a JIT (just in time) compiler than I can.

I know it might seem Java''s cross-platform nature would do well for your situation, but you''re basically going to be doing the same work using another language like C++ as you have to write platform-specific code (in your case Windows9x/2000/NT and Linux).


joeG
joeG
Advertisement
I''ve read post''s here and there of people working on java3D and Linux. Sun isn''t really porting it over, blackdown.org is.
http://www.blackdown.org/java-linux/jdk1.2-status/java-3d-status.html
Look here. This would be the best way since it would work on Irix,Linux,and of course Windows and with hardware acceleration.
*disagrees* Java 3D is too slow for anything that does rapid screen updates; on linux, thats even worse.

I''d say go with the basic glut toolkit and use opengl. If you do it right, your code will compile directly on VC++ and c++ on linux.

I''ve done it.

I admit, glut can be an irritation, since it doesn''t provide any basic image manipulation functions; but look at the Nehe tutorials here: they show how to use textures, and that does (if you can stand manipulating your images by hand)let you do that sort of thing.

Hrm...glut wasn''t designed to write big games in tho; its just a playing api to use for opengl apps (mainly just testing them). But, if you make a few concessions here and there, and manually handle buffers, you can do it.

Of course, you can use java; but its very slow. Try running the java 2D sample when you download it for linux. =( Bloody slow. My machine (Ok; sure, it''s only 300 Mhz, 64M ram) takes about 30 seconds for the "Java 2d". Words to come up. Very slow.

Apparently the java native language compilers fix this up (somehwat)... but =P you lose platform independence of binaries. Never played with them though, dunno.

This topic is closed to new replies.

Advertisement