Package playn.core

Class Texture.Config

java.lang.Object
playn.core.Texture.Config
Enclosing class:
Texture

public static final class Texture.Config extends Object
Used to configure texture at creation time.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Default managed texture configuration: managed, no mipmaps, no repat, linear filters.
    final int
    The filter to use when this texture is scaled: GL_LINEAR or GL_NEAREST.
    final boolean
    Whether or not texture's lifecycle is automatically managed via reference counting.
    final int
    The filter to use when this texture is scaled: GL_LINEAR or GL_NEAREST.
    final boolean
    Whether texture has mipmaps generated.
    final boolean
    Whether texture is configured to repeat in this direction.
    final boolean
    Whether texture is configured to repeat in this direction.
    Default unmanaged texture configuration: unmanaged, no mipmaps, no repat, linear filters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Config(boolean managed, boolean repeatX, boolean repeatY, int minFilter, int magFilter, boolean mipmaps)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    repeat(boolean repeatX, boolean repeatY)
    Returns a copy of this config with repeatX, repeatY set as specified.
     
    int
    toTexHeight(int sourceHeight)
    Returns sourceHeight rounded up to a POT if necessary.
    int
    toTexWidth(int sourceWidth)
    Returns sourceWidth rounded up to a POT if necessary.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static Texture.Config DEFAULT
      Default managed texture configuration: managed, no mipmaps, no repat, linear filters.
    • UNMANAGED

      public static Texture.Config UNMANAGED
      Default unmanaged texture configuration: unmanaged, no mipmaps, no repat, linear filters.
    • managed

      public final boolean managed
      Whether or not texture's lifecycle is automatically managed via reference counting. If the texture will be used in an ImageLayer, it should be reference counted unless you are doing something special. Otherwise you can decide whether you want to use the reference counting mechanism or not.
    • repeatX

      public final boolean repeatX
      Whether texture is configured to repeat in this direction.
    • repeatY

      public final boolean repeatY
      Whether texture is configured to repeat in this direction.
    • minFilter

      public final int minFilter
      The filter to use when this texture is scaled: GL_LINEAR or GL_NEAREST.
    • magFilter

      public final int magFilter
      The filter to use when this texture is scaled: GL_LINEAR or GL_NEAREST.
    • mipmaps

      public final boolean mipmaps
      Whether texture has mipmaps generated.
  • Constructor Details

    • Config

      public Config(boolean managed, boolean repeatX, boolean repeatY, int minFilter, int magFilter, boolean mipmaps)
  • Method Details

    • repeat

      public Texture.Config repeat(boolean repeatX, boolean repeatY)
      Returns a copy of this config with repeatX, repeatY set as specified.
    • toTexWidth

      public int toTexWidth(int sourceWidth)
      Returns sourceWidth rounded up to a POT if necessary.
    • toTexHeight

      public int toTexHeight(int sourceHeight)
      Returns sourceHeight rounded up to a POT if necessary.
    • toString

      public String toString()
      Overrides:
      toString in class Object