Package com.jogamp.opengl.util.texture

Examples of com.jogamp.opengl.util.texture.Texture


    this.gl = gl;
  }
 
  public Texture getTextureForFile(File file) {
   
    Texture result = availableTextures.get(file);
   
    if (result == null) {
     
      synchronized (this) {
       
View Full Code Here


          gl.glDisable(GL_ALPHA_TEST);
        }
       
        TextureData textureData = material.getTextureDataList().get(i);
       
        Texture texture = textureManager.getTextureForFile(textureData.file);
            texture.enable(gl); //TODO: should this be called every time?
            texture.bind(gl);
           
        /* enable anisotropic filtering (note: this could be a
         * per-texture setting, but currently isn't) */
       
            if (gl.isExtensionAvailable("GL_EXT_texture_filter_anisotropic")) {
View Full Code Here

    gl.glEnable(GL_TEXTURE_2D);
    gl.glActiveTexture(GL_TEXTURE0);
   
    gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
   
    Texture backgroundTexture =
        textureManager.getTextureForFile(backgroundImage);

    backgroundTexture.enable(gl);
    backgroundTexture.bind(gl);
   
    gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
   
    int texWidth = backgroundTexture.getImageWidth();
    int texHeight = backgroundTexture.getImageHeight();
   
    /* draw quad */
       
    gl.glBegin( GL_QUADS ); {
      gl.glTexCoord2f(
View Full Code Here

        gl3.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
    }

    private Texture initializeTexture(GL3 gl3) {

        Texture t = null;

        try {
            t = TextureIO.newTexture(this.getClass().getResource("/textures/texture.jpg"), false, ".jpg");

            t.setTexParameteri(gl3, GL3.GL_TEXTURE_MIN_FILTER, GL3.GL_LINEAR);
            t.setTexParameteri(gl3, GL3.GL_TEXTURE_MAG_FILTER, GL3.GL_LINEAR);
            t.setTexParameteri(gl3, GL3.GL_TEXTURE_WRAP_S, GL3.GL_CLAMP_TO_EDGE);
            t.setTexParameteri(gl3, GL3.GL_TEXTURE_WRAP_T, GL3.GL_CLAMP_TO_EDGE);

        } catch (IOException ex) {
            ex.printStackTrace();
        } catch (GLException ex) {
          ex.printStackTrace();
View Full Code Here

        this.currentWorld = currentWorld;
    }

    private void draw(GL2ES2 gl, Drawable drawable) {
        final Sprite sprite = sprites.get(drawable.getSpriteId());
        final Texture texture = textures.get(drawable.getSpriteId());
        texture.bind(gl);

        final int paddingRight = sprite.getPaddingRight() == null ? 0 : sprite.getPaddingRight();
        final int paddingBottom = sprite.getPaddingBottom() == null ? 0 : sprite.getPaddingBottom();

        if (CHECK_DRAWING_SEQUENCE) {
View Full Code Here

    @Override
    void apply(GL2 gl) {
        if (this == last) return;
        if (tex == null) {
            if (data == null) tex = new Texture(GL2.GL_TEXTURE_2D);
            else tex = new Texture(data);
        }
  if (data != last.data) {
            if (last.data == null) tex.enable();
            else if (data == null) tex.disable();
            tex.bind();
View Full Code Here

TOP

Related Classes of com.jogamp.opengl.util.texture.Texture

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.