/** Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for * example in an overridden paintGL()). */ public void makeCurrent () { try { canvas.makeCurrent(); setGlobals(); } catch (Throwable ex) { exception(ex); } }
/** Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for * example in an overridden paintGL()). */ public void makeCurrent () { try { canvas.makeCurrent(); setGlobals(); } catch (Throwable ex) { exception(ex); } }
void create () { try { setGlobals(); graphics.initiateGL(); canvas.setVSyncEnabled(graphics.config.vSyncEnabled); listener.create(); lastWidth = Math.max(1, graphics.getWidth()); lastHeight = Math.max(1, graphics.getHeight()); listener.resize(lastWidth, lastHeight); start(); } catch (Throwable ex) { stopped(); exception(ex); } }
void create () { try { setGlobals(); graphics.initiateGL(); canvas.setVSyncEnabled(graphics.config.vSyncEnabled); listener.create(); lastWidth = Math.max(1, graphics.getWidth()); lastHeight = Math.max(1, graphics.getHeight()); listener.resize(lastWidth, lastHeight); start(); } catch (Throwable ex) { stopped(); exception(ex); } }
if (Gdx.net == null) net = new LwjglNet(config); input = new LwjglAWTInput(this); setGlobals();
if (Gdx.net == null) net = new LwjglNet(config); input = new LwjglAWTInput(this); setGlobals();
void render (boolean shouldRender) throws LWJGLException { if (!running) return; setGlobals(); canvas.setCursor(cursor); int width = Math.max(1, graphics.getWidth()); int height = Math.max(1, graphics.getHeight()); if (lastWidth != width || lastHeight != height) { lastWidth = width; lastHeight = height; Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); resize(width, height); listener.resize(width, height); shouldRender = true; } if (executeRunnables()) shouldRender = true; // If one of the runnables set running to false, for example after an exit(). if (!running) return; shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update(); if (shouldRender) { graphics.updateTime(); graphics.frameId++; listener.render(); canvas.swapBuffers(); } Display.sync(getFrameRate() * instanceCount); }
void render (boolean shouldRender) throws LWJGLException { if (!running) return; setGlobals(); canvas.setCursor(cursor); int width = Math.max(1, graphics.getWidth()); int height = Math.max(1, graphics.getHeight()); if (lastWidth != width || lastHeight != height) { lastWidth = width; lastHeight = height; Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); resize(width, height); listener.resize(width, height); shouldRender = true; } if (executeRunnables()) shouldRender = true; // If one of the runnables set running to false, for example after an exit(). if (!running) return; shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update(); if (shouldRender) { graphics.updateTime(); graphics.frameId++; listener.render(); canvas.swapBuffers(); } Display.sync(getFrameRate() * instanceCount); }
public void stop () { if (!running) return; running = false; setGlobals(); Array<LifecycleListener> listeners = lifecycleListeners; // To allow destroying of OpenGL textures during disposal. if (canvas.isDisplayable()) { makeCurrent(); } else { error(logTag, "OpenGL context destroyed before application listener has had a chance to dispose of textures."); } synchronized (listeners) { for (LifecycleListener listener : listeners) { listener.pause(); listener.dispose(); } } listener.pause(); listener.dispose(); Gdx.app = null; Gdx.graphics = null; if (audio != null) { audio.dispose(); Gdx.audio = null; } if (files != null) Gdx.files = null; if (net != null) Gdx.net = null; instanceCount--; stopped(); }
public void stop () { if (!running) return; running = false; setGlobals(); Array<LifecycleListener> listeners = lifecycleListeners; // To allow destroying of OpenGL textures during disposal. if (canvas.isDisplayable()) { makeCurrent(); } else { error(logTag, "OpenGL context destroyed before application listener has had a chance to dispose of textures."); } synchronized (listeners) { for (LifecycleListener listener : listeners) { listener.pause(); listener.dispose(); } } listener.pause(); listener.dispose(); Gdx.app = null; Gdx.graphics = null; if (audio != null) { audio.dispose(); Gdx.audio = null; } if (files != null) Gdx.files = null; if (net != null) Gdx.net = null; instanceCount--; stopped(); }
/** Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for * example in an overridden paintGL()). */ public void makeCurrent () { try { canvas.makeCurrent(); setGlobals(); } catch (Throwable ex) { exception(ex); } }
void create () { try { setGlobals(); graphics.initiateGL(); canvas.setVSyncEnabled(graphics.config.vSyncEnabled); listener.create(); lastWidth = Math.max(1, graphics.getWidth()); lastHeight = Math.max(1, graphics.getHeight()); listener.resize(lastWidth, lastHeight); start(); } catch (Throwable ex) { stopped(); exception(ex); } }
if (Gdx.net == null) net = new LwjglNet(); input = new LwjglAWTInput(this); setGlobals();
void render (boolean shouldRender) throws LWJGLException { if (!running) return; setGlobals(); canvas.setCursor(cursor); int width = Math.max(1, graphics.getWidth()); int height = Math.max(1, graphics.getHeight()); if (lastWidth != width || lastHeight != height) { lastWidth = width; lastHeight = height; Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); resize(width, height); listener.resize(width, height); shouldRender = true; } if (executeRunnables()) shouldRender = true; // If one of the runnables set running to false, for example after an exit(). if (!running) return; shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update(); if (shouldRender) { graphics.updateTime(); graphics.frameId++; listener.render(); canvas.swapBuffers(); } Display.sync(getFrameRate() * instanceCount); }
public void stop () { if (!running) return; running = false; setGlobals(); Array<LifecycleListener> listeners = lifecycleListeners; // To allow destroying of OpenGL textures during disposal. if (canvas.isDisplayable()) { makeCurrent(); } else { error(logTag, "OpenGL context destroyed before application listener has had a chance to dispose of textures."); } synchronized (listeners) { for (LifecycleListener listener : listeners) { listener.pause(); listener.dispose(); } } listener.pause(); listener.dispose(); Gdx.app = null; Gdx.graphics = null; if (audio != null) { audio.dispose(); Gdx.audio = null; } if (files != null) Gdx.files = null; if (net != null) Gdx.net = null; instanceCount--; stopped(); }