Class: Raylib::Texture

Inherits:
FFI::Struct
  • Object
show all
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

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

#formatInteger

Data format (PixelFormat type)

Returns:

  • (Integer)

    format



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

#heightInteger

Texture base height

Returns:

  • (Integer)

    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

#idInteger

OpenGL texture id

Returns:

  • (Integer)

    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

#mipmapsInteger

Mipmap levels, 1 by default

Returns:

  • (Integer)

    mipmaps



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_sObject



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

#widthInteger

Texture base width

Returns:

  • (Integer)

    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