libgdx-contribs icon indicating copy to clipboard operation
libgdx-contribs copied to clipboard

PostProcessor using deprecated glViewport functionality.

Open rafaskb opened this issue 9 years ago • 0 comments

PostProcessor::restoreViewport() should use HdpiUtils.glViewport instead of Gdx.graphics.glViewport, according to libGDX's 1.8.0 changelog.

API Change: Added HdpiUtils. Instead of calling GL20#glViewport and GL20#glScissor yourself please use HdpiUtils instead. It will ensure that you handle HDPI monitors correctly when using those OpenGL functions. On HDPI monitors, the size reported by Gdx.graphics getWidth/getHeight is in logical coordinates as dictated by the operating system, usually half the HDPI resolution. The OpenGL drawing surface works in backbuffer coordinates at the full HDPI resolution. If you pass logical coordinates to glViewport and glScissor, you only affect a quarter of the real backbuffer size. Use HdpiUtils instead, it will do the right thing, while letting you continue to work in logical (aka returned by Gdx.graphics.getWidth/getHeight) coordinates.

rafaskb avatar Jul 29 '16 20:07 rafaskb