Class: Hemi::Render::Texture

Inherits:
Object
  • Object
show all
Defined in:
lib/hemi/render/texture.rb

Direct Known Subclasses

Font, Sprite

Constant Summary collapse

ERR__INVALID_POSITION =
"Ivalid position.".freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTexture

Returns a new instance of Texture.

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/hemi/render/texture.rb', line 5

def initialize
  raise NotImplementedError
end

Instance Attribute Details

#textureObject (readonly)

Returns the value of attribute texture.



9
10
11
# File 'lib/hemi/render/texture.rb', line 9

def texture
  @texture
end

Class Method Details

.[](name) ⇒ Object



20
21
22
# File 'lib/hemi/render/texture.rb', line 20

def [](name)
  public_send(bucket)[name] || new(name)
end

.bucketObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/hemi/render/texture.rb', line 28

def bucket
  raise NotImplementedError
end

.purge!Object



24
25
26
# File 'lib/hemi/render/texture.rb', line 24

def purge!
  instance_variable_set "@#{bucket}", {}
end

.register(name, texture) ⇒ Object



16
17
18
# File 'lib/hemi/render/texture.rb', line 16

def register(name, texture)
  public_send(bucket)[name] ||= texture
end

Instance Method Details

#renderObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/hemi/render/texture.rb', line 11

def render
  raise NotImplementedError
end