GL context and preloading

Hello,



I'm working on a sky renderer which will be able to display a Skybox. I've writen this :


            Skybox m_skybox = new Skybox("skybox", 1000, 1000, 1000);
           
            Texture north = TextureManager.loadTexture(new File("data/texture/north.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
            Texture south = TextureManager.loadTexture(new File("data/texture/south.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
            Texture east = TextureManager.loadTexture(new File("data/texture/east.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
            Texture west = TextureManager.loadTexture(new File("data/texture/west.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
            Texture up = TextureManager.loadTexture(new File("data/texture/top.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
            Texture down = TextureManager.loadTexture(new File("data/texture/bottom.jpg").toURI().toURL(), Texture.MM_LINEAR, Texture.FM_LINEAR, Image.GUESS_FORMAT_NO_S3TC, 0.0f, true);
           
            m_skybox.setTexture(Skybox.NORTH, north);
            m_skybox.setTexture(Skybox.WEST, west);
            m_skybox.setTexture(Skybox.SOUTH, south);
            m_skybox.setTexture(Skybox.EAST, east);
            m_skybox.setTexture(Skybox.UP, up);
            m_skybox.setTexture(Skybox.DOWN, down);
           
            RenderingCall call = new RenderingCall(m_skybox, m_skybox.getClass(), m_skybox.getClass().getMethod("preloadTextures", (Class<?>[])null),null);
            GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(call);


           
And :

public class RenderingCall  implements Callable {

    private Object obj;

    private Class classObj;
   
    private Method methodObj;
   
    private Object[] args;
   
    public RenderingCall(Object obj, Class classObj, Method methodObj, Object[] args) {
        this.obj = obj;
        this.methodObj = methodObj;
        this.classObj = classObj;
        this.args = args;
    }
   
    public Object call() throws Exception {
        methodObj.invoke(classObj.cast(obj),args);
        return null;
    }

}



My application run without exception or warning message but textures are never loaded... Any idea ?

Sorry, just missing to call updateRenderState()…