@Override public void glTexParameteri (int target, int pname, int param) { calls++; gl20.glTexParameteri(target, pname, param); check(); }
@Override public void glTexParameteri (int target, int pname, int param) { calls++; gl20.glTexParameteri(target, pname, param); check(); }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. Assumes the texture is bound and active! * @param u the u wrap * @param v the v wrap * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetWrap (TextureWrap u, TextureWrap v, boolean force) { if (u != null && (force || uWrap != u)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); uWrap = u; } if (v != null && (force || vWrap != v)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); vWrap = v; } }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. Assumes the texture is bound and active! * @param minFilter the minification filter * @param magFilter the magnification filter * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetFilter (TextureFilter minFilter, TextureFilter magFilter, boolean force) { if (minFilter != null && (force || this.minFilter != minFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); this.minFilter = minFilter; } if (magFilter != null && (force || this.magFilter != magFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); this.magFilter = magFilter; } }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. Assumes the texture is bound and active! * @param u the u wrap * @param v the v wrap * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetWrap (TextureWrap u, TextureWrap v, boolean force) { if (u != null && (force || uWrap != u)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); uWrap = u; } if (v != null && (force || vWrap != v)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); vWrap = v; } }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. Assumes the texture is bound and active! * @param minFilter the minification filter * @param magFilter the magnification filter * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetFilter (TextureFilter minFilter, TextureFilter magFilter, boolean force) { if (minFilter != null && (force || this.minFilter != minFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); this.minFilter = minFilter; } if (magFilter != null && (force || this.magFilter != magFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); this.magFilter = magFilter; } }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. This will bind this texture! * @param minFilter the minification filter * @param magFilter the magnification filter */ public void setFilter (TextureFilter minFilter, TextureFilter magFilter) { this.minFilter = minFilter; this.magFilter = magFilter; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. This will bind this texture! * @param minFilter the minification filter * @param magFilter the magnification filter */ public void setFilter (TextureFilter minFilter, TextureFilter magFilter) { this.minFilter = minFilter; this.magFilter = magFilter; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. This will bind this texture! * @param u the u wrap * @param v the v wrap */ public void setWrap (TextureWrap u, TextureWrap v) { this.uWrap = u; this.vWrap = v; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. This will bind this texture! * @param u the u wrap * @param v the v wrap */ public void setWrap (TextureWrap u, TextureWrap v) { this.uWrap = u; this.vWrap = v; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); }
public void render () { Gdx.gl20.glViewport(0, 0, Gdx.graphics.getBackBufferWidth(), Gdx.graphics.getBackBufferHeight()); Gdx.gl20.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0); texture.bind(); shader.begin(); shader.setUniformf("s_texture", 0); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MIN_FILTER, GL20.GL_NEAREST); shader.setUniformf("u_offset", -0.6f); mesh.render(shader, GL20.GL_TRIANGLES); Gdx.gl20.glTexParameteri(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MIN_FILTER, GL20.GL_LINEAR_MIPMAP_LINEAR); shader.setUniformf("u_offset", 0.6f); mesh.render(shader, GL20.GL_TRIANGLES); shader.end(); } }
@Override public void glTexParameteri(int target, int pname, int param) { Gdx.gl.glTexParameteri(target, pname, param); }
@Override public void glTexParameteri(int target, int pname, int param) { Gdx.gl.glTexParameteri(target, pname, param); }
@Override public void glTexParameteri (int target, int pname, int param) { calls++; gl20.glTexParameteri(target, pname, param); check(); }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. Assumes the texture is bound and active! * @param u the u wrap * @param v the v wrap * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetWrap (TextureWrap u, TextureWrap v, boolean force) { if (u != null && (force || uWrap != u)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); uWrap = u; } if (v != null && (force || vWrap != v)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); vWrap = v; } }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. Assumes the texture is bound and active! * @param minFilter the minification filter * @param magFilter the magnification filter * @param force True to always set the values, even if they are the same as the current values. */ public void unsafeSetFilter (TextureFilter minFilter, TextureFilter magFilter, boolean force) { if (minFilter != null && (force || this.minFilter != minFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); this.minFilter = minFilter; } if (magFilter != null && (force || this.magFilter != magFilter)) { Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); this.magFilter = magFilter; } }
/** Sets the {@link TextureFilter} for this texture for minification and magnification. This will bind this texture! * @param minFilter the minification filter * @param magFilter the magnification filter */ public void setFilter (TextureFilter minFilter, TextureFilter magFilter) { this.minFilter = minFilter; this.magFilter = magFilter; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MIN_FILTER, minFilter.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_MAG_FILTER, magFilter.getGLEnum()); }
/** Sets the {@link TextureWrap} for this texture on the u and v axis. This will bind this texture! * @param u the u wrap * @param v the v wrap */ public void setWrap (TextureWrap u, TextureWrap v) { this.uWrap = u; this.vWrap = v; bind(); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_S, u.getGLEnum()); Gdx.gl.glTexParameteri(glTarget, GL20.GL_TEXTURE_WRAP_T, v.getGLEnum()); }