Sha256: f4ecfc98d7ed4b789fa81f3225b297f5fe78285074f7087641f600bc342a5733

Contents?: true

Size: 749 Bytes

Versions: 2

Compression:

Stored size: 749 Bytes

Contents

module Mittsu
  class CompressedTexture
    def update_specific
      gl_format = GL::MITTSU_PARAMS[format]
      gl_type = GL::MITTSU_PARAMS[type]

      mipmaps.each_with_index do |mipmap, i|
        if format != RGBAFormat && format != RGBFormat
          if @renderer.compressed_texture_formats.include?(gl_format)
            GL.CompressedTexImage2D(GL::TEXTURE_2D, i, gl_format, mipmap.width, mipmap.height, 0, mipmap.data)
          else
            puts 'WARNING: Mittsu::Texture: Attempt to load unsupported compressed texture format in #update_texture'
          end
        else
          GL.TexImage2D(GL::TEXTURE_2D, i, gl_format, mipmap.width, mipmap.height, 0, gl_format, gl_type, mipmap.data)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl_implementation/textures/compressed_texture.rb
mittsu-opengl-0.5.0 lib/mittsu/opengl_implementation/textures/compressed_texture.rb