struct Gloop::Texture::BindTarget

Overview

Reference to a target that a texture can be bound to. Provides operations for working with textures bound to the target.

Included Modules

Defined in:

gloop/texture/bind_target.cr

Instance Method Summary

Instance Method Detail

def base_level : Int32 #

Retrieves the index of the minimum mipmap level.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_BASE_LEVEL
  • OpenGL version: 2.0

[View source]
def base_level=(base_level : Int32) #

Sets the index of the minimum mipmap level.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_BASE_LEVEL
  • OpenGL version: 2.0

[View source]
def bind(texture : Texture) : Nil #

Binds a texture to this target.

See: Texture#bind

  • OpenGL function: glBindTexture
  • OpenGL version: 2.0

[View source]
def bind(texture : Texture, &) #

Binds a texture to this target.

The previously bound texture (if any) is restored after the block completes.

See: Texture#bind

  • OpenGL function: glBindTexture
  • OpenGL version: 2.0

[View source]
def border_color(type : Float32.class) : FloatColorTuple #

Retrieves the border color.

  • OpenGL function: glGetTexParameterfv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 2.0

[View source]
def border_color(type : Int32.class) : Int32ColorTuple #

Retrieves the border color.

  • OpenGL function: glGetTexParameterIiv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 3.0

[View source]
def border_color(type : UInt32.class) : UInt32ColorTuple #

Retrieves the border color.

  • OpenGL function: glGetTexParameterIuiv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 3.0

[View source]
def border_color : Color #

Retrieves the border color.

  • OpenGL function: glGetTexParameterfv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 2.0

[View source]
def border_color=(color : Color) #

Sets the border color.

  • OpenGL function: glTexParameterfv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 2.0

[View source]
def border_color=(color : FloatColorTuple) #

Sets the border color.

  • OpenGL function: glTexParameterfv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 2.0

[View source]
def border_color=(color : Int32ColorTuple) #

Sets the border color.

  • OpenGL function: glTexParameterIiv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 3.0

[View source]
def border_color=(color : UInt32ColorTuple) #

Sets the border color.

  • OpenGL function: glTexParameterIuiv
  • OpenGL enum: GL_TEXTURE_BORDER_COLOR
  • OpenGL version: 3.0

[View source]
def compare_function : Gloop::DepthFunction #

Retrieves the texture comparison function.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_COMPARE_FUNC
  • OpenGL version: 2.0

[View source]
def compare_function=(compare_function : Gloop::DepthFunction) #

Sets the texture comparison function.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_COMPARE_FUNC
  • OpenGL version: 2.0

[View source]
def compare_mode : Gloop::Texture::CompareMode #

Retrieves the texture comparison mode.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_COMPARE_MODE
  • OpenGL version: 2.0

[View source]
def compare_mode=(compare_mode : Gloop::Texture::CompareMode) #

Sets the texture comparison mode.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_COMPARE_MODE
  • OpenGL version: 2.0

[View source]
def context : Context #

Context for this target.


[View source]
def depth_stencil_mode : Gloop::Texture::DepthStencilMode #

Retrieves the mode of operation for a texture using mixed depth and stencil data.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_DEPTH_STENCIL_TEXTURE_MODE
  • OpenGL version: 4.3

[View source]
def depth_stencil_mode=(depth_stencil_mode : Gloop::Texture::DepthStencilMode) #

Sets the mode of operation for a texture using mixed depth and stencil data.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_DEPTH_STENCIL_TEXTURE_MODE
  • OpenGL version: 4.3

[View source]
def generate_mipmap : Nil #

Generates a mipmap for the texture.

  • OpenGL function: glGenerateMipmap
  • OpenGL version: 3.0

[View source]
def lod_bias : Float32 #

Retrieves the LOD bias.

  • OpenGL function: glGetTexParameterf
  • OpenGL enum: GL_TEXTURE_LOD_BIAS
  • OpenGL version: 2.0

[View source]
def lod_bias=(lod_bias : Float32) #

Sets the LOD bias.

  • OpenGL function: glTexParameterf
  • OpenGL enum: GL_TEXTURE_LOD_BIAS
  • OpenGL version: 2.0

[View source]
def mag_filter : Gloop::Texture::MagFilter #

Retrieves the function that should be used when a texture is magnified.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_MAG_FILTER
  • OpenGL version: 2.0

[View source]
def mag_filter=(mag_filter : Gloop::Texture::MagFilter) #

Sets the function that should be used when a texture is magnified.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_MAG_FILTER
  • OpenGL version: 2.0

[View source]
def max_level : Int32 #

Retrieves the maximum mipmap level.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_MAX_LEVEL
  • OpenGL version: 2.0

[View source]
def max_level=(max_level : Int32) #

Sets the maximum mipmap level.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_MAX_LEVEL
  • OpenGL version: 2.0

[View source]
def max_lod : Float32 #

Retrieves the maximum level-of-detail.

  • OpenGL function: glGetTexParameterf
  • OpenGL enum: GL_TEXTURE_MAX_LOD
  • OpenGL version: 2.0

[View source]
def max_lod=(max_lod : Float32) #

Sets the maximum level-of-detail.

  • OpenGL function: glTexParameterf
  • OpenGL enum: GL_TEXTURE_MAX_LOD
  • OpenGL version: 2.0

[View source]
def min_filter : Gloop::Texture::MinFilter #

Retrieves the function that should be used when a texture is minified.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_MIN_FILTER
  • OpenGL version: 2.0

[View source]
def min_filter=(min_filter : Gloop::Texture::MinFilter) #

Sets the function that should be used when a texture is minified.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_MIN_FILTER
  • OpenGL version: 2.0

[View source]
def min_lod : Float32 #

Retrieves the minimum level-of-detail.

  • OpenGL function: glGetTexParameterf
  • OpenGL enum: GL_TEXTURE_MIN_LOD
  • OpenGL version: 2.0

[View source]
def min_lod=(min_lod : Float32) #

Sets the minimum level-of-detail.

  • OpenGL function: glTexParameterf
  • OpenGL enum: GL_TEXTURE_MIN_LOD
  • OpenGL version: 2.0

[View source]
def swizzle : SwizzleRGBA #

Retrieves all component swizzle values.

Components are returned in the order: red, green, blue, alpha.

  • OpenGL function: glGetTexParameterIiv
  • OpenGL enum: GL_TEXTURE_SWIZZLE
  • OpenGL version: 3.0

[View source]
def swizzle=(swizzle : SwizzleRGBA) #

Sets all component swizzle values.

  • OpenGL function: glTexParameteriv
  • OpenGL enum: GL_TEXTURE_SWIZZLE
  • OpenGL version: 2.0

[View source]
def swizzle_alpha : Gloop::Texture::Swizzle #

Retrieves the alpha component swizzle.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_SWIZZLE_A
  • OpenGL version: 2.0

[View source]
def swizzle_alpha=(swizzle_alpha : Gloop::Texture::Swizzle) #

Sets the alpha component swizzle.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_SWIZZLE_A
  • OpenGL version: 2.0

[View source]
def swizzle_blue : Gloop::Texture::Swizzle #

Retrieves the blue component swizzle.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_SWIZZLE_B
  • OpenGL version: 2.0

[View source]
def swizzle_blue=(swizzle_blue : Gloop::Texture::Swizzle) #

Sets the blue component swizzle.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_SWIZZLE_B
  • OpenGL version: 2.0

[View source]
def swizzle_green : Gloop::Texture::Swizzle #

Retrieves the green component swizzle.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_SWIZZLE_G
  • OpenGL version: 2.0

[View source]
def swizzle_green=(swizzle_green : Gloop::Texture::Swizzle) #

Sets the green component swizzle.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_SWIZZLE_G
  • OpenGL version: 2.0

[View source]
def swizzle_red : Gloop::Texture::Swizzle #

Retrieves the red component swizzle.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_SWIZZLE_R
  • OpenGL version: 2.0

[View source]
def swizzle_red=(swizzle_red : Gloop::Texture::Swizzle) #

Sets the red component swizzle.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_SWIZZLE_R
  • OpenGL version: 2.0

[View source]
def target : Target #

Target this binding refers to.


[View source]
def texture : Texture #

Retrieves the texture currently bound to this target.

Returns .none if no texture is bound.

  • OpenGL function: glGetIntegerv
  • OpenGL version: 2.0

[View source]
def texture? : Texture? #

Retrieves the texture currently bound to this target.

Returns nil if no texture is bound.

  • OpenGL function: glGetIntegerv
  • OpenGL version: 2.0

[View source]
def to_unsafe #

Returns an OpenGL enum representing this texture binding target.


[View source]
def unbind : Nil #

Unbinds any previously bound texture from this target.

  • OpenGL function: glBindTexture
  • OpenGL version: 2.0

[View source]
def update_1d(width : Int32, internal_format : ImageFormat, format : PixelFormat, type : PixelType, data : Pointer, level = 0) : Nil #

Stores one-dimensional data in the texture.

  • OpenGL function: glTexImage1D
  • OpenGL version: 2.0

[View source]
def update_1d(width : Int32, internal_format : Symbol, format : Symbol, type : Symbol, data : Pointer, level = 0) : Nil #

Stores one-dimensional data in the texture.

  • OpenGL function: glTexImage1D
  • OpenGL version: 2.0

[View source]
def update_2d(width : Int32, height : Int32, internal_format : ImageFormat, format : PixelFormat, type : PixelType, data : Pointer, level = 0) : Nil #

Stores two-dimensional data in the texture.

  • OpenGL function: glTexImage2D
  • OpenGL version: 2.0

[View source]
def update_2d(width : Int32, height : Int32, internal_format : Symbol, format : Symbol, type : Symbol, data : Pointer, level = 0) : Nil #

Stores two-dimensional data in the texture.

  • OpenGL function: glTexImage2D
  • OpenGL version: 2.0

[View source]
def update_3d(width : Int32, height : Int32, depth : Int32, internal_format : ImageFormat, format : PixelFormat, type : PixelType, data : Pointer, level = 0) : Nil #

Stores three-dimensional data in the texture.

  • OpenGL function: glTexImage3D
  • OpenGL version: 2.0

[View source]
def update_3d(width : Int32, height : Int32, depth : Int32, internal_format : Symbol, format : Symbol, type : Symbol, data : Pointer, level = 0) : Nil #

Stores three-dimensional data in the texture.

  • OpenGL function: glTexImage3D
  • OpenGL version: 2.0

[View source]

Retrieves the wrapping mode for the r-coordinate.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_WRAP_R
  • OpenGL version: 2.0

[View source]
def wrap_r=(wrap_r : Gloop::Texture::WrapMode) #

Sets the wrapping mode for the r-coordinate.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_WRAP_R
  • OpenGL version: 2.0

[View source]

Retrieves the wrapping mode for the s-coordinate.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_WRAP_S
  • OpenGL version: 2.0

[View source]
def wrap_s=(wrap_s : Gloop::Texture::WrapMode) #

Sets the wrapping mode for the s-coordinate.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_WRAP_S
  • OpenGL version: 2.0

[View source]

Retrieves the wrapping mode for the t-coordinate.

  • OpenGL function: glGetTexParameteriv
  • OpenGL enum: GL_TEXTURE_WRAP_T
  • OpenGL version: 2.0

[View source]
def wrap_t=(wrap_t : Gloop::Texture::WrapMode) #

Sets the wrapping mode for the t-coordinate.

  • OpenGL function: glTexParameteri
  • OpenGL enum: GL_TEXTURE_WRAP_T
  • OpenGL version: 2.0

[View source]