Class: Mittsu::CompressedTexture
- Defined in:
- lib/mittsu/textures/compressed_texture.rb
Constant Summary
Constants inherited from Texture
Texture::DEFAULT_IMAGE, Texture::DEFAULT_MAPPING
Instance Attribute Summary collapse
-
#mipmaps ⇒ Object
Returns the value of attribute mipmaps.
Attributes inherited from Texture
#anisotropy, #filp_y, #format, #generate_mipmaps, #id, #image, #mag_filter, #mapping, #min_filter, #name, #offset, #on_update, #premultiply_alpha, #repeat, #source_file, #type, #unpack_alignment, #uuid, #wrap_s, #wrap_t
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(mipmaps = 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) ⇒ CompressedTexture
constructor
A new instance of CompressedTexture.
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(mipmaps = 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) ⇒ CompressedTexture
Returns a new instance of CompressedTexture.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mittsu/textures/compressed_texture.rb', line 7 def initialize(mipmaps = 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 = { width: width, height: height } @mipmaps = mipmaps # no flipping for cube textures # (also flipping doesn't work for compressed textures ) @flip_y = false # can't generate mipmaps for compressed textures # mips must be embedded in DDS files @generate_mipmaps = false end |
Instance Attribute Details
#mipmaps ⇒ Object
Returns the value of attribute mipmaps.
5 6 7 |
# File 'lib/mittsu/textures/compressed_texture.rb', line 5 def mipmaps @mipmaps end |
Instance Method Details
#clone ⇒ Object
24 25 26 27 28 |
# File 'lib/mittsu/textures/compressed_texture.rb', line 24 def clone texture = CompressedTexture.new super(texture) texture end |