@Override public boolean isManaged () { for (TextureData data : textureDatas) { if (!data.isManaged()) { return false; } } return true; } }
@Override public boolean isManaged () { for (TextureData data : this.data) if (!data.isManaged()) return false; return true; }
@Override public boolean isManaged () { for (TextureData data : this.data) if (!data.isManaged()) return false; return true; }
@Override public boolean isManaged () { for (TextureData data : textureDatas) { if (!data.isManaged()) { return false; } } return true; } }
/** @return whether this texture is managed or not. */ public boolean isManaged () { return data.isManaged(); }
/** @return whether this texture is managed or not. */ public boolean isManaged () { return data.isManaged(); }
/** Disposes all resources associated with the texture */ public void dispose () { // this is a hack. reason: we have to set the glHandle to 0 for textures that are // reloaded through the asset manager as we first remove (and thus dispose) the texture // and then reload it. the glHandle is set to 0 in invalidateAllTextures prior to // removal from the asset manager. if (glHandle == 0) return; delete(); if (data.isManaged()) if (managedTextures.get(Gdx.app) != null) managedTextures.get(Gdx.app).removeValue(this, true); }
/** Disposes all resources associated with the texture */ public void dispose () { // this is a hack. reason: we have to set the glHandle to 0 for textures that are // reloaded through the asset manager as we first remove (and thus dispose) the texture // and then reload it. the glHandle is set to 0 in invalidateAllTextures prior to // removal from the asset manager. if (glHandle == 0) return; delete(); if (data.isManaged()) if (managedTextures.get(Gdx.app) != null) managedTextures.get(Gdx.app).removeValue(this, true); }
protected Texture (int glTarget, int glHandle, TextureData data) { super(glTarget, glHandle); load(data); if (data.isManaged()) addManagedTexture(Gdx.app, this); }
protected Texture (int glTarget, int glHandle, TextureData data) { super(glTarget, glHandle); load(data); if (data.isManaged()) addManagedTexture(Gdx.app, this); }
public void load (TextureData data) { if (this.data != null && data.isManaged() != this.data.isManaged()) throw new GdxRuntimeException("New data must have the same managed status as the old data"); this.data = data; if (!data.isPrepared()) data.prepare(); bind(); uploadImageData(GL20.GL_TEXTURE_2D, data); unsafeSetFilter(minFilter, magFilter, true); unsafeSetWrap(uWrap, vWrap, true); Gdx.gl.glBindTexture(glTarget, 0); }
public void load (TextureData data) { if (this.data != null && data.isManaged() != this.data.isManaged()) throw new GdxRuntimeException("New data must have the same managed status as the old data"); this.data = data; if (!data.isPrepared()) data.prepare(); bind(); uploadImageData(GL20.GL_TEXTURE_2D, data); unsafeSetFilter(minFilter, magFilter, true); unsafeSetWrap(uWrap, vWrap, true); Gdx.gl.glBindTexture(glTarget, 0); }
/** Draws the given {@link Pixmap} to the texture at position x, y. No clipping is performed so you have to make sure that you * draw only inside the texture region. Note that this will only draw to mipmap level 0! * * @param pixmap The Pixmap * @param x The x coordinate in pixels * @param y The y coordinate in pixels */ public void draw (Pixmap pixmap, int x, int y) { if (data.isManaged()) throw new GdxRuntimeException("can't draw to a managed texture"); bind(); Gdx.gl.glTexSubImage2D(glTarget, 0, x, y, pixmap.getWidth(), pixmap.getHeight(), pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); }
/** Draws the given {@link Pixmap} to the texture at position x, y. No clipping is performed so you have to make sure that you * draw only inside the texture region. Note that this will only draw to mipmap level 0! * * @param pixmap The Pixmap * @param x The x coordinate in pixels * @param y The y coordinate in pixels */ public void draw (Pixmap pixmap, int x, int y) { if (data.isManaged()) throw new GdxRuntimeException("can't draw to a managed texture"); bind(); Gdx.gl.glTexSubImage2D(glTarget, 0, x, y, pixmap.getWidth(), pixmap.getHeight(), pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); }
@Override public boolean isManaged () { for (TextureData data : this.data) if (!data.isManaged()) return false; return true; }
@Override public boolean isManaged () { for (TextureData data : textureDatas) { if (!data.isManaged()) { return false; } } return true; } }
/** Disposes all resources associated with the texture */ public void dispose () { // this is a hack. reason: we have to set the glHandle to 0 for textures that are // reloaded through the asset manager as we first remove (and thus dispose) the texture // and then reload it. the glHandle is set to 0 in invalidateAllTextures prior to // removal from the asset manager. if (glHandle == 0) return; delete(); if (data.isManaged()) if (managedTextures.get(Gdx.app) != null) managedTextures.get(Gdx.app).removeValue(this, true); }
protected Texture (int glTarget, int glHandle, TextureData data) { super(glTarget, glHandle); load(data); if (data.isManaged()) addManagedTexture(Gdx.app, this); }
public void load (TextureData data) { if (this.data != null && data.isManaged() != this.data.isManaged()) throw new GdxRuntimeException("New data must have the same managed status as the old data"); this.data = data; if (!data.isPrepared()) data.prepare(); bind(); uploadImageData(GL20.GL_TEXTURE_2D, data); unsafeSetFilter(minFilter, magFilter, true); unsafeSetWrap(uWrap, vWrap, true); Gdx.gl.glBindTexture(glTarget, 0); }
/** Draws the given {@link Pixmap} to the texture at position x, y. No clipping is performed so you have to make sure that you * draw only inside the texture region. Note that this will only draw to mipmap level 0! * * @param pixmap The Pixmap * @param x The x coordinate in pixels * @param y The y coordinate in pixels */ public void draw (Pixmap pixmap, int x, int y) { if (data.isManaged()) throw new GdxRuntimeException("can't draw to a managed texture"); bind(); Gdx.gl.glTexSubImage2D(glTarget, 0, x, y, pixmap.getWidth(), pixmap.getHeight(), pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); }