Class ResourcePool

java.lang.Object
dev.prozilla.pine.common.system.resource.ResourcePool

public final class ResourcePool extends Object
Represents a pool that manages resources efficiently, by avoiding loading resources multiple times.
  • Constructor Details

    • ResourcePool

      public ResourcePool()
  • Method Details

    • loadImage

      public static Image loadImage(String path) throws RuntimeException
      Loads an image from the resource pool or file system.
      Parameters:
      path - Path of the image file
      Returns:
      Image
      Throws:
      RuntimeException - If the image file fails to load.
    • loadTexture

      public static Texture loadTexture(String path) throws RuntimeException
      Loads a texture from the resource pool or file system.
      Parameters:
      path - Path of the texture's image file
      Returns:
      Texture
      Throws:
      RuntimeException - If the image file fails to load.
      RuntimeException - If OpenGL hasn't been initialized yet.
    • loadFont

      public static Font loadFont(String path)
    • loadFont

      public static Font loadFont(String path, int size)
    • clear

      public static void clear()
      Clears the resource pool.