@Override public int compareTo (TextureDescriptor<T> o) { if (o == this) return 0; int t1 = texture == null ? 0 : texture.glTarget; int t2 = o.texture == null ? 0 : o.texture.glTarget; if (t1 != t2) return t1 - t2; int h1 = texture == null ? 0 : texture.getTextureObjectHandle(); int h2 = o.texture == null ? 0 : o.texture.getTextureObjectHandle(); if (h1 != h2) return h1 - h2; if (minFilter != o.minFilter) return (minFilter == null ? 0 : minFilter.getGLEnum()) - (o.minFilter == null ? 0 : o.minFilter.getGLEnum()); if (magFilter != o.magFilter) return (magFilter == null ? 0 : magFilter.getGLEnum()) - (o.magFilter == null ? 0 : o.magFilter.getGLEnum()); if (uWrap != o.uWrap) return (uWrap == null ? 0 : uWrap.getGLEnum()) - (o.uWrap == null ? 0 : o.uWrap.getGLEnum()); if (vWrap != o.vWrap) return (vWrap == null ? 0 : vWrap.getGLEnum()) - (o.vWrap == null ? 0 : o.vWrap.getGLEnum()); return 0; } }
/** 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; } }
@Override public int hashCode () { long result = (texture == null ? 0 : texture.glTarget); result = 811 * result + (texture == null ? 0 : texture.getTextureObjectHandle()); result = 811 * result + (minFilter == null ? 0 : minFilter.getGLEnum()); result = 811 * result + (magFilter == null ? 0 : magFilter.getGLEnum()); result = 811 * result + (uWrap == null ? 0 : uWrap.getGLEnum()); result = 811 * result + (vWrap == null ? 0 : vWrap.getGLEnum()); return (int)(result ^ (result >> 32)); }
/** 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()); }
@Override public int compareTo (TextureDescriptor<T> o) { if (o == this) return 0; int t1 = texture == null ? 0 : texture.glTarget; int t2 = o.texture == null ? 0 : o.texture.glTarget; if (t1 != t2) return t1 - t2; int h1 = texture == null ? 0 : texture.getTextureObjectHandle(); int h2 = o.texture == null ? 0 : o.texture.getTextureObjectHandle(); if (h1 != h2) return h1 - h2; if (minFilter != o.minFilter) return (minFilter == null ? 0 : minFilter.getGLEnum()) - (o.minFilter == null ? 0 : o.minFilter.getGLEnum()); if (magFilter != o.magFilter) return (magFilter == null ? 0 : magFilter.getGLEnum()) - (o.magFilter == null ? 0 : o.magFilter.getGLEnum()); if (uWrap != o.uWrap) return (uWrap == null ? 0 : uWrap.getGLEnum()) - (o.uWrap == null ? 0 : o.uWrap.getGLEnum()); if (vWrap != o.vWrap) return (vWrap == null ? 0 : vWrap.getGLEnum()) - (o.vWrap == null ? 0 : o.vWrap.getGLEnum()); return 0; } }
@Override public int compareTo (TextureDescriptor<T> o) { if (o == this) return 0; int t1 = texture == null ? 0 : texture.glTarget; int t2 = o.texture == null ? 0 : o.texture.glTarget; if (t1 != t2) return t1 - t2; int h1 = texture == null ? 0 : texture.getTextureObjectHandle(); int h2 = o.texture == null ? 0 : o.texture.getTextureObjectHandle(); if (h1 != h2) return h1 - h2; if (minFilter != o.minFilter) return (minFilter == null ? 0 : minFilter.getGLEnum()) - (o.minFilter == null ? 0 : o.minFilter.getGLEnum()); if (magFilter != o.magFilter) return (magFilter == null ? 0 : magFilter.getGLEnum()) - (o.magFilter == null ? 0 : o.magFilter.getGLEnum()); if (uWrap != o.uWrap) return (uWrap == null ? 0 : uWrap.getGLEnum()) - (o.uWrap == null ? 0 : o.uWrap.getGLEnum()); if (vWrap != o.vWrap) return (vWrap == null ? 0 : vWrap.getGLEnum()) - (o.vWrap == null ? 0 : o.vWrap.getGLEnum()); return 0; } }
/** 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 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; } }
@Override public int hashCode () { long result = (texture == null ? 0 : texture.glTarget); result = 811 * result + (texture == null ? 0 : texture.getTextureObjectHandle()); result = 811 * result + (minFilter == null ? 0 : minFilter.getGLEnum()); result = 811 * result + (magFilter == null ? 0 : magFilter.getGLEnum()); result = 811 * result + (uWrap == null ? 0 : uWrap.getGLEnum()); result = 811 * result + (vWrap == null ? 0 : vWrap.getGLEnum()); return (int)(result ^ (result >> 32)); }
@Override public int hashCode () { long result = (texture == null ? 0 : texture.glTarget); result = 811 * result + (texture == null ? 0 : texture.getTextureObjectHandle()); result = 811 * result + (minFilter == null ? 0 : minFilter.getGLEnum()); result = 811 * result + (magFilter == null ? 0 : magFilter.getGLEnum()); result = 811 * result + (uWrap == null ? 0 : uWrap.getGLEnum()); result = 811 * result + (vWrap == null ? 0 : vWrap.getGLEnum()); return (int)(result ^ (result >> 32)); }
/** 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()); }