Sha256: 3423c54241475c8a875b5353c1dc989f1176ae7ab04b0377ea5efbeb7f688448

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

module Mittsu
  module OpenGL::Shader::UniformsUtils
    def self.merge(uniforms)
      merged = {}

      uniforms.each do |uniform|
        tmp = UniformsUtils.clone(uniform)

        next if tmp.nil?

        tmp.each do |(p, tmp_p)|
          merged[p] = tmp_p
        end
      end

      merged
    end

    def self.clone(uniforms_src)
      return if uniforms_src.nil?

      uniforms_dst = {}

      uniforms_src.each do |(u, uniform_src)|
        uniforms_dst[u] = uniform_src.clone
      end

      uniforms_dst
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mittsu-opengl-0.5.1 lib/mittsu/opengl/shader/uniforms_utils.rb
mittsu-opengl-0.5.0 lib/mittsu/opengl/shader/uniforms_utils.rb