Class: GlimR::Raw

Inherits:
SceneObject show all
Defined in:
lib/glimr/renderer/raw.rb

Overview

Raw is a SceneObject that calls its #renderer when applied.

Use for doing custom OpenGL calls and such.

Raw doesn’t work with the Viewport’s collapsing #render, so is pretty much useless at the moment.

Example:

r = Raw.new
r.renderer = lambda do
  puts 'Hi, I was just applied!'
end

Instance Attribute Summary collapse

Attributes inherited from SceneObject

#children, #drawables, #mtime, #parent, #viewport

Attributes included from EventListener

#event_listeners, #listener_count

Instance Method Summary collapse

Methods inherited from SceneObject

#<<, #absolute_geometry, #absolute_material, #absolute_shader, #absolute_texture, #absolute_transform, #absolute_transform_for_drawing, #add_drawables, #attach, #clone, #default_config, #detach, #detach_self, #initialize, #inspect, #pop_state, #push_state, #remove_drawables, #render, #replace_node, #root, #touch!, #visible

Methods included from Configurable

#default_config, #initialize

Methods included from EventListener

#add_event_listener, #decrement_listener_count, #dispatch_event, #event_root, #increment_listener_count, #initialize, #method_missing, #multicast_event, #process_event, #remove_event_listener

Constructor Details

This class inherits a constructor from GlimR::SceneObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class GlimR::EventListener

Instance Attribute Details

#rendererObject

Returns the value of attribute renderer.



24
25
26
# File 'lib/glimr/renderer/raw.rb', line 24

def renderer
  @renderer
end

Instance Method Details

#applyObject

Calls #renderer if renderer is set.



27
28
29
# File 'lib/glimr/renderer/raw.rb', line 27

def apply
  renderer.call if renderer
end