Bindenlicht - Java binding for Irrlicht
Making BindenLicht thread safe
I'm trying to make BindenLicht threadsafe.
I had an idea, as the JNI puts every call to native methode into a single class (the BindenLichtJNI class), i will see if my idea works:
The goal is to create a new class BindenLichtSyncJNI as this:
package Bindenlicht;
class BindenlichtSyncJNI {
private static Object sema= new Object();
public final static long new_IUnknown() {
synchronized(sema) {
return BindenlichtJNI.new_IUnknown();
}
}
.......
}
The idea is to synchonize every call to the native function whith a single semaphore. This make us sure that we wont call too native functions at once, and as a JNI function wont call any other JNI , there wont be starve problems.
Then, we replace every call to BindenLichtJNI method to BindenLichtSyncJNI in the other sources of BindenLicht.
I will first try this, then see if we could use more than one semaphore in order to make something less restrictive, ans allow to run several native methods than can run in the same time.
I will let you know when i have any result, let me know what you think of this apporach.
I had an idea, as the JNI puts every call to native methode into a single class (the BindenLichtJNI class), i will see if my idea works:
The goal is to create a new class BindenLichtSyncJNI as this:
package Bindenlicht;
class BindenlichtSyncJNI {
private static Object sema= new Object();
public final static long new_IUnknown() {
synchronized(sema) {
return BindenlichtJNI.new_IUnknown();
}
}
.......
}
The idea is to synchonize every call to the native function whith a single semaphore. This make us sure that we wont call too native functions at once, and as a JNI function wont call any other JNI , there wont be starve problems.
Then, we replace every call to BindenLichtJNI method to BindenLichtSyncJNI in the other sources of BindenLicht.
I will first try this, then see if we could use more than one semaphore in order to make something less restrictive, ans allow to run several native methods than can run in the same time.
I will let you know when i have any result, let me know what you think of this apporach.
Newbie Question
I'm very much a newbie in using irrlicht and bindenlicht, so some help is appreciated. I use Mandrake Linux. I've successfully installed irrlicht, was able to make the hello world example. I've also been able to compile the Bindenlicht *.java files. What now? How do I compile the cpp files for Bindenlicht, and what is the Java syntax to use for the Bindenlicht features?
compiling Bindenlicht
I've tried copying the cpp files for Bindenlicht to the include directory of Irrlicht, and then executing e.g.:
But it returns this error (it seems easy to solve, but I'm not good at c/c++):
Code: Select all
g++ *.cpp -I"/opt/jdk1.5.0/include/" -I"/opt/jdk1.5.0/include/linux/" -I"../include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib" -L"../lib/Linux" -lIrrlicht -lGL -lXxf86vm -lXext -lX11 -lz -ljpeg
Code: Select all
/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../../crt1.o(.text+0x18): In function `_start':
../sysdeps/i386/elf/start.S:98: undefined reference to `main'
collect2: ld returned 1 exit status
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
New Release
Sorry about my lack of activity on this forum, but Bindenlicht is back in full swing though, version 0.1.5 R2 is now out. The biggest changes being a linux build, and some documentation. In addition to that, there are the usual multitude of bug-fixes.
I have started work on the next version, and it's going very well. I have the special effects tutorial running perfectly, and I just finished the shader tutorial. You can actually write your shader callback in pure Java now, and it all works seemlessly, I'm hoping to be able to do the same for custom scene nodes. More on all that when it's released though.
In other news, a web-designer has now joined the project, so you can look forward to a proper website in future, should be a lot friendlier than the plain sourceforge page.
Thanks to everyone who tried bindenlicht out so far and sent me feedback, the response has been great. Unfortunately, the statistics on sourforge are not working anymore, so I can't tell if I am getting any downloads of the new version at all, an email or whatever just to say it worked, or that it broke your machine would be appreciated. I'm hoping the linux build works out, let me know if anyone manages to get it working.
I have started work on the next version, and it's going very well. I have the special effects tutorial running perfectly, and I just finished the shader tutorial. You can actually write your shader callback in pure Java now, and it all works seemlessly, I'm hoping to be able to do the same for custom scene nodes. More on all that when it's released though.
In other news, a web-designer has now joined the project, so you can look forward to a proper website in future, should be a lot friendlier than the plain sourceforge page.
Thanks to everyone who tried bindenlicht out so far and sent me feedback, the response has been great. Unfortunately, the statistics on sourforge are not working anymore, so I can't tell if I am getting any downloads of the new version at all, an email or whatever just to say it worked, or that it broke your machine would be appreciated. I'm hoping the linux build works out, let me know if anyone manages to get it working.
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
0.1.6 released
Bindenlicht version 0.1.6 is now out. It has added loads of features. It now uses a modified version of Irrlicht for better OpenGL/Linux support. Graphics on Linux are now on-par with Windows, which is great.
A major feature is the addition of shader support to Bindenlicht. You can now, use hardware shaders, and write the required callback in pure Java. Shaders are also working under Linux, which I'm very happy about.
Aside from that, there are the usual improvements on the API, getting rid of those pesky SWIGTYPE's. A big thankyou to all those who have been using it and helping out through bug reports and suggestions for improvement.
A major feature is the addition of shader support to Bindenlicht. You can now, use hardware shaders, and write the required callback in pure Java. Shaders are also working under Linux, which I'm very happy about.
Aside from that, there are the usual improvements on the API, getting rid of those pesky SWIGTYPE's. A big thankyou to all those who have been using it and helping out through bug reports and suggestions for improvement.
-
- Posts: 164
- Joined: Wed May 05, 2004 5:34 pm
- Location: Germany Berlin
- Contact:
i am using bindenlicht 2 .
it is very useful for my schoolprojekt 2
my teacher is interestet in bindenlicht 2
hehe!
the new release 0.1.6 .. has done a big step forward!
i am very pleased that i can use bindenlicht .. i like it very much!
@William Finlayson : i am this guy in your forum ... you will see me more often in you forum .. keep that in mind when i am starting silly questions
it is very useful for my schoolprojekt 2
my teacher is interestet in bindenlicht 2
hehe!
the new release 0.1.6 .. has done a big step forward!
i am very pleased that i can use bindenlicht .. i like it very much!
@William Finlayson : i am this guy in your forum ... you will see me more often in you forum .. keep that in mind when i am starting silly questions
q|^.^|p beeing every time friendly to everyone
sys: 2500+Barton 512MB 6600GT WinXP
sys: 2500+Barton 512MB 6600GT WinXP
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
Hi,
I just downloaded Bindenlicht and ran the examples. It was cool!
But when I try to create an Eclipse project, I find that it doesn't find the Irrlicht.dll when it runs.
I have java -Dlibrary.path=C:\mypath
where mypath contains the Irrlicht.dll and bindenlicht.dll files.
It finds bindenlicht.dll OK, but then dies and complains it can't find Irrlicht.dll
Does anyone have any experience of this and could help me out?
Thanks.....
I just downloaded Bindenlicht and ran the examples. It was cool!
But when I try to create an Eclipse project, I find that it doesn't find the Irrlicht.dll when it runs.
I have java -Dlibrary.path=C:\mypath
where mypath contains the Irrlicht.dll and bindenlicht.dll files.
It finds bindenlicht.dll OK, but then dies and complains it can't find Irrlicht.dll
Does anyone have any experience of this and could help me out?
Thanks.....
-
- Posts: 61
- Joined: Mon Oct 25, 2004 12:11 am
The java library path is only used to find bindenlicht.dll, I think Irrlicht.dll has to be on your system path, or in the same directory as the java code is. I don't know under windows how to tell it to find a dll in a different location.
So you can either put Irrlicht.dll in the same directory as your code, add C:\mypath to the environmental variable PATH, or put Irrlicht.dll in windows/system32.
If you are launching your application from a .bat file, then you could do the following:
PATH=%PATH%;C:\mypath;
java -Dlibrary.path=C:\mypath
Hope this helps.
So you can either put Irrlicht.dll in the same directory as your code, add C:\mypath to the environmental variable PATH, or put Irrlicht.dll in windows/system32.
If you are launching your application from a .bat file, then you could do the following:
PATH=%PATH%;C:\mypath;
java -Dlibrary.path=C:\mypath
Hope this helps.
Apparently, posting a new thread doesnt spawn any response... atleast not in my case for some reaon... it only brings me silence... I am not sure how to interprete that.. anyway.... all good times 3.. I have yet another question... this is about bindenlicht and irrlicht, and when there is a thread about it, then why not grab the oppertunity. The question is very straightforward and it is :
How do I in java, by using bindenlicht and by making a terrain node,
use the getHeight method ????
It wont let me make a Vector2Df that is a required parameter...
please help me... I cant figure out what to do... this is supposed to be a forum where people help each other.... but please... correct me if Im wrong.
How do I in java, by using bindenlicht and by making a terrain node,
use the getHeight method ????
It wont let me make a Vector2Df that is a required parameter...
please help me... I cant figure out what to do... this is supposed to be a forum where people help each other.... but please... correct me if Im wrong.