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); }
/** Used internally to reload after context loss. Creates a new GL handle then calls {@link #load(TextureData)}. Use this only * if you know what you do! */ @Override protected void reload () { if (!isManaged()) throw new GdxRuntimeException("Tried to reload unmanaged Texture"); glHandle = Gdx.gl.glGenTexture(); load(data); }
/** Used internally to reload after context loss. Creates a new GL handle then calls {@link #load(TextureData)}. Use this only * if you know what you do! */ @Override protected void reload () { if (!isManaged()) throw new GdxRuntimeException("Tried to reload unmanaged Texture"); glHandle = Gdx.gl.glGenTexture(); load(data); }
@Override public Texture loadSync (AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) { if (info == null) return null; Texture texture = info.texture; if (texture != null) { texture.load(info.data); } else { texture = new Texture(info.data); } if (parameter != null) { texture.setFilter(parameter.minFilter, parameter.magFilter); texture.setWrap(parameter.wrapU, parameter.wrapV); } return texture; }
@Override public Texture loadSync (AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) { if (info == null) return null; Texture texture = info.texture; if (texture != null) { texture.load(info.data); } else { texture = new Texture(info.data); } if (parameter != null) { texture.setFilter(parameter.minFilter, parameter.magFilter); texture.setWrap(parameter.wrapU, parameter.wrapV); } return texture; }
/** Creates the texture if it has not been created, else reuploads the entire page pixmap to the texture if the pixmap has * changed since this method was last called. * @return true if the texture was created or reuploaded. */ public boolean updateTexture (TextureFilter minFilter, TextureFilter magFilter, boolean useMipMaps) { if (texture != null) { if (!dirty) return false; texture.load(texture.getTextureData()); } else { texture = new Texture(new PixmapTextureData(image, image.getFormat(), useMipMaps, false, true)) { @Override public void dispose () { super.dispose(); image.dispose(); } }; texture.setFilter(minFilter, magFilter); } dirty = false; return true; } }
/** Creates the texture if it has not been created, else reuploads the entire page pixmap to the texture if the pixmap has * changed since this method was last called. * @return true if the texture was created or reuploaded. */ public boolean updateTexture (TextureFilter minFilter, TextureFilter magFilter, boolean useMipMaps) { if (texture != null) { if (!dirty) return false; texture.load(texture.getTextureData()); } else { texture = new Texture(new PixmapTextureData(image, image.getFormat(), useMipMaps, false, true)) { @Override public void dispose () { super.dispose(); image.dispose(); } }; texture.setFilter(minFilter, magFilter); } dirty = false; return true; } }
protected Texture (int glTarget, int glHandle, TextureData data) { super(glTarget, glHandle); load(data); if (data.isManaged()) addManagedTexture(Gdx.app, this); }
/** Used internally to reload after context loss. Creates a new GL handle then calls {@link #load(TextureData)}. Use this only * if you know what you do! */ @Override protected void reload () { if (!isManaged()) throw new GdxRuntimeException("Tried to reload unmanaged Texture"); glHandle = Gdx.gl.glGenTexture(); load(data); }
@Override public Texture loadSync (AssetManager manager, String fileName, FileHandle file, TextureParameter parameter) { if (info == null) return null; Texture texture = info.texture; if (texture != null) { texture.load(info.data); } else { texture = new Texture(info.data); } if (parameter != null) { texture.setFilter(parameter.minFilter, parameter.magFilter); texture.setWrap(parameter.wrapU, parameter.wrapV); } return texture; }
/** Creates the texture if it has not been created, else reuploads the entire page pixmap to the texture if the pixmap has * changed since this method was last called. * @return true if the texture was created or reuploaded. */ public boolean updateTexture (TextureFilter minFilter, TextureFilter magFilter, boolean useMipMaps) { if (texture != null) { if (!dirty) return false; texture.load(texture.getTextureData()); } else { texture = new Texture(new PixmapTextureData(image, image.getFormat(), useMipMaps, false, true)) { @Override public void dispose () { super.dispose(); image.dispose(); } }; texture.setFilter(minFilter, magFilter); } dirty = false; return true; } }