void initializeListener() { if(!listenerInitialized) { listener.create(); listener.resize(graphics.getWidth(), graphics.getHeight()); listenerInitialized = true; } }
void initializeListener() { if(!listenerInitialized) { listener.create(); listener.resize(graphics.getWidth(), graphics.getHeight()); listenerInitialized = true; } }
@Override public void viewDidLayoutSubviews () { super.viewDidLayoutSubviews(); // get the view size and update graphics CGRect bounds = app.getBounds(); graphics.width = (int)bounds.getWidth(); graphics.height = (int)bounds.getHeight(); graphics.makeCurrent(); if (graphics.created) { app.listener.resize(graphics.width, graphics.height); } }
@Override public void viewDidLayoutSubviews () { super.viewDidLayoutSubviews(); // get the view size and update graphics CGRect bounds = app.getBounds(); graphics.width = (int)bounds.getWidth(); graphics.height = (int)bounds.getHeight(); graphics.makeCurrent(); if (graphics.created) { app.listener.resize(graphics.width, graphics.height); } }
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); } }
@Override public void onSurfaceChanged (javax.microedition.khronos.opengles.GL10 gl, int width, int height) { this.width = width; this.height = height; updatePpi(); gl.glViewport(0, 0, this.width, this.height); if (created == false) { app.getApplicationListener().create(); created = true; synchronized (this) { running = true; } } app.getApplicationListener().resize(width, height); }
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); } }
@Override public void onSurfaceChanged (javax.microedition.khronos.opengles.GL10 gl, int width, int height) { this.width = width; this.height = height; updatePpi(); gl.glViewport(0, 0, this.width, this.height); if (created == false) { app.getApplicationListener().create(); created = true; synchronized (this) { running = true; } } app.getApplicationListener().resize(width, height); }
@Override public void viewDidLayoutSubviews () { super.viewDidLayoutSubviews(); // get the view size and update graphics CGRect bounds = app.getBounds(); graphics.width = (int)bounds.size().width(); graphics.height = (int)bounds.size().height(); graphics.makeCurrent(); if (app.graphics.created) { app.listener.resize(graphics.width, graphics.height); } }
@Override public void viewDidLayoutSubviews () { super.viewDidLayoutSubviews(); // get the view size and update graphics CGRect bounds = app.getBounds(); graphics.width = (int)bounds.size().width(); graphics.height = (int)bounds.size().height(); graphics.makeCurrent(); if (app.graphics.created) { app.listener.resize(graphics.width, graphics.height); } }
@Override public void invoke(long windowHandle, final int width, final int height) { updateFramebufferInfo(); if (!window.isListenerInitialized()) { return; } window.makeCurrent(); gl20.glViewport(0, 0, width, height); window.getListener().resize(getWidth(), getHeight()); window.getListener().render(); GLFW.glfwSwapBuffers(windowHandle); } };
@Override public void invoke(long windowHandle, final int width, final int height) { updateFramebufferInfo(); if (!window.isListenerInitialized()) { return; } window.makeCurrent(); gl20.glViewport(0, 0, width, height); window.getListener().resize(getWidth(), getHeight()); window.getListener().render(); GLFW.glfwSwapBuffers(windowHandle); } };
void mainLoop() { graphics.update(); if (Gdx.graphics.getWidth() != lastWidth || Gdx.graphics.getHeight() != lastHeight) { lastWidth = graphics.getWidth(); lastHeight = graphics.getHeight(); Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); GwtApplication.this.listener.resize(lastWidth, lastHeight); } runnablesHelper.addAll(runnables); runnables.clear(); for (int i = 0; i < runnablesHelper.size; i++) { runnablesHelper.get(i).run(); } runnablesHelper.clear(); graphics.frameId++; listener.render(); input.reset(); }
void mainLoop() { graphics.update(); if (Gdx.graphics.getWidth() != lastWidth || Gdx.graphics.getHeight() != lastHeight) { lastWidth = graphics.getWidth(); lastHeight = graphics.getHeight(); Gdx.gl.glViewport(0, 0, lastWidth, lastHeight); GwtApplication.this.listener.resize(lastWidth, lastHeight); } runnablesHelper.addAll(runnables); runnables.clear(); for (int i = 0; i < runnablesHelper.size; i++) { runnablesHelper.get(i).run(); } runnablesHelper.clear(); graphics.frameId++; listener.render(); input.reset(); }
app.listener.resize(width, height); created = true;
app.listener.resize(width, height); created = true;
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); }
app.listener.resize(width, height); created = true;
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); }
app.listener.resize(width, height); created = true;