static final int WIDTH = 480;\r
static final int HEIGHT = 320; \r
OrthographicCamera cam;\r
- Rectangle viewport;\r
+ Rectangle glViewport;\r
Mesh mesh;\r
\r
public void create() {\r
cam.setViewport(WIDTH, HEIGHT);\r
cam.getPosition().set(WIDTH / 2, HEIGHT / 2, 0);\r
\r
- viewport = calculateViewport(WIDTH, HEIGHT);\r
+ glViewport = calculateGLViewport(WIDTH, HEIGHT);\r
}\r
\r
- private Rectangle calculateViewport(int desiredWidth, int desiredHeight) {\r
+ private Rectangle calculateGLViewport(int desiredWidth, int desiredHeight) {\r
Rectangle viewport = new Rectangle();\r
if(Gdx.graphics.getWidth() > Gdx.graphics.getHeight()) {\r
float aspect = (float)Gdx.graphics.getHeight() / HEIGHT;\r
} \r
\r
public void resize(int width, int height) {\r
- viewport = calculateViewport(WIDTH, HEIGHT);\r
+ glViewport = calculateGLViewport(WIDTH, HEIGHT);\r
}\r
\r
public void render() {\r
GL10 gl = Gdx.gl10;\r
gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r
- gl.glViewport((int)viewport.x, (int)viewport.y, (int)viewport.width, (int)viewport.height);\r
+ gl.glViewport((int)glViewport.x, (int)glViewport.y, (int)glViewport.width, (int)glViewport.height);\r
\r
cam.setMatrices();\r
mesh.render(GL10.GL_TRIANGLES);\r