java.lang.Object
com.marginallyclever.ro3.texture.TextureFactory

public class TextureFactory extends Object
TextureFactory loads textures from files.
  • Constructor Details

    • TextureFactory

      public TextureFactory()
  • Method Details

    • load

      public TextureWithMetadata load(String filename)
      Load a texture from a file.
      Parameters:
      filename - the file to load.
      Returns:
      the texture, or null if the file could not be loaded.
    • unloadAll

      public void unloadAll()

      Unloads all OpenGL textures so that they can be reloaded on the next call to GLAutoDrawable.display(). Does not free the underlying BufferedImage data.

      if this is called from a thread that has no OpenGL context a GLException will occur.

    • getAllSourcesForExport

      public List<String> getAllSourcesForExport()
      Returns:
      a list of all the sources used to load textures.
    • getPool

      Returns:
      a list of all the textures loaded.
    • getAllExtensions

      public List<FileFilter> getAllExtensions()
    • reset

      public void reset()
      Remove all textures from the pool.