struct Gloop::Texture
- Gloop::Texture
- Gloop::Object
- Struct
- Value
- Object
Overview
Collection of one or more images.
See: https://www.khronos.org/opengl/wiki/Texture
Included Modules
- Gloop::Parameters
Defined in:
gloop/texture.crgloop/texture/bind_target.cr
gloop/texture/compare_mode.cr
gloop/texture/depth_stencil_mode.cr
gloop/texture/mag_filter.cr
gloop/texture/min_filter.cr
gloop/texture/swizzle.cr
gloop/texture/target.cr
gloop/texture/wrap_mode.cr
Constructors
-
.create(context, type : Target) : self
Creates a new texture of the specified type.
-
.create(context, type : Symbol) : self
Creates a new texture of the specified type.
-
.generate(context) : self
Generates a new texture.
Class Method Summary
-
.delete(textures : Enumerable(self)) : Nil
Deletes multiple textures.
Instance Method Summary
-
#base_level : Int32
Retrieves the index of the minimum mipmap level.
-
#base_level=(base_level : Int32)
Sets the index of the minimum mipmap level.
-
#bind(target : Target | BindTarget) : Nil
Binds this texture to the specified target.
-
#bind(target : Symbol) : Nil
Binds this texture to the specified target.
-
#bind(target : Target, &) : Nil
Binds this texture to the specified target.
-
#bind(target : BindTarget, &)
Binds this texture to the specified target.
-
#bind(target : Symbol, &) : Nil
Binds this texture to the specified target.
-
#border_color(type : Float32.class) : FloatColorTuple
Retrieves the border color.
-
#border_color(type : Int32.class) : Int32ColorTuple
Retrieves the border color.
-
#border_color(type : UInt32.class) : UInt32ColorTuple
Retrieves the border color.
-
#border_color : Color
Retrieves the border color.
-
#border_color=(color : Color)
Sets the border color.
-
#border_color=(color : FloatColorTuple)
Sets the border color.
-
#border_color=(color : Int32ColorTuple)
Sets the border color.
-
#border_color=(color : UInt32ColorTuple)
Sets the border color.
-
#compare_function : Gloop::DepthFunction
Retrieves the texture comparison function.
-
#compare_function=(compare_function : Gloop::DepthFunction)
Sets the texture comparison function.
-
#compare_mode : Gloop::Texture::CompareMode
Retrieves the texture comparison mode.
-
#compare_mode=(compare_mode : Gloop::Texture::CompareMode)
Sets the texture comparison mode.
-
#delete
Deletes this texture.
-
#depth_stencil_mode : Gloop::Texture::DepthStencilMode
Retrieves the mode of operation for a texture using mixed depth and stencil data.
-
#depth_stencil_mode=(depth_stencil_mode : Gloop::Texture::DepthStencilMode)
Sets the mode of operation for a texture using mixed depth and stencil data.
-
#exists?
Checks if the texture is known by OpenGL.
-
#generate_mipmap : Nil
Generates a mipmap for the texture.
-
#lod_bias : Float32
Retrieves the LOD bias.
-
#lod_bias=(lod_bias : Float32)
Sets the LOD bias.
-
#mag_filter : Gloop::Texture::MagFilter
Retrieves the function that should be used when a texture is magnified.
-
#mag_filter=(mag_filter : Gloop::Texture::MagFilter)
Sets the function that should be used when a texture is magnified.
-
#max_level : Int32
Retrieves the maximum mipmap level.
-
#max_level=(max_level : Int32)
Sets the maximum mipmap level.
-
#max_lod : Float32
Retrieves the maximum level-of-detail.
-
#max_lod=(max_lod : Float32)
Sets the maximum level-of-detail.
-
#min_filter : Gloop::Texture::MinFilter
Retrieves the function that should be used when a texture is minified.
-
#min_filter=(min_filter : Gloop::Texture::MinFilter)
Sets the function that should be used when a texture is minified.
-
#min_lod : Float32
Retrieves the minimum level-of-detail.
-
#min_lod=(min_lod : Float32)
Sets the minimum level-of-detail.
-
#object_type
Indicates that this is a texture object.
-
#swizzle : SwizzleRGBA
Retrieves all component swizzle values.
-
#swizzle=(swizzle : SwizzleRGBA)
Sets all component swizzle values.
-
#swizzle_alpha : Gloop::Texture::Swizzle
Retrieves the alpha component swizzle.
-
#swizzle_alpha=(swizzle_alpha : Gloop::Texture::Swizzle)
Sets the alpha component swizzle.
-
#swizzle_blue : Gloop::Texture::Swizzle
Retrieves the blue component swizzle.
-
#swizzle_blue=(swizzle_blue : Gloop::Texture::Swizzle)
Sets the blue component swizzle.
-
#swizzle_green : Gloop::Texture::Swizzle
Retrieves the green component swizzle.
-
#swizzle_green=(swizzle_green : Gloop::Texture::Swizzle)
Sets the green component swizzle.
-
#swizzle_red : Gloop::Texture::Swizzle
Retrieves the red component swizzle.
-
#swizzle_red=(swizzle_red : Gloop::Texture::Swizzle)
Sets the red component swizzle.
-
#target : Gloop::Texture::Target
Retrieves the target (type) this texture is bound to.
-
#wrap_r : Gloop::Texture::WrapMode
Retrieves the wrapping mode for the r-coordinate.
-
#wrap_r=(wrap_r : Gloop::Texture::WrapMode)
Sets the wrapping mode for the r-coordinate.
-
#wrap_s : Gloop::Texture::WrapMode
Retrieves the wrapping mode for the s-coordinate.
-
#wrap_s=(wrap_s : Gloop::Texture::WrapMode)
Sets the wrapping mode for the s-coordinate.
-
#wrap_t : Gloop::Texture::WrapMode
Retrieves the wrapping mode for the t-coordinate.
-
#wrap_t=(wrap_t : Gloop::Texture::WrapMode)
Sets the wrapping mode for the t-coordinate.
Instance methods inherited from struct Gloop::Object
context : Context
context,
name : Name
name,
none?
none?,
object_type
object_type,
to_s(io)
to_s,
to_unsafe : UInt32
to_unsafe
Constructor methods inherited from struct Gloop::Object
new(context : Context, name : Name)
new,
none(context) : self
none
Instance methods inherited from module Gloop::Labelable
label : String
label,
label=(label : Nil)label=(label) label=, max_label_size : Int32 max_label_size, name name, object_type object_type
Constructor Detail
Creates a new texture of the specified type.
- OpenGL function:
glCreateTextures
- OpenGL version: 4.5
Creates a new texture of the specified type.
- OpenGL function:
glCreateTextures
- OpenGL version: 4.5
Generates a new texture.
The texture isn't assigned a type or resources until it is bound.
See: .create
- OpenGL function:
glGenTextures
- OpenGL version: 2.0
Class Method Detail
Deletes multiple textures.
- OpenGL function:
glDeleteTextures
- OpenGL version: 2.0
Instance Method Detail
Retrieves the index of the minimum mipmap level.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_BASE_LEVEL
- OpenGL version: 4.5
Sets the index of the minimum mipmap level.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_BASE_LEVEL
- OpenGL version: 4.5
Binds this texture to the specified target.
See: BindTarget#bind
- OpenGL function:
glBindTexture
- OpenGL version: 2.0
Binds this texture to the specified target.
See: BindTarget#bind
- OpenGL function:
glBindTexture
- OpenGL version: 2.0
Binds this texture to the specified target.
The previously bound texture (if any) is restored after the block completes.
See: BindTarget#bind
- OpenGL function:
glBindTexture
- OpenGL version: 2.0
Binds this texture to the specified target.
The previously bound texture (if any) is restored after the block completes.
See: BindTarget#bind
- OpenGL function:
glBindTexture
- OpenGL version: 2.0
Binds this texture to the specified target.
The previously bound texture (if any) is restored after the block completes.
See: BindTarget#bind
- OpenGL function:
glBindTexture
- OpenGL version: 2.0
Retrieves the border color.
- OpenGL function:
glGetTextureParameterfv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Retrieves the border color.
- OpenGL function:
glGetTextureParameterIiv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Retrieves the border color.
- OpenGL function:
glGetTextureParameterIuiv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Retrieves the border color.
- OpenGL function:
glGetTextureParameterfv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Sets the border color.
- OpenGL function:
glTextureParameterfv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Sets the border color.
- OpenGL function:
glTextureParameterfv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Sets the border color.
- OpenGL function:
glTextureParameterIiv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Sets the border color.
- OpenGL function:
glTextureParameterIuiv
- OpenGL enum:
GL_TEXTURE_BORDER_COLOR
- OpenGL version: 4.5
Retrieves the texture comparison function.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_COMPARE_FUNC
- OpenGL version: 4.5
Sets the texture comparison function.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_COMPARE_FUNC
- OpenGL version: 4.5
Retrieves the texture comparison mode.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_COMPARE_MODE
- OpenGL version: 4.5
Sets the texture comparison mode.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_COMPARE_MODE
- OpenGL version: 4.5
Retrieves the mode of operation for a texture using mixed depth and stencil data.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_DEPTH_STENCIL_TEXTURE_MODE
- OpenGL version: 4.5
Sets the mode of operation for a texture using mixed depth and stencil data.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_DEPTH_STENCIL_TEXTURE_MODE
- OpenGL version: 4.5
Checks if the texture is known by OpenGL.
- OpenGL function:
glIsTexture
- OpenGL version: 2.0
Generates a mipmap for the texture.
- OpenGL function:
glGenerateTextureMipmap
- OpenGL version: 4.5
Retrieves the LOD bias.
- OpenGL function:
glGetTextureParameterf
- OpenGL enum:
GL_TEXTURE_LOD_BIAS
- OpenGL version: 4.5
Sets the LOD bias.
- OpenGL function:
glTextureParameterf
- OpenGL enum:
GL_TEXTURE_LOD_BIAS
- OpenGL version: 4.5
Retrieves the function that should be used when a texture is magnified.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_MAG_FILTER
- OpenGL version: 4.5
Sets the function that should be used when a texture is magnified.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_MAG_FILTER
- OpenGL version: 4.5
Retrieves the maximum mipmap level.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_MAX_LEVEL
- OpenGL version: 4.5
Sets the maximum mipmap level.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_MAX_LEVEL
- OpenGL version: 4.5
Retrieves the maximum level-of-detail.
- OpenGL function:
glGetTextureParameterf
- OpenGL enum:
GL_TEXTURE_MAX_LOD
- OpenGL version: 4.5
Sets the maximum level-of-detail.
- OpenGL function:
glTextureParameterf
- OpenGL enum:
GL_TEXTURE_MAX_LOD
- OpenGL version: 4.5
Retrieves the function that should be used when a texture is minified.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_MIN_FILTER
- OpenGL version: 4.5
Sets the function that should be used when a texture is minified.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_MIN_FILTER
- OpenGL version: 4.5
Retrieves the minimum level-of-detail.
- OpenGL function:
glGetTextureParameterf
- OpenGL enum:
GL_TEXTURE_MIN_LOD
- OpenGL version: 4.5
Sets the minimum level-of-detail.
- OpenGL function:
glTextureParameterf
- OpenGL enum:
GL_TEXTURE_MIN_LOD
- OpenGL version: 4.5
Retrieves all component swizzle values.
Components are returned in the order: red, green, blue, alpha.
- OpenGL function:
glGetTextureParameterIiv
- OpenGL enum:
GL_TEXTURE_SWIZZLE
- OpenGL version: 4.5
Sets all component swizzle values.
- OpenGL function:
glTextureParameteriv
- OpenGL enum:
GL_TEXTURE_SWIZZLE
- OpenGL version: 4.5
Retrieves the alpha component swizzle.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_SWIZZLE_A
- OpenGL version: 4.5
Sets the alpha component swizzle.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_SWIZZLE_A
- OpenGL version: 4.5
Retrieves the blue component swizzle.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_SWIZZLE_B
- OpenGL version: 4.5
Sets the blue component swizzle.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_SWIZZLE_B
- OpenGL version: 4.5
Retrieves the green component swizzle.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_SWIZZLE_G
- OpenGL version: 4.5
Sets the green component swizzle.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_SWIZZLE_G
- OpenGL version: 4.5
Retrieves the red component swizzle.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_SWIZZLE_R
- OpenGL version: 4.5
Sets the red component swizzle.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_SWIZZLE_R
- OpenGL version: 4.5
Retrieves the target (type) this texture is bound to.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_TARGET
- OpenGL version: 4.5
Retrieves the wrapping mode for the r-coordinate.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_WRAP_R
- OpenGL version: 4.5
Sets the wrapping mode for the r-coordinate.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_WRAP_R
- OpenGL version: 4.5
Retrieves the wrapping mode for the s-coordinate.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_WRAP_S
- OpenGL version: 4.5
Sets the wrapping mode for the s-coordinate.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_WRAP_S
- OpenGL version: 4.5
Retrieves the wrapping mode for the t-coordinate.
- OpenGL function:
glGetTextureParameteriv
- OpenGL enum:
GL_TEXTURE_WRAP_T
- OpenGL version: 4.5
Sets the wrapping mode for the t-coordinate.
- OpenGL function:
glTextureParameteri
- OpenGL enum:
GL_TEXTURE_WRAP_T
- OpenGL version: 4.5