jirr and irredit
Posted: Thu Jun 28, 2007 6:53 pm
Does jirr load irredit stuff? I noticed there wasn't an example 15.
Official forum of the Irrlicht Engine
https://irrlicht.sourceforge.io/forum/
Code: Select all
// java port done by jirr
import net.sf.jirr.*;
import java.io.IOException;
/*
Since version 1.1, Irrlicht is able to save and load
the full scene graph into an .irr file, an xml based
format. There is an editor available to edit
those files, named irrEdit on http://www.ambiera.com/irredit,
which can also be used as world and particle editor.
This tutorial shows how to use .irr files.
Lets start: Create an Irrlicht device and setup the window.
*/
public class TestLoadIrrFile
{
// load the wrapper lib at startup
static
{
System.loadLibrary("irrlicht_wrap");
}
public static void main(String args[])
{
// ask user for driver
E_DRIVER_TYPE driverType = E_DRIVER_TYPE.EDT_OPENGL;
System.out.println("Please select the driver you want for this example:\n"
+ " (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"
+ " (d) Software Renderer\n (e) Burning's Software Renderer (f) NullDevice\n"
+ " (otherKey) exit\n\n");
try
{
int i = System.in.read();
switch (i)
{
case'a':
driverType = E_DRIVER_TYPE.EDT_DIRECT3D9;
break;
case'b':
driverType = E_DRIVER_TYPE.EDT_DIRECT3D8;
break;
case'c':
driverType = E_DRIVER_TYPE.EDT_OPENGL;
break;
case'd':
driverType = E_DRIVER_TYPE.EDT_SOFTWARE;
break;
case'e':
driverType = E_DRIVER_TYPE.EDT_BURNINGSVIDEO;
break;
case'f':
driverType = E_DRIVER_TYPE.EDT_NULL;
break;
default:
System.exit(0);
}
}
catch (IOException e)
{
e.printStackTrace();
}
// create device and exit if creation failed
IrrlichtDevice device = Jirr.createDevice(driverType, new dimension2di(640, 480));
if (device == null)
{
System.exit(1); // could not create selected driver.
}
device.setWindowCaption("Load .irr file example");
IVideoDriver driver = device.getVideoDriver();
ISceneManager smgr = device.getSceneManager();
/* Now load our .irr file.
.irr files can store the whole scene graph including animators, materials
and particle systems. And there is also the possibility to store arbitrary
user data for every scene node in that file. To keep this
example simple, we are simply loading the scene here. See the documentation
at ISceneManager::loadScene and ISceneManager::saveScene for more information.
So to load and display a complicated huge scene, we only need a single call
to loadScene().
*/
// load the scene
smgr.loadScene("../media/example.irr");
/*
That was it already. Now add a camera and draw the scene
*/
// add a user controlled camera
smgr.addCameraSceneNodeFPS();
// and draw everything.
int lastFPS = -1;
while (device.run())
{
if (device.isWindowActive())
{
driver.beginScene(true, true, new SColor(0, 200, 200, 200));
smgr.drawAll();
driver.endScene();
int fps = driver.getFPS();
if (lastFPS != fps)
{
String str = "Load Irrlicht File example - jirr [";
str += driver.getName();
str += "] FPS:";
str += fps;
device.setWindowCaption(str);
lastFPS = fps;
}
}
}
device.drop();
System.exit(0);
}
}
Sorry, but what Do you mean by immature and selling point? What do you expect in fact? Full time support and dozens of programmers doing work for nuts?fireside wrote:Thanks. I'm kind of tossed now, because I tried dev c++ and it works perfectly. Jirr seems to run a little slower on my computer and jerks a little more. It's also kind of missing the real selling point of java which is simple cross platform compatibility, but I imagine that's because it's still a little immature.