Lightweight Java Game Library Alpha 0.4 Released

Yes, you heard it, lwjgl version 0.4 is released with the following changes (from the changelog):

Dynamic loading of OpenGL and OpenAL

  • It is now possible to use parts of lwjgl, without requiring the user to have
    OpenGL or OpenAL installed.

Caption bar in windowed mode:

  • When not running in fullscreen mode, the window displayed, will have a caption
    bar. This feature is work in progress, and will expand to better windowed support.

Bufixes:

  • Many bugfixes, most notably the failure to create and register a window

Linux support:

  • This release includes the first release for Linux.

NeHe tutorials:

  • Also available is many of NeHe’s OpenGL tutorials - located in the examples.jar

More tests

  • More tests added - check the org.lwjgl.test package

API Changes:

  • DisplayMode/Display.create changed a bit
  • ALUT is gone, now using WaveData class which loads via java.sound.sampled instead of native wav loader
  • Added some missing gl/glx/glu functions

(We consider the library to be essentially feature complete, so this might very well be the last alpha release before we head for a real lwjgl 1.0)

  • elias

work nicely on linux

tips : the examples request the 640x480 mode if you haven’t it in your XConfig, it will crash.

strange stuff : SPGL nvidia alloc in AGP doesn’t work (no Cas, it’s not my Bios config :P)

'sfunny, seems to work for me. How do you know it’s not working?

Cas :slight_smile:

wasn’t working on elias comp too,

but the strange is you placed error handling everywhere, but a putInt finish in a segfault.

like it’s allocating sucessfully, but not :slight_smile:

cat /proc/driver/nvidia/agp/card
Fast Writes: Supported
SBA: Not Supported
AGP Rates: 2x 1x
Registers: 0x1f000013:0x1f000102

cat /proc/driver/nvidia/agp/status
Status: Enabled
Driver: AGPGART
AGP Rate: 2x
Fast Writes: Disabled
SBA: Disabled

don’t bother too much with that, I’ll try to find by myself :slight_smile: I want to understand how it work.

ahhh… are you using Linux perchance?

Cas :slight_smile:

???

[quote]cat /proc/driver/nvidia/agp/card
[/quote]

[quote]segfault
[/quote]
isn’t enough to give away his OS? ::slight_smile:

thats too easy … :’(

Ah, well it doesn’t work on Linux. Behold:


            if (gl.NV_vertex_array_range || gl.NV_vertex_array_range2) {
                  agp = new MemoryBuffer(Sys.createDirectBuffer(GL.wglAllocateMemoryNV(length, 0, 0, 0.5f), length));
                  if (agp == null)
                        throw new OutOfMemoryError("Failed to reserve AGP ram.");
                  size = length;
                  System.out.println("Reserved " + length + " bytes of AGP RAM");
            }

It checks for NV_vertex_array_range, as it should, but doesn’t check for the existence of wglAllocateMemoryNV. This is a shortcoming of LWJGL I think because I’ve just realised there’s no way to easily check if that function is available. (In fact, it should segfault here as it’ll be calling a null function - unless Nvidia are doing something weird and providing a dummy even for Linux).

Anyone know how to get AGP ram under Linux/Nvidia combinations? (Or OSX for that matter?)

Cas :slight_smile:

Why don’t you check for the appropriate extension? Or is the extension the same on all OpenGL systems, so one needs to differentiate between wgl,glx and agl? On glx systems, it’s glXAllocateMemoryNV(…)

  • elias

I think that there should be glXAllocateMemoryNV() and glXFreeMemoryNV()…

Yes, unfortunately the extension is the same on all systems but the underlying windowing call differs. We need the glX code, whatever OSX uses, and a way to know which one to call which doesn’t rely on hacks and strings. Or maybe we abstract all of them down into the .dll and have one call. Which is my preferred option as there’s very little merit leaving this in Java, except for the fact that it’s a vendor-specific extension that we’re writing native code for which I’m not so happy about.

Cas :slight_smile:

I’d say one call - allocateMemoryNV(…) that is different on the dll level. That seems like the easiest way of doing it.

Unfortunately generalization won’t help much if you are going to support all of the three platforms. There is no NV_vertex_array_range on MacOS X but there we’ve got its brother - APPLE_vertex_array_range (yes, on GeForce)… So the game code will look like the following crap is placed everywhere across the drawing code:

if (isWin32 || isLinux)
… go with NV_vertex_array_range
else
… go with APPLE_vertex_array_range

:frowning:

Please provide wgl/glx/agl extensions for LWJGL in a way similar to regular OpenGL extensions so it will be possible to deal with them directly… :-/

arf they prolly tryed to mask ATI & Nvidia diffs ?

Personaly I don’t need the masking… there will be cases when similar extensions need different things. IMO it’s good to have wgl/glx/agl extension mechanism and platform detection methods (in the Sys class?) to get the best of each extension available.

Hurrah!

With release 0.4 my laptop is finally able to open a rendering window. I now have the raw power of an 8MB Savage/IX at my command. ;D

One small comment - as fundamental things like the constructor for GL and the way you obtain a DisplayMode have changed, most users’ first point of contact (the OpenGL skeleton code) is totally broken. :wink:

[quote]point of contact (the OpenGL skeleton code) is totally broken.
[/quote]
Yeah - it’s on the official todo list - in fact I think I will fix it tonight - unless Cas beats me to it hint

Someone’s updated it - cheers!