Sha256: d8c6209ccf8d7d11d78b060fbaa58f1e3e28efaf12beb61a907fc3d0be91366e

Contents?: true

Size: 532 Bytes

Versions: 9

Compression:

Stored size: 532 Bytes

Contents

# -*- coding: utf-8 -*-


require 'xot/block_util'
require 'rays/ext'


module Rays


  class Shader

    def initialize (source = nil, **uniforms, &block)
      if source
        setup source
        uniform **uniforms unless uniforms.empty?
      end

      Xot::BlockUtil.instance_eval_or_block_call self, &block if block
    end

    def uniform (name = nil, *args, **uniforms)
      set_uniform name, *args if name
      uniforms.each do |key, value|
        set_uniform key, value
      end
    end

  end# Shader


end# Rays

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rays-0.1.21 lib/rays/shader.rb
rays-0.1.20 lib/rays/shader.rb
rays-0.1.19 lib/rays/shader.rb
rays-0.1.18 lib/rays/shader.rb
rays-0.1.17 lib/rays/shader.rb
rays-0.1.16 lib/rays/shader.rb
rays-0.1.15 lib/rays/shader.rb
rays-0.1.14 lib/rays/shader.rb
rays-0.1.13 lib/rays/shader.rb