Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.GL20


    if (Gdx.graphics.isGL20Available()) {
      if (blendingDisabled) {
        Gdx.gl20.glDisable(GL20.GL_BLEND);
      } else {
        GL20 gl20 = Gdx.gl20;
        gl20.glEnable(GL20.GL_BLEND);
        gl20.glBlendFunc(blendSrcFunc, blendDstFunc);
      }

      if (customShader != null)
        mesh.render(customShader, GL10.GL_TRIANGLES, 0, spritesInBatch * 6);
      else
 
View Full Code Here


        // it's an iPod or iPhone
        displayScaleFactor = config.displayScaleSmallScreenIfNonRetina;
      }
    }

    GL20 gl20 = new IOSGLES20();

    Gdx.gl = gl20;
    Gdx.gl20 = gl20;

    // setup libgdx
View Full Code Here

            private final Label fps = new Label("", new Label.LabelStyle(bitmapFont, Color.WHITE));
            private final Road road = new Road();

            @Override
            public void render(float v) {
                GL20 gl = Gdx.graphics.getGL20();
                gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
                fps.setText("" + Gdx.graphics.getFramesPerSecond());

                road.update(v);
                road.render(stage.getCamera());
View Full Code Here

        // it's an iPod or iPhone
        displayScaleFactor = config.displayScaleSmallScreenIfNonRetina;
      }
    }

    GL20 gl20 = new IOSGLES20();

    Gdx.gl = gl20;
    Gdx.gl20 = gl20;

    // setup libgdx
View Full Code Here

      mesh.bind();
    } else {
      combinedMatrix.set(projectionMatrix).mul(transformMatrix);

      GL20 gl = Gdx.gl20;
      gl.glDepthMask(false);

      if (customShader != null) {
        customShader.begin();
        customShader.setUniformMatrix("u_proj", projectionMatrix);
        customShader.setUniformMatrix("u_trans", transformMatrix);
View Full Code Here

      gl.glDepthMask(true);
      gl.glDisable(GL10.GL_TEXTURE_2D);
      mesh.unbind();
    } else {
      shader.end();
      GL20 gl = Gdx.gl20;
      gl.glDepthMask(true);
      if(customShader != null) mesh.unbind(customShader);
      else mesh.unbind(shader);
    }
  }
View Full Code Here

      byteBuffer.limit(buffer.limit() << 2);
    }

    if (isBound) {
      if (Gdx.gl20 != null) {
        GL20 gl = Gdx.gl20;
        gl.glBufferSubData(GL20.GL_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer);
      } else {
        GL11 gl = Gdx.gl11;
        gl.glBufferSubData(GL11.GL_ARRAY_BUFFER, 0, byteBuffer.limit(), byteBuffer);
      }
      isDirty = false;
    }
  }
View Full Code Here

    bind(shader, null);
  }
 
  @Override
  public void bind (final ShaderProgram shader, final int[] locations) {
    final GL20 gl = Gdx.gl20;

    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, bufferHandle);
    if (isDirty) {
      byteBuffer.limit(buffer.limit() * 4);
      gl.glBufferData(GL20.GL_ARRAY_BUFFER, byteBuffer.limit(), byteBuffer, usage);
      isDirty = false;
    }

    final int numAttributes = attributes.size();
    if (locations == null) {
View Full Code Here

    unbind(shader, null);
  }
 
  @Override
  public void unbind (final ShaderProgram shader, final int[] locations) {
    final GL20 gl = Gdx.gl20;
    final int numAttributes = attributes.size();
    if (locations == null) {
      for (int i = 0; i < numAttributes; i++) {
        shader.disableVertexAttribute(attributes.get(i).alias);
      }
    } else {
      for (int i = 0; i < numAttributes; i++) {
        final int location = locations[i];
        if (location >= 0)
          shader.disableVertexAttribute(location);
      }
    }
    gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
    isBound = false;
  }
View Full Code Here

  public void dispose () {
    if (Gdx.gl20 != null) {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL20 gl = Gdx.gl20;
      gl.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    } else {
      tmpHandle.clear();
      tmpHandle.put(bufferHandle);
      tmpHandle.flip();
      GL11 gl = Gdx.gl11;
      gl.glBindBuffer(GL11.GL_ARRAY_BUFFER, 0);
      gl.glDeleteBuffers(1, tmpHandle);
      bufferHandle = 0;
    }
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.GL20

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.