Class TextureBuilder.Abstract<GL extends OGLGraphics>
java.lang.Object
com.blackrook.gloop.opengl.util.TextureBuilder.Abstract<GL>
- Type Parameters:
GL- the graphics implementation that this executes on.
- All Implemented Interfaces:
TextureBuilder
- Enclosing interface:
TextureBuilder
public abstract static class TextureBuilder.Abstract<GL extends OGLGraphics>
extends Object
implements TextureBuilder
Texture builder utility class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface TextureBuilder
TextureBuilder.Abstract<GL> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected booleanprotected intprotected booleanprotected GLprotected List<BufferedImage[]> protected TextureMagFilterprotected TextureMinFilterprotected TextureTargetTypeprotected TextureWrapTypeprotected TextureWrapTypeprotected TextureWrapType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTextureImage(BufferedImage... images) Adds one or more textures to a mipmap level.setAnisotropy(float anisotropy) Sets texture anisotropy level.setAutoGenerateMipMaps(boolean autoGenerateMipMaps) Sets if this generator auto-generates mipmaps on or after data transfer.setBorder(int texels) Sets the border size on the texture in texels.setCompressed(boolean enabled) Sets if the texture is stored in a compressed format.setFiltering(TextureMinFilter minFilter, TextureMagFilter magFilter) Sets the minification and magnification filter on the texture.setTargetType(TextureTargetType targetType) Sets the texture target type.setWrapping(TextureWrapType wrapS) Sets the wrapping on the texture.setWrapping(TextureWrapType wrapS, TextureWrapType wrapT) Sets the wrapping on the texture.setWrapping(TextureWrapType wrapS, TextureWrapType wrapT, TextureWrapType wrapR) Sets the wrapping on the texture.protected voidstore1D(OGL11Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) protected voidstore1DArray(OGL11Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat) protected voidstore2D(OGL11Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) protected voidstore2DArray(OGL12Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat) protected voidstore3D(OGL12Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat) protected voidstoreCube(OGL13Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TextureBuilder
create
-
Field Details
-
gl
-
targetType
-
minFilter
-
magFilter
-
wrapS
-
wrapT
-
wrapR
-
border
protected int border -
compressed
protected boolean compressed -
autoGenerateMipMaps
protected boolean autoGenerateMipMaps -
anisotropy
protected float anisotropy -
imageLevels
-
-
Constructor Details
-
Abstract
Creates a new Texture Builder with defaults set.- Parameters:
gl- the graphics implementation that created this (and will execute this).
-
-
Method Details
-
setTargetType
Description copied from interface:TextureBuilderSets the texture target type. By default, this isTextureTargetType.TEXTURE_2D.- Specified by:
setTargetTypein interfaceTextureBuilder- Parameters:
targetType- the target type to use.- Returns:
- this builder.
-
setFiltering
Description copied from interface:TextureBuilderSets the minification and magnification filter on the texture. By default, this isTextureMinFilter.NEARESTfor both.- Specified by:
setFilteringin interfaceTextureBuilder- Parameters:
minFilter- the minification filter to use.magFilter- the magnification filter to use.- Returns:
- this builder.
-
setBorder
Description copied from interface:TextureBuilderSets the border size on the texture in texels. By default, this is0.- Specified by:
setBorderin interfaceTextureBuilder- Parameters:
texels- the texel width.- Returns:
- this builder.
-
setWrapping
Description copied from interface:TextureBuilderSets the wrapping on the texture. By default, all wrapping isTextureWrapType.TILE.- Specified by:
setWrappingin interfaceTextureBuilder- Parameters:
wrapS- the S-coordinate wrap type.- Returns:
- this builder.
-
setWrapping
Description copied from interface:TextureBuilderSets the wrapping on the texture. By default, all wrapping isTextureWrapType.TILE.- Specified by:
setWrappingin interfaceTextureBuilder- Parameters:
wrapS- the S-coordinate wrap type.wrapT- the T-coordinate wrap type.- Returns:
- this builder.
-
setWrapping
public TextureBuilder setWrapping(TextureWrapType wrapS, TextureWrapType wrapT, TextureWrapType wrapR) Description copied from interface:TextureBuilderSets the wrapping on the texture. By default, all wrapping isTextureWrapType.TILE.- Specified by:
setWrappingin interfaceTextureBuilder- Parameters:
wrapS- the S-coordinate wrap type.wrapT- the T-coordinate wrap type.wrapR- the R-coordinate wrap type.- Returns:
- this builder.
-
setCompressed
Description copied from interface:TextureBuilderSets if the texture is stored in a compressed format. By default, this isfalse.- Specified by:
setCompressedin interfaceTextureBuilder- Parameters:
enabled- true to enable, false if disabled.- Returns:
- this builder.
-
setAutoGenerateMipMaps
Description copied from interface:TextureBuilderSets if this generator auto-generates mipmaps on or after data transfer. By default, this isfalse.- Specified by:
setAutoGenerateMipMapsin interfaceTextureBuilder- Parameters:
autoGenerateMipMaps- true to auto-generate mipmaps for this texture.- Returns:
- this builder.
-
setAnisotropy
Description copied from interface:TextureBuilderSets texture anisotropy level. By default, this is1.0f.- Specified by:
setAnisotropyin interfaceTextureBuilder- Parameters:
anisotropy- the anisotropy level (1.0f or less = no anisotropy).- Returns:
- this builder.
-
addTextureImage
Description copied from interface:TextureBuilderAdds one or more textures to a mipmap level.Each image in the batch past the first is considered part of the depth dimension (an array of 4 images implies a depth of 4, height of 4 if 1D Array). If texture cube, then this expects 6 textures in the order: PX, NX, PY, NY, PZ, NZ.
The first call to this is the topmost level, and each subsequent call is the next lower mipmap level. Every texture past the first one is ignored if mipmap auto-generation is enabled.
- Specified by:
addTextureImagein interfaceTextureBuilder- Parameters:
images- the image to add at this level.- Returns:
- this builder.
-
store1D
protected void store1D(OGL11Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) -
store2D
protected void store2D(OGL11Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) -
store1DArray
protected void store1DArray(OGL11Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat) -
store2DArray
protected void store2DArray(OGL12Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat) -
storeCube
protected void storeCube(OGL13Graphics gl, Function<BufferedImage, ByteBuffer> dataFunc, ColorFormat colorFormat, TextureFormat textureFormat) -
store3D
protected void store3D(OGL12Graphics gl, Function<BufferedImage[], ByteBuffer> dataArrayFunc, ColorFormat colorFormat, TextureFormat textureFormat)
-