}\r
\r
if(destroy) { \r
- app.listener.destroy();\r
+ app.listener.dispose();\r
destroy = false;\r
}\r
}\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
System.out.println("destroy"); \r
}\r
\r
\r
public void destroy() { \r
canvas.getContext().makeCurrent();\r
- listener.destroy();\r
+ listener.dispose();\r
}\r
}\r
}\r
\r
listener.pause();\r
- listener.destroy();\r
+ listener.dispose();\r
Display.destroy();\r
}\r
\r
LwjglInput input;\r
final ApplicationListener listener;\r
Thread mainLoopThread;\r
- boolean running = true;\r
Canvas canvas;\r
Timer timer = new Timer("LwjglCanvas Timer");\r
- Runnable updateRunnable;\r
\r
public LwjglCanvas (ApplicationListener listener, boolean useGL2) {\r
LwjglNativesLoader.load();\r
listener.create();\r
listener.resize(graphics.getWidth(), graphics.getHeight());\r
\r
- updateRunnable = new Runnable() {\r
+ final Runnable runnable = new Runnable() {\r
int lastWidth = graphics.getWidth();\r
int lastHeight = graphics.getHeight();\r
\r
timer.schedule(new TimerTask() {\r
public void run () {\r
try {\r
- EventQueue.invokeAndWait(updateRunnable);\r
+ EventQueue.invokeAndWait(runnable);\r
} catch (Exception ex) {\r
throw new GdxRuntimeException(ex);\r
}\r
}\r
\r
public void stop () {\r
- running = false;\r
timer.cancel();\r
SwingUtilities.invokeLater(new Runnable() {\r
public void run () {\r
listener.pause();\r
- listener.destroy();\r
+ listener.dispose();\r
Display.destroy();\r
}\r
});\r
@Override public void resume () {\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
}\r
}\r
\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
// TODO Auto-generated method stub\r
\r
}\r
public void dispose () {\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
// TODO Auto-generated method stub\r
\r
}\r
GUI gui; \r
TwlInputListener guiInputListener;\r
\r
+ @Override\r
public void create () {\r
if (gui != null) return;\r
\r
gui.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); \r
}\r
\r
+ @Override\r
public void render () {\r
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); \r
\r
gui.update(); \r
}\r
\r
- public void dispose () {\r
- gui.destroy();\r
- } \r
-\r
@Override\r
- public void destroy() {\r
- // TODO Auto-generated method stub\r
- \r
+ public void dispose() {\r
+ gui.destroy();\r
}\r
\r
@Override\r
public void pause() {\r
- // TODO Auto-generated method stub\r
- \r
}\r
\r
@Override\r
public void resume() {\r
- // TODO Auto-generated method stub\r
- \r
}\r
}\r
GUI gui;\r
TwlInputListener guiInputListener;\r
\r
+ @Override\r
public void create () {\r
if (gui != null) return;\r
\r
TwlRenderer.updateSize(gui);\r
}\r
\r
+ @Override\r
public void render () {\r
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r
Gdx.input.processEvents(guiInputListener);\r
gui.update();\r
}\r
\r
- public void destroy () {\r
+ @Override\r
+ public void dispose () {\r
gui.destroy();\r
}\r
\r
@Override\r
public void pause() {\r
- // TODO Auto-generated method stub\r
- \r
}\r
\r
@Override\r
public void resume() {\r
- // TODO Auto-generated method stub\r
- \r
}\r
}\r
/**\r
* Called when the {@link Application} is destroyed. Preceded by a call to {@link #pause()}.\r
*/\r
- public void destroy ();\r
+ public void dispose ();\r
}\r
}\r
\r
@Override\r
- public void destroy() { \r
+ public void dispose() { \r
screen.dispose();\r
}\r
\r
\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
// TODO Auto-generated method stub\r
\r
}\r
}\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
stop = true;\r
try {\r
thread.join();\r
return false;\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
world.dispose();\r
}\r
\r
@Override public boolean keyDown (int keycode) {\r
if (keycode == Keys.KEYCODE_SPACE) {\r
app.log("TestCollection", "disposing test '" + tests[testIndex].getClass().getName());\r
- tests[testIndex].destroy();\r
+ tests[testIndex].dispose();\r
testIndex++;\r
if (testIndex >= tests.length) testIndex = 0;\r
Box2DTest test = tests[testIndex];\r
float angle = 0;\r
float angleIncrement = 0.1f;\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
tex.dispose();\r
tex2.dispose();\r
}\r
ImmediateModeRenderer renderer;\r
Texture texture;\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
texture.dispose();\r
}\r
\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
texture.dispose();\r
vbo.dispose();\r
ibo.dispose();\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
texture.dispose();\r
shader.dispose();\r
ibo.dispose();\r
*/\r
public class LifeCycleTest extends GdxTest {\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
Gdx.app.log("Test", "Thread=" + Thread.currentThread().getId() + ", app destroyed");\r
}\r
\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
batch.dispose();\r
renderer.dispose();\r
font.dispose();\r
\r
}\r
\r
- @Override public void destroy () {\r
+ @Override public void dispose () {\r
Gdx.app.log("Simple Test", "Thread=" + Thread.currentThread().getId() + ", application destroyed");\r
}\r
\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
texture.dispose();\r
va.dispose();\r
}\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
texture.dispose();\r
vbo.dispose(); \r
}\r
}\r
\r
@Override\r
- public void destroy() {\r
+ public void dispose() {\r
texture.dispose();\r
vbo.dispose();\r
shader.dispose();\r
createWorld(world);\r
}\r
\r
- @Override public void destroy () { \r
+ @Override public void dispose () { \r
renderer.dispose();\r
world.dispose();\r
\r
public void render( ) { };\r
public void resize(int width, int height) { };\r
public void pause( ) { };\r
- public void destroy( ) { };\r
+ public void dispose( ) { };\r
}\r