Class: Mittsu::DataTexture

Inherits:
Texture
  • Object
show all
Defined in:
lib/mittsu/textures/data_texture.rb

Constant Summary

Constants inherited from Texture

Texture::DEFAULT_IMAGE, Texture::DEFAULT_MAPPING

Instance Attribute Summary

Attributes inherited from Texture

#anisotropy, #filp_y, #format, #generate_mipmaps, #id, #image, #mag_filter, #mapping, #min_filter, #mipmaps, #name, #offset, #on_update, #premultiply_alpha, #repeat, #source_file, #type, #unpack_alignment, #uuid, #wrap_s, #wrap_t

Instance Method Summary collapse

Methods inherited from Texture

#dispose, #needs_update=, #needs_update?, #update

Methods included from EventDispatcher

#add_event_listener, #dispatch_event, #has_event_listener, #remove_event_listener

Constructor Details

#initialize(data = nil, width = nil, height = nil, format = RGBAFormat, type = UnsignedByteType, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, anisotropy = 1) ⇒ DataTexture

Returns a new instance of DataTexture.



5
6
7
8
9
# File 'lib/mittsu/textures/data_texture.rb', line 5

def initialize(data = nil, width = nil, height = nil, format = RGBAFormat, type = UnsignedByteType, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, anisotropy = 1)
  super(null, mapping, wrap_s, wrap_t, mag_filter, min_filter, format, type, anisotropy)

  @image = { data: data, width: width, height: height }
end

Instance Method Details

#cloneObject



11
12
13
14
15
# File 'lib/mittsu/textures/data_texture.rb', line 11

def clone
  texture = DataTexture.new
  super(texture)
  texture
end