Class: Raylib::Texture
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Raylib::Texture
- Defined in:
- lib/raylib/core/structs/texture.rb
Overview
Texture, tex data stored in GPU memory (VRAM)
Class Method Summary collapse
Instance Method Summary collapse
-
#format ⇒ Integer
Data format (PixelFormat type).
-
#format=(new_format) ⇒ Object
Sets Data format (PixelFormat type).
-
#height ⇒ Integer
Texture base height.
-
#height=(new_height) ⇒ Object
Sets Texture base height.
-
#id ⇒ Integer
OpenGL texture id.
-
#id=(new_id) ⇒ Object
Sets OpenGL texture id.
-
#mipmaps ⇒ Integer
Mipmap levels, 1 by default.
-
#mipmaps=(new_mipmaps) ⇒ Object
Sets Mipmap levels, 1 by default.
- #to_s ⇒ Object
-
#width ⇒ Integer
Texture base width.
-
#width=(new_width) ⇒ Object
Sets Texture base width.
Class Method Details
.create(id, width, height, mipmaps, format) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/raylib/core/structs/texture.rb', line 12 def self.create(id, width, height, mipmaps, format) new.tap do |instance| instance[:id] = id instance[:width] = width instance[:height] = height instance[:mipmaps] = mipmaps instance[:format] = format end end |
Instance Method Details
#format ⇒ Integer
Data format (PixelFormat type)
64 |
# File 'lib/raylib/core/structs/texture.rb', line 64 def format = self[:format] |
#format=(new_format) ⇒ Object
Sets Data format (PixelFormat type)
67 68 69 |
# File 'lib/raylib/core/structs/texture.rb', line 67 def format=(new_format) self[:format] = new_format end |
#height ⇒ Integer
Texture base height
46 |
# File 'lib/raylib/core/structs/texture.rb', line 46 def height = self[:height] |
#height=(new_height) ⇒ Object
Sets Texture base height
49 50 51 |
# File 'lib/raylib/core/structs/texture.rb', line 49 def height=(new_height) self[:height] = new_height end |
#id ⇒ Integer
OpenGL texture id
28 |
# File 'lib/raylib/core/structs/texture.rb', line 28 def id = self[:id] |
#id=(new_id) ⇒ Object
Sets OpenGL texture id
31 32 33 |
# File 'lib/raylib/core/structs/texture.rb', line 31 def id=(new_id) self[:id] = new_id end |
#mipmaps ⇒ Integer
Mipmap levels, 1 by default
55 |
# File 'lib/raylib/core/structs/texture.rb', line 55 def mipmaps = self[:mipmaps] |
#mipmaps=(new_mipmaps) ⇒ Object
Sets Mipmap levels, 1 by default
58 59 60 |
# File 'lib/raylib/core/structs/texture.rb', line 58 def mipmaps=(new_mipmaps) self[:mipmaps] = new_mipmaps end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/raylib/core/structs/texture.rb', line 22 def to_s "Raylib::Texture##{object_id} id=#{id} width=#{width} height=#{height} mipmaps=#{mipmaps} format=#{format}" end |
#width ⇒ Integer
Texture base width
37 |
# File 'lib/raylib/core/structs/texture.rb', line 37 def width = self[:width] |
#width=(new_width) ⇒ Object
Sets Texture base width
40 41 42 |
# File 'lib/raylib/core/structs/texture.rb', line 40 def width=(new_width) self[:width] = new_width end |