public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { SoulGL2 gl = new DesktopGL2(drawable.getGL().getGL2()); gl.glViewport(0, 0, width, height); gl.glEnable(SoulGL2.GL_CULL_FACE); gl.glDisable(SoulGL2.GL_DEPTH_TEST); PrimitiveRenderer.onSurfaceChanged(width, height); TextRenderer.getInstance().onSurfaceChanged(width, height); GlobalVariables.aspectRatio = width * 1.0f / height; }
public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); TextRenderer.createInstance(); PrimitiveBuffers.createBuffers(); AssetManager.setInstance(new DesktopAssetManager()); DesktopTextureManager textureManager = new DesktopTextureManager(); textureManager.setGL2(drawable.getGL().getGL2()); TextureManager.setInstance(textureManager); TextureManager.init(new DesktopGL2(gl)); DefaultShaders.createDefaultShaders(new DesktopGL2(gl)); GenoShaders.createShaders(new DesktopGL2(gl)); GenoTexID.createTextures(new DesktopGL2(gl)); gl.glDisable(GL2.GL_DEPTH_TEST); gl.glBlendFunc(GL2.GL_SRC_ALPHA, GL2.GL_ONE_MINUS_SRC_ALPHA); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); }