danini-the-panini/mittsu-opengl

View on GitHub
lib/mittsu/opengl/shader/chunk.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
module Mittsu
  class OpenGL::Shader
    Chunk = Hash.new do |chunks, key|
      file_name = "#{key.to_s}.glsl"
      file_path = File.join(__dir__, 'chunks', file_name)
      chunk = File.read(file_path)
      # chunk = "// #{chunk_name}\n#{chunk}"
      chunks[key] = chunk
    end
  end
end