FAQAnswers to our most commonly asked questions

Which jar(s) should I use ?

On Windows/Linux/Mac:

If you are using most of the api or are not limited by size, the easiest is to use the bundle jar bonzaiengine.jar for regular application, and the compressed bundled jar bonzaiengine.jar.pack.lzma for applets.

Additionnaly, if you are using gl4java or an old version of jogl, you would need bonzaiengine-bindings.jar

Alternatively, you can use the splitted jars. See the jar dependency diagram:

Jar dependencies

On Android:

bonzaiengine-android21.jar contains all the api in a single bundled jar for Android 2.1 and above.
For smaller size footprint, a smaller bundle bonzaiengine-android21-light.jar is provided without the model readers except engine binary formats (jmf, jma, jaf, jlf) and writers. The

Where can I get third parties ?

On Windows/Linux/Mac, the engine uses third party for the OpenGL binding.

You can use LWJGL (lwjgl.org, recommended is lwjgl 2.8.2 or newer) or JOGL 2.x (jogamp.org, recommended is 2.0 rc5 or newer). The engine is also compatible with older (and deprecated) apis JOGL 1.x, JOGL JSR-231 and GL4Java.

I'm using JOGL but I don't know which version it is

JOGL version can be deduced from the package it is using:

  • JOGL1 is using net.java.games.jogl package
  • JSR231 is using javax.media.opengl and com.sun.opengl, and is usually distributed in jogl.jar and gluegen.jar jars
  • JOGL2 (jogamp.org) is using javax.media.opengl and com.jogamp

It is recommended to use lastest release of JOGL2 from jogamp.org.

I'm trying to render a 3D model without the framework, but nothing is rendered

This is a common issue who most beginner have. In most cases this issues comes with a bad setup of OpenGL matrices (viewport, project and modelview).

The framework provide all the utilities to set everything properly, some tutorials show how to do that without the framework.
1) Example of viewport matrix setup: in onSurfaceChanged method of BeStandaloneTutorial.java.
2) Example of modelview matrix setup: in onDrawFrame method of BeStandaloneTutorial.java.
3) The projection can be setup using gluPerspective.

If you still have trouble getting the model visible to screen, follow Hello World tutorial with your model to make sure there's not problem with it.

When you're sure matrices are all fine and OpenGL states are properly initialized, draw a wired cube in the place the model should be using bounding box and check the box is visible.

In the case you're instancing the IGLApi object, make sure you explicitly call IGLApi.update (parameters depends on the implementation used) when entering a function where the OpenGL context is current and used.

Finally, make sure that the rendering loop is running, the frame buffers are cleared, opengl states allow on screen rendering, ... and that no uncatched or unprinted exception has arised.

How to turn off, or redirect, engine logging ?

By default, engine logging is enabled. It can easily be turned off with Log.attachNullOutput, or redirected with Log.attachOutput.

Fullscreen: everything rendered black

Fullscreen exclusive mode of current jre under windows suffer from interaction with DirectDraw which results to everything rendered black with OpenGL when in fullscreen. The engine uses jre's fullscreen exclusive mode api only when using non-native component (LWJGL/JOGL provides stronger fullscreen switching mechanism with native component).

To avoid this problem, sun.java2d.noddraw property should be set to true. As a workaround, the engine tries to do that with System.setProperty but sometimes it's too late and this property must be passed from the command line with: -Dsun.java2d.noddraw property=true