CounterSheep - The product of 48 hours of insanity

Orangy did some windows’ism - the demo loads some files that cannot be found on linux because of upper/lower case inconsistencies.

And I’m responsible of a glitch in the fullscreen code. It showed up when a program takes a little time to load - the player was able to scroll the viewport at load time. It’s fixed in CVS.

But apart from that, it runs perfectly on linux! At least on my machine that is…

  • elias

Oh, one thing though - it does not seem that the demo shuts down properly (i.e. noone called Display.destroy). Is that correct? If it does destroy its resources, please notify me and I’ll fix it right away in the linux code.

  • elias

I have written applications that use java and some parts of the app are platform dependent making the whole thing platform dependent. When the thing was written, it was platform dependent - meaning it would only run on windows. I don’t know too much about the library that its calling, but this is what causes the OS dependency. I see now that its for linux - I’ll try it out later on - I have some test to study for before that.

So is this library for all platforms that have a java3d jvm - irix, hp, sun, ect?

ALso, why use that library? What advantages does it have over standard j3d?

Is the thing specialized OpenGL code - can it do Invidia’s CG? or programable pixil shaders?

Thanks

Aha, and heres the nub of the matter: its not based on j3d at all, but basically done in openGL via the LWJGL bindings. Hence, stencil buffers, vertex and pixel shaders are possible, hardware permitting :slight_smile: Gems for example uses the stencil buffer for properly clipped reflections.

I’m usually careful with filenames/upper/lower case, but what with the time limit and all, I’ve probably missed a few. I’ll look into that and the display.destroy code as well hopefully tonight…

Hello,
Could someone point me to more information on the LWJGL? I am guessing this must use some jni some how ???

If thats the case, then would it be possible to write your own Nvidia CG code and use JNI to interact with it?

Regards

LWJGL enables you to do whatever OpenGL calls you want, including pixel shaders, vertex shaders and what else turns you on.

http://java-game-lib.sourceforge.net for more information.

  • elias

After reading their notes on their sourceforge page, I’m not too sure if this is a java3D topic anymore. I get the feeling they are trying to replace Java3D with their own gaming library. In fact, they report that you do not need any jre to run their stuff - which means you could do a game all in their library w/out any native java.

They (the programmers of lwjgl) have focused their attention to Windows. They noted that they will be attempting linux and Mac later on; however, its primary function is windows.

Also - it looks like they are using JNI or their own equivalent implementation of JNI to access OpenGL (AL) calls to get the hardware functionality they desire.

I think I can accomplish the same thing using JNI and not having to mess with their stuff. Does anyone know how feasible this is?

Is this the right place to talk about this? I have looked for lwjgl other places on this page but was unable to find anything about it.

Can you call your program a Java program and use lwjgl? What is a Java program - aka. 90% of code is written in java? or 90% of the program is running java code? or both?

[quote]In fact, they report that you do not need any jre to run their stuff
[/quote]
Yep, this statement was more or less meant to say that it is possible to natively compile yor program (i.e. Excelsior Jet). In theory you should also be able to use gcj, though none of us has tried… afaik

[quote]I think I can accomplish the same thing using JNI and not having to mess with their stuff.
[/quote]
Sure you can, but why would you?? We have done all the hard work for ýou - using exactly JNI …

[quote]Does anyone know how feasible this is?
[/quote]
I really don’t see any reason for rolling your own…
lwjgl is free, it works on windows and linux, and once 1.4 is available on the mac, I am fairly certain it will get ported quickly…
That said, you’re more than welcome to extend lwjgl in any direction you see fit … in fact that is what we’re hoping that people will do (and in the spirit of lwjgl, hopefully keep the extension free too).

[quote]Is this the right place to talk about this? I have looked for lwjgl other places on this page but was unable to find anything about it.
[/quote]
Well I don’t know about this thread particularly - but this site/forum is indeed a good place to talk about lwjgl, even though the official site is more “correct” (but way more people use this board…)

[quote]Can you call your program a Java program and use lwjgl?
[/quote]
Sure - though I don’t think that you should ever begin to argue a programs superiorness based on the language it was developed in…

[quote]After reading their notes on their sourceforge page, I’m not too sure if this is a java3D topic anymore. I get the feeling they are trying to replace Java3D with their own gaming library.
[/quote]
Yep, this is nothing to do with Java3D. Note that Java3D is not a gaming library. You can use it to write games, sure, but it’s designed to be a general 3D visualisation/render system. LWJGL is developed from the ground up to be a gaming library.

[quote]In fact, they report that you do not need any jre to run their stuff - which means you could do a game all in their library w/out any native java.
[/quote]
No, it’s not that you can use their library without writing any Java, it’s that they (a) don’t depend on any particular manufacturer’s JRE, and (b) as they don’t use AWT/Swing/whatever you should be able to compile your Java to a binary with Jet or GCJ for example.

[quote]They (the programmers of lwjgl) have focused their attention to Windows. They noted that they will be attempting linux and Mac later on; however, its primary function is windows.
[/quote]
Careful… the guy you replied to is the official LWJGL Linux programmer. ;D ;D ;D

[quote]Can you call your program a Java program and use lwjgl? What is a Java program - aka. 90% of code is written in java? or 90% of the program is running java code? or both?
[/quote]
Hrm, philosophical question ahoy… :wink:

The Sun JVM accesses native code in java.io. But maybe they’re allowed to because they’re Sun? :-/ I can write a library in 100% Java, someone else can use it and you’d be hard pressed to call their application anything but a Java program. Is it any different just because it uses JNI (which is itself part of the Java platform)?

Just consider it a 3rd party Java library that happens to use JNI. It may help to consider that if Sun hadn’t produced Java3D, they’d probably have written an OpenGL binding themselves. Also, this may eventually make it into the core platform. Who knows?

As for using nVidia’s Cg - of course you can! Check out the GL_ARB_vertex_program extension.

Personally I’m very enthusiastic about LWJGL. I love Java, and I love OpenGL.

It works!!! (I didn’t install LWJGL first time)

I like it. Fun to jsut run around.

Matzon - I have looked at using lwjgl with gcj but the lack of nio bytebuffers in libjava brought it to a crashing halt.

Should be possible when they sort this out though.

same for me, but apparently nio are nearly completed, perhaps it’s possible with a CVS version of gcj