@Override public void glScissor (int x, int y, int width, int height) { calls++; gl20.glScissor(x, y, width, height); check(); }
@Override public void glScissor (int x, int y, int width, int height) { calls++; gl20.glScissor(x, y, width, height); check(); }
/** Calls {@link GL20#glScissor(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 glScissor (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.glScissor(toBackBufferX(x), toBackBufferY(y), toBackBufferX(width), toBackBufferY(height)); } else { Gdx.gl.glScissor(x, y, width, height); } }
/** Calls {@link GL20#glScissor(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 glScissor (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.glScissor(toBackBufferX(x), toBackBufferY(y), toBackBufferX(width), toBackBufferY(height)); } else { Gdx.gl.glScissor(x, y, width, height); } }
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); }
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); }
/** Set viewport according to allocator. * @param lp LightProperties to process. * @param cameraViewport Set camera viewport if true. */ protected void processViewport (LightProperties lp, boolean cameraViewport) { Camera camera = lp.camera; ShadowMapRegion r = allocator.nextResult(currentLight); if (r == null) return; TextureRegion region = lp.region; region.setTexture(frameBuffers[currentPass].getColorBufferTexture()); // We don't use HdpiUtils // gl commands related to shadow map size and not to screen size Gdx.gl.glViewport(r.x, r.y, r.width, r.height); Gdx.gl.glScissor(r.x + 1, r.y + 1, r.width - 2, r.height - 2); region.setRegion(r.x, r.y, r.width, r.height); if (cameraViewport) { camera.viewportHeight = r.height; camera.viewportWidth = r.width; camera.update(); } }
public void renderCube() { int w = Gdx.graphics.getBackBufferWidth(); int h = Gdx.graphics.getBackBufferHeight(); int x = (int)(w - w*0.5f); int y = (int)(h - h*0.5f); w *= 0.5f; h *= 0.5f; Gdx.gl.glViewport(x, y, w, h); Gdx.gl.glEnable(GL20.GL_SCISSOR_TEST); Gdx.gl.glScissor(x, y, w, h); Gdx.gl.glClearColor(1, 1, 1, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); pitch += 25 * Gdx.graphics.getDeltaTime(); yaw += 45 * Gdx.graphics.getDeltaTime(); cubeInstance.transform.setFromEulerAngles(yaw, pitch, roll); cubeBatch.begin(camCube); cubeBatch.render(cubeInstance); cubeBatch.end(); } }
@Override public void glScissor (int x, int y, int width, int height) { calls++; gl20.glScissor(x, y, width, height); check(); }
public void camera( Camera camera ) { if (camera == null) { camera = Camera.main; } if (camera != lastCamera && camera.matrix != null) { lastCamera = camera; uCamera.valueM4( camera.matrix ); if (!camera.fullScreen) { Gdx.gl.glEnable( GL20.GL_SCISSOR_TEST ); Gdx.gl.glScissor( camera.x, Game.height - camera.screenHeight - camera.y, camera.screenWidth, camera.screenHeight); } else { Gdx.gl.glDisable( GL20.GL_SCISSOR_TEST ); } } }
/** Calls {@link GL20#glScissor(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 glScissor (int x, int y, int width, int height) { if (Gdx.graphics.getWidth() != Gdx.graphics.getBackBufferWidth() || Gdx.graphics.getHeight() != Gdx.graphics.getBackBufferHeight()) { Gdx.gl.glScissor(toBackBufferX(x), toBackBufferY(y), toBackBufferX(width), toBackBufferY(height)); } else { Gdx.gl.glScissor(x, y, width, height); } }
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); }