Error in Font3D?

Sirs, this is happening with Font3D:


  1. I try to create a Font3D in my code, like this:



    Font3D font3D = new Font3D(new Font("Arial", Font.PLAIN, 12), 0.001f, false, true, false);


  2. And then I get the following exception:



    15-mar-2008 21:19:21 com.jmex.font3d.math.Triangulator$SweepLineComparer compare

    INFO: Other end(2):[indx:83,(0.171875,0.71875),type:START]

    Exception in thread "main" java.lang.NullPointerException

    at org.lwjgl.opengl.GL11.glGenLists(GL11.java:1357)

    at com.jme.renderer.lwjgl.LWJGLRenderer.createDisplayList(LWJGLRenderer.java:1511)

    at com.jme.scene.batch.GeomBatch.lockMeshes(GeomBatch.java:537)

    at com.jme.scene.Geometry.lockMeshes(Geometry.java:750)

    at com.jme.scene.SceneElement.lockMeshes(SceneElement.java:336)

    at com.jmex.font3d.Font3D.<init>(Font3D.java:159)



    Any idea why Font3D is not initlializing properly?

Ok, I guess is about a multi-threading issue, related with GL11, as mentioned in this post: http://www.jmonkeyengine.com/jmeforum/index.php?topic=7369.0



So, I will try to apply this, and I guess it will solve the problem :wink:



GameTaskQueueManager.getManager().update(new Callable<Object>() {
   public Object call() throws Exception {
      Font3D font = new Font3D(new Font("Arial", Font.PLAIN, 24), 0.001f, true, true, true);
      ...
      return null;
   }
});

Yes, it worked fine :wink: