Quick question on calleables i've been a way for a while and can't remember certain functions i have this code for standard game to as a trial loader for my character. I understand that the scene has to be injected into openGL. I've realized however that it doesn't matter if i change GameTaskQueueManager.getManager().update(new Callable<Object>() to GameTaskQueueManager.getManager().render(new Callable<Object>(). Why is that so also can anyone properly re-inform me of the correct way to load objects and begin them later on. Should I do all of the if statements within the GameTaskQueue Manager. I've been searching the forums however i'm having difficulties relocating the proper information in the wiki or forums even though its only been a couple months.
// /**
GameTaskQueueManager.getManager().update(new Callable<Object>() {
public Object call() throws Exception {
//Initializes Terrain and skybox
Scene scene = new Scenery.Scene();
GameStateManager.getInstance().attachChild(scene); // Attach it to the GameStateManager
scene.setActive(true); // Activate it
return null;
}
}
).get();//*/
GameState cubeState = new RandomCharacterGameState();
GameStateManager.getInstance().attachChild(cubeState);
cubeState.setActive(true);
GameTaskQueueManager.getManager().update(new Callable<Object>() {
public Object call() throws Exception {
// openGL stuff here
return null;
}
}
The difference between the render and update calls is where it is injected, update is injected into the update() method while render is injected into the render() method. You could probably call update stuff in the render method (but thats not recommended) but not vice-versa. Also, models don't need to be loaded in the openGL thread (they are just data) but they do need to be rendered there...
Both textures and VBO are created when the model is rendered. You can load models from non-GL threads but not through multiple threads because TextureManager is not thread safe.
quick question i'm getting this odd error during runtime however it happens briefly before it opens the window which doesn't seem to cause a obvious issue however i would like to know if it can be a potential one.
at java.lang.Thread.run([u]Thread.java:619[/u])
Jan 13, 2009 2:39:12 AM com.jmex.game.DefualtUncaughtExceptionHandler uncaughtException
SEVERE: Main game loop broken by uncaught exception
[u]com.jme.system.JmeException[/u]: Cannor create window: Insufficent depth buffer precision
at com.jme.system.lwjgl.LWJGLDisplaySystem.initDisplay([u]LWJGLDisplayStystem.java: 440[/u])
Unless you are adjusting the Stencil Bits it sounds like your video card doesn't support as many as jME is asking for.
For some odd reason its not comming up anymore, however i'm unsure it could be my vid card as i recently updated my rig also unless 0 is to high settings.setStencilBits(0); I'm slightly unsure of what the actual issue can be