Class TextureUtil

java.lang.Object
com.mojang.blaze3d.platform.TextureUtil

public class TextureUtil extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • MIN_MIPMAP_LEVEL

      public static final int MIN_MIPMAP_LEVEL
      See Also:
    • DEFAULT_IMAGE_BUFFER_SIZE

      private static final int DEFAULT_IMAGE_BUFFER_SIZE
      See Also:
  • Constructor Details

    • TextureUtil

      public TextureUtil()
  • Method Details

    • generateTextureId

      public static int generateTextureId()
    • releaseTextureId

      public static void releaseTextureId(int textureId)
    • prepareImage

      public static void prepareImage(int textureId, int width, int height)
    • prepareImage

      public static void prepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int width, int height)
    • prepareImage

      public static void prepareImage(int textureId, int mipmapLevel, int width, int height)
    • prepareImage

      public static void prepareImage(NativeImage.InternalGlFormat pixelFormat, int textureId, int mipmapLevel, int width, int height)
    • bind

      private static void bind(int textureId)
    • readResource

      public static ByteBuffer readResource(InputStream inputStream) throws IOException
      Throws:
      IOException
    • readResource

      private static ByteBuffer readResource(ReadableByteChannel channel, int size) throws IOException
      Throws:
      IOException
    • writeAsPNG

      public static void writeAsPNG(Path outputDir, String textureName, int textureId, int amount, int width, int height)
    • writeAsPNG

      public static void writeAsPNG(Path outputDir, String textureName, int textureId, int amount, int width, int height, @Nullable IntUnaryOperator function)
    • getDebugTexturePath

      public static Path getDebugTexturePath(Path basePath)
    • getDebugTexturePath

      public static Path getDebugTexturePath()