lib/mittsu/materials/material.rb in mittsu-0.1.1 vs lib/mittsu/materials/material.rb in mittsu-0.1.2
- old
+ new
@@ -1,11 +1,10 @@
require 'securerandom'
require 'mittsu'
-require 'mittsu/core/hash_object'
module Mittsu
- class Material < HashObject
+ class Material
include EventDispatcher
attr_reader :id, :uuid, :type
attr_accessor :name, :side, :opacity, :transparent, :blending, :blend_src, :blend_dst, :blend_equation, :blend_src_alpha, :blend_dst_alpha, :blend_equation_alpha, :depth_test, :depth_write, :color_write, :polygon_offset, :polygon_offset_factor, :polygon_offset_units, :alpha_test, :overdraw, :visible, :attributes, :shading, :program
@@ -132,9 +131,13 @@
dispatch_event type: :update
end
def dispose
dispatch_event type: :dispose
+ end
+
+ def implementation(renderer)
+ @_implementation ||= renderer.create_implementation(self)
end
private
def has_property?(key)