public static void dispose() { modelBatch.dispose(); spriteBatch.dispose(); frameBuffer.dispose(); tempBuffer.dispose(); shaderProvider.dispose(); for (ShaderProgram s : Bdx.matShaders.values()) { s.dispose(); } }
public static void resize(int width, int height) { spriteBatch.getProjectionMatrix().setToOrtho2D(0, 0, width, height); if (frameBuffer != null) frameBuffer.dispose(); if (tempBuffer != null) tempBuffer.dispose(); frameBuffer = new RenderBuffer( spriteBatch); // Have to recreate all render buffers and adjust the projection matrix as // the window size has changed tempBuffer = new RenderBuffer(spriteBatch); for (Scene scene : scenes) { if (scene.lastFrameBuffer != null) scene.lastFrameBuffer.dispose(); scene.lastFrameBuffer = new RenderBuffer(null); } }