Module: Hate::Graphics::Manager

Defined in:
lib/hate/graphics/manager.rb

Class Method Summary collapse

Class Method Details

.add_camera(obj) ⇒ Object



56
57
58
# File 'lib/hate/graphics/manager.rb', line 56

def self.add_camera(obj)
  @cameras << obj
end

.add_light(obj) ⇒ Object



48
49
50
# File 'lib/hate/graphics/manager.rb', line 48

def self.add_light(obj)
  @lights << obj
end

.add_object(obj) ⇒ Object



32
33
34
# File 'lib/hate/graphics/manager.rb', line 32

def self.add_object(obj)
  @objects << obj
end

.add_shader(obj) ⇒ Object



40
41
42
# File 'lib/hate/graphics/manager.rb', line 40

def self.add_shader(obj)
  @shaders << obj
end

.default_cameraObject



64
65
66
67
68
69
# File 'lib/hate/graphics/manager.rb', line 64

def self.default_camera
  add_camera Hate::Graphics::Camera.new if @cameras.empty?
  @cameras.each do |obj|
    return obj if obj.is_default?
  end
end

.lightsObject



10
11
12
# File 'lib/hate/graphics/manager.rb', line 10

def self.lights
  @lights
end

.remove_camera(obj) ⇒ Object



60
61
62
# File 'lib/hate/graphics/manager.rb', line 60

def self.remove_camera(obj)
  @cameras.delete obj
end

.remove_light(obj) ⇒ Object



52
53
54
# File 'lib/hate/graphics/manager.rb', line 52

def self.remove_light(obj)
  @lights.delete obj
end

.remove_object(obj) ⇒ Object



36
37
38
# File 'lib/hate/graphics/manager.rb', line 36

def self.remove_object(obj)
  @objects.delete obj
end

.remove_shader(obj) ⇒ Object



44
45
46
# File 'lib/hate/graphics/manager.rb', line 44

def self.remove_shader(obj)
  @shaders.delete obj
end

.runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/hate/graphics/manager.rb', line 14

def self.run
  @cameras.each do |obj|
    obj.run
  end

  @objects.each do |obj|
    obj.run
  end
  
  @shaders.each do |obj|
    obj.run
  end
  
  @lights.each do |obj|
    obj.run
  end
end