@Override public void glViewport (int x, int y, int width, int height) { calls++; gl20.glViewport(x, y, width, height); check(); }
/** Unbinds the framebuffer and sets viewport sizes, all drawing will be performed to the normal framebuffer from here on. * * @param x the x-axis position of the viewport in pixels * @param y the y-asis position of the viewport in pixels * @param width the width of the viewport in pixels * @param height the height of the viewport in pixels */ public void end (int x, int y, int width, int height) { unbind(); Gdx.gl20.glViewport(x, y, width, height); }
/** Unbinds the framebuffer and sets viewport sizes, all drawing will be performed to the normal framebuffer from here on. * * @param x the x-axis position of the viewport in pixels * @param y the y-asis position of the viewport in pixels * @param width the width of the viewport in pixels * @param height the height of the viewport in pixels */ public void end (int x, int y, int width, int height) { unbind(); Gdx.gl20.glViewport(x, y, width, height); }
@Override public void glViewport (int x, int y, int width, int height) { calls++; gl20.glViewport(x, y, width, height); check(); }
/** Calls {@link GL20#glViewport(int, int, int, int)}, expecting the coordinates and sizes given in logical coordinates and * automatically converts them to backbuffer coordinates, which may be bigger on HDPI screens. */ public static void glViewport (int x, int y, int width, int height) { if (mode == HdpiMode.Logical && (Gdx.graphics.getWidth() != Gdx.graphics.getBackBufferWidth() || Gdx.graphics.getHeight() != Gdx.graphics.getBackBufferHeight())) { Gdx.gl.glViewport(toBackBufferX(x), toBackBufferY(y), toBackBufferX(width), toBackBufferY(height)); } else { Gdx.gl.glViewport(x, y, width, height); } }
/** Calls {@link GL20#glViewport(int, int, int, int)}, expecting the coordinates and sizes given in logical coordinates and * automatically converts them to backbuffer coordinates, which may be bigger on HDPI screens. */ public static void glViewport (int x, int y, int width, int height) { if (mode == HdpiMode.Logical && (Gdx.graphics.getWidth() != Gdx.graphics.getBackBufferWidth() || Gdx.graphics.getHeight() != Gdx.graphics.getBackBufferHeight())) { Gdx.gl.glViewport(toBackBufferX(x), toBackBufferY(y), toBackBufferX(width), toBackBufferY(height)); } else { Gdx.gl.glViewport(x, y, width, height); } }
protected void beginRender (boolean lighting) { Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClearColor(0, 0, 0, 0); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); camera.update(); }
@Override public void render () { counter = (counter + Gdx.graphics.getDeltaTime()) % 2.f; testAttribute1.value = Math.abs(1f - counter); testAttribute2.value = 1f - testAttribute1.value; camController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); modelBatch.begin(cam); modelBatch.render(instances); modelBatch.end(); }
@Override public void render () { Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); shader.begin(); mesh.render(shader, GL20.GL_TRIANGLES); shader.end(); } }
public void begin () { final int w = fbo.getWidth(); final int h = fbo.getHeight(); fbo.begin(); Gdx.gl.glViewport(0, 0, w, h); Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST); Gdx.gl.glScissor(1, 1, w - 2, h - 2); }
@Override public void resize (int width, int height) { Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController)); Gdx.gl.glViewport(0, 0, width, height); worldCamera.viewportWidth = width; worldCamera.viewportHeight = height; worldCamera.update(); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void render () { counter = (counter + Gdx.graphics.getDeltaTime()) % 1.f; blendingAttribute.opacity = 0.25f + Math.abs(0.5f - counter); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); modelInstance.transform.rotate(Vector3.Y, 30 * Gdx.graphics.getDeltaTime()); modelBatch.begin(camera); modelBatch.render(background); modelBatch.render(modelInstance); modelBatch.end(); }
public void begin () { final int w = fbo.getWidth(); final int h = fbo.getHeight(); fbo.begin(); Gdx.gl.glViewport(0, 0, w, h); Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST); Gdx.gl.glScissor(1, 1, w - 2, h - 2); }
@Override public void render () { inputController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); modelBatch.begin(cam); modelBatch.render(instance, environment); modelBatch.end(); }
@Override public void resize (int width, int height) { Gdx.input.setInputProcessor(new InputMultiplexer(ui, cameraInputController)); Gdx.gl.glViewport(0, 0, width, height); worldCamera.viewportWidth = width; worldCamera.viewportHeight = height; worldCamera.update(); ui.getViewport().setWorldSize(width, height); ui.getViewport().update(width, height, true); }
@Override public void render () { counter = (counter + Gdx.graphics.getDeltaTime()) % 1.f; blendingAttribute.opacity = 0.25f + Math.abs(0.5f - counter); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); modelInstance.transform.rotate(Vector3.Y, 30 * Gdx.graphics.getDeltaTime()); modelBatch.begin(camera); modelBatch.render(background); modelBatch.render(modelInstance, environment); modelBatch.end(); }
@Override public void resize (int width, int height) { Gdx.gl.glViewport(0, 0, width, height); if (pixelsPerMeter.getValue() <= 0) { pixelsPerMeter.setValue(1); } worldCamera.setToOrtho(false, width / pixelsPerMeter.getValue(), height / pixelsPerMeter.getValue()); worldCamera.update(); textCamera.setToOrtho(true, width, height); textCamera.update(); effect.setPosition(worldCamera.viewportWidth / 2, worldCamera.viewportHeight / 2); }
@Override public void resize (int width, int height) { Gdx.gl.glViewport(0, 0, width, height); if (pixelsPerMeter.getValue() <= 0) { pixelsPerMeter.setValue(1); } worldCamera.setToOrtho(false, width / pixelsPerMeter.getValue(), height / pixelsPerMeter.getValue()); worldCamera.update(); textCamera.setToOrtho(true, width, height); textCamera.update(); effect.setPosition(worldCamera.viewportWidth / 2, worldCamera.viewportHeight / 2); }
@Override public void render () { animate(); inputController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glClearColor(0.13f, 0.13f, 0.13f, 1); modelBatch.begin(cam); modelBatch.render(instance, environment); modelBatch.end(); }
@Override public void render () { if (loading && assets.update()) doneLoading(); camController.update(); Gdx.gl.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); modelBatch.begin(cam); for (ModelInstance instance : instances) modelBatch.render(instance, lights); if (space != null) modelBatch.render(space); modelBatch.end(); }