Class AWTTextureIO


  • public class AWTTextureIO
    extends TextureIO
    • Constructor Detail

      • AWTTextureIO

        public AWTTextureIO()
    • Method Detail

      • newTextureData

        public static TextureData newTextureData​(GLProfile glp,
                                                 BufferedImage image,
                                                 boolean mipmap)
        Creates a TextureData from the given BufferedImage. Does no OpenGL work. We assume a desktop GLProfile GL2GL3, otherwise use the other factory.
        Parameters:
        glp - the OpenGL Profile this texture data should be created for.
        image - the BufferedImage containing the texture data
        mipmap - whether mipmaps should be produced for this texture by autogenerating them
        Returns:
        the texture data from the image
        See Also:
        newTextureData(GLProfile, BufferedImage, boolean)
      • newTextureData

        public static TextureData newTextureData​(GLProfile glp,
                                                 BufferedImage image,
                                                 int internalFormat,
                                                 int pixelFormat,
                                                 boolean mipmap)
                                          throws IllegalArgumentException
        Creates a TextureData from the given BufferedImage, using the specified OpenGL internal format and pixel format for the texture which will eventually result. The internalFormat and pixelFormat must be specified and may not be zero; to use default values, use the variant of this method which does not take these arguments. Does no OpenGL work.
        Parameters:
        glp - the OpenGL Profile this texture data should be created for.
        image - the BufferedImage containing the texture data
        internalFormat - the OpenGL internal format of the texture which will eventually result from the TextureData
        pixelFormat - the OpenGL pixel format of the texture which will eventually result from the TextureData
        mipmap - whether mipmaps should be produced for this texture either by autogenerating them or reading them from the file. Some file formats support multiple mipmaps in a single file in which case those mipmaps will be used rather than generating them.
        Returns:
        the texture data from the image
        Throws:
        IllegalArgumentException - if either internalFormat or pixelFormat was 0
      • newTexture

        public static Texture newTexture​(GLProfile glp,
                                         BufferedImage image,
                                         boolean mipmap)
                                  throws GLException
        Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.
        Parameters:
        glp - the OpenGL Profile this texture data should be created for.
        image - the BufferedImage from which to read the texture data
        mipmap - whether mipmaps should be produced for this texture by autogenerating them
        Throws:
        GLException - if no OpenGL context is current or if an OpenGL error occurred