public interface JCGLTextures2DType
Modifier and Type | Method and Description |
---|---|
JCGLTexture2DType |
texture2DAllocate(JCGLTextureUnitType unit,
long width,
long height,
JCGLTextureFormat format,
JCGLTextureWrapS wrap_s,
JCGLTextureWrapT wrap_t,
JCGLTextureFilterMinification min_filter,
JCGLTextureFilterMagnification mag_filter)
Allocate a texture of width
width and height height of
format format , binding it to unit . |
void |
texture2DBind(JCGLTextureUnitType unit,
JCGLTexture2DUsableType texture)
Bind the texture
texture to the texture unit unit . |
void |
texture2DDelete(JCGLTexture2DType texture)
Deletes the texture referenced by
texture . |
ByteBuffer |
texture2DGetImage(JCGLTextureUnitType unit,
JCGLTexture2DUsableType texture)
Fetch image data for the given texture.
|
boolean |
texture2DIsBound(JCGLTextureUnitType unit,
JCGLTexture2DUsableType texture) |
boolean |
texture2DIsBoundAnywhere(JCGLTexture2DUsableType texture) |
void |
texture2DRegenerateMipmaps(JCGLTextureUnitType unit)
Regenerate the mipmaps for the 2D texture bound to the texture unit
unit . |
void |
texture2DUpdate(JCGLTextureUnitType unit,
JCGLTexture2DUpdateType data)
Replace the contents (or part of the contents) of the texture
data.getTexture() with data . |
void texture2DBind(JCGLTextureUnitType unit, JCGLTexture2DUsableType texture) throws JCGLException
texture
to the texture unit unit
. Any
existing bound texture (of any type) is unbound.unit
- The texture unittexture
- The textureJCGLException
- Iff an OpenGL error occursJCGLTexturesType.textureUnitUnbind(JCGLTextureUnitType)
void texture2DDelete(JCGLTexture2DType texture) throws JCGLException
texture
.texture
- The textureJCGLException
- Iff an OpenGL error occursboolean texture2DIsBound(JCGLTextureUnitType unit, JCGLTexture2DUsableType texture) throws JCGLException
unit
- The texture unittexture
- The texturetrue
iff the texture texture
is bound to the
texture unit unit
.JCGLException
- Iff an OpenGL error occursboolean texture2DIsBoundAnywhere(JCGLTexture2DUsableType texture) throws JCGLException
texture
- The texturetrue
iff the texture texture
is bound to any
texture unit.JCGLException
- Iff an OpenGL error occursJCGLTexture2DType texture2DAllocate(JCGLTextureUnitType unit, long width, long height, JCGLTextureFormat format, JCGLTextureWrapS wrap_s, JCGLTextureWrapT wrap_t, JCGLTextureFilterMinification min_filter, JCGLTextureFilterMagnification mag_filter) throws JCGLException
Allocate a texture of width width
and height height
of
format format
, binding it to unit
.
The texture is wrapped around the s
axis using the wrapping mode
wrap_s
, with the OpenGL default being TEXTURE_WRAP_REPEAT
.
The texture is wrapped around the t
axis using the wrapping mode
wrap_t
, with the OpenGL default being TEXTURE_WRAP_REPEAT
.
The texture is scaled down using the minification filter min_filter
, with the OpenGL default being TEXURE_FILTER_LINEAR
.
The texture is scaled up using the magnification filter mag_filter
, with the OpenGL default being TEXTURE_FILTER_LINEAR
.
unit
- The texture unit to which the texture will be initially
boundwidth
- The width in pixelsheight
- The height in pixelsformat
- The texture formatwrap_s
- The method with which to wrap textures around the s
axiswrap_t
- The method with which to wrap textures around the t
axismin_filter
- The minification filtermag_filter
- The magnification filterJCGLException
- Iff an OpenGL error occursvoid texture2DUpdate(JCGLTextureUnitType unit, JCGLTexture2DUpdateType data) throws JCGLException
Replace the contents (or part of the contents) of the texture data.getTexture()
with data
.
Updating a texture requires binding and unbinding textures, and the
given unit
will be used to perform the update, breaking any
associated bindings for that unit. The updated texture will remain bound to
unit
when the function returns.
unit
- The texture unit that will be used to perform the updatedata
- The data to uploadJCGLException
- Iff an OpenGL error occursByteBuffer texture2DGetImage(JCGLTextureUnitType unit, JCGLTexture2DUsableType texture) throws JCGLException
Fetch image data for the given texture.
Fetching texture data requires binding and unbinding textures, and the
given unit
will be used to perform the retrieval, breaking any
associated bindings for that unit. The texture will remain bound to unit
when the function returns.
unit
- The texture unit that will be used to fetch the datatexture
- The texturetexture
JCGLException
- Iff an OpenGL error occursvoid texture2DRegenerateMipmaps(JCGLTextureUnitType unit) throws JCGLException
unit
. If the texture does not have mipmaps, the function has no effect.unit
- The texture unitJCGLException
- Iff an OpenGL error occursCopyright © 2017 <code@io7m.com> http://io7m.com