LWJGL for linux (first test)

A finally lost my patience waiting for LWJGL to linux and implemented something that could be the base for such a port.

You can find a tarball at

http://odense.kollegienet.dk/~naur/lwjgl13112002linux.tar.bz2

with a current CVS checkout modded with a linux/ directory under src/native. In that directory you’ll find the most basic files to get the test program running (the famous rotating square test ripped from the lwjgl skeleton code on their site with a small glitch fixed). The test program is in the src/java/ dir for your convenience. In the bin directory you will find a precompiled liblwjgl.so if you only want to see lwjgl in action on linux.

On my redhat 8 system cd’ing to the src/native/linux and typing make is enough to compile the library, in which case you only need to copy bin/liblwjgl.so to the java ext dir (i.e. /usr/java/j2sdk1.4.1_01/jre/lib/i386) and compile/run the test program.

Fullscreen mode switching and windowed mode gl works, but everything else doesn’t :slight_smile: That includes the Sys timer, Math ops, GL extentions and all input. So it definately lacks some work but the basic is there to build upon.

Give it a whirl and tell me what you think.

And an added note: Currently no input is possible so the lib never gets a chance to clean up and switch the mode back to the original, but once input is in place it should clean up correctly, and you will no longer be able to move the cursor out of the window and thereby panning the display on the virtual desktop.

  • elias

!!!
How cool is that?
Do you want me to put you on the sourceforge team Elias? We’ve been looking for a Linux developer to do the port.

Cas :slight_smile:

Well, yes but currently I can’t guarantee neither time nor a completed port (I have never ever touched the inner workings of X and GLX before yesterday and my primary selfish motive for porting is to use it in a project I have that uses GL4Java). But if you do add me I’ll see what I can get up and running. We all know that time is important when it comes to java gaming :wink:

This whole fullscreen thing reminds me of the buildin java 1.4 fullscreen on linux discussion. Now that I have seen what it requires to switch to fullscreen, I’m wondering what stopped the Sun developers? Yes, the XF86VidMode is an extention, but is in any case better to use when available than always just returning false in getFullscreenSupported().

Anyone?

It’s really more to do with retrofitting the rest of the AWT in with the situation as well… for LWJGL we can get away with it because all we want to do is draw GL stuff on a blank screen. Otherwise there’s no excuse :stuck_out_tongue:

In any case, I suspect that using SDL to implement nearly all the functionality is what you want to be doing. Shouldn’t take long I think.

Have you got a sourceforge userID?

Cas :slight_smile:

:o
This is just sooo great!

Don’t worry about time - we’re all somewhat busy and it isn’t like we work 10 hours a day on it - just now and then…

pending your username and stuff - welcome aboard :slight_smile:

ohh and one last thing:
Rart at have en dansker mere med i gruppen :wink:

username: elias_naur

Anything else? I have never worked with a sourceforge project before, but I do know some cvs.

SDL? And here I have sweated to make it work with native Xlib coding … tsk tsk. Well it’ll have to stay that way until something really annoying with Xlib shows up. In any case it keeps the dependencies down to a minimum. I’m working on input right now (ever paniced when you manage to grab the keyboard but the window system won’t let it go?).

Unless of course someone has a good reason to use SDL instead.

  • elias

The only good reason to use SDL is that they’ve solved a whole bunch of problems already, for a lot of different platforms. I’d even go so far to say that it might even be a good idea to port the Windows implementation over to use SDL instead of DirectX but there’s no urgent need to throw it all away just yet…

I’ve added you to the project as a developer. Stick your linux code in a /linux directory next to /win32. Any completely cross-platform native code just lives in /common.

Cas :slight_smile:

hmm, it seems that I don’t have cvs add rights on the repository (or else I’m doing something wrong). I could cvs add the linux dir, but not individual files in it.

Anyway, the tarball at

http://odense.kollegienet.dk/~naur/lwjgl13112002linux.tar.bz2

has been updated, so keyboard and mouse input works like the win32 version. The testprogram Game.java (currently in src/native/linux) can detect mouseclicks and movement and properly quit with esc now. Finallly, you can’t leave the window in fullscreen mode anymore.

  • elias

Great work !
You’re on a good way ! ;D

Ok an update for those interested:

  1. All of OpenGL + extensions should work now (BaseGL, Display, CoreGL, Gl, GLU).
  2. Input from Mouse and Keyboard works, including scroll wheel and proper cursor blanking (Mouse, Keyboard). I don’t have a joystick or a gamepad so I might need some help with those.
  3. The Sys functions are implemented (Sys), including timer and process priority methods.

… and all this on the current lwjgl CVS for you to enjoy!

  • elias

Can you build a release for Linux for us?

Cas :slight_smile: