Class: Raylib::RlVertexBuffer

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/raylib/rlgl/structs/rl_vertex_buffer.rb

Overview

Dynamic vertex buffers (position + texcoords + colors + indices arrays)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(element_count, vertices, texcoords, colors, indices, vao_id, vbo_id) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 14

def self.create(element_count, vertices, texcoords, colors, indices, vao_id, vbo_id)
  new.tap do |instance|
    instance[:elementCount] = element_count
    instance[:vertices] = vertices
    instance[:texcoords] = texcoords
    instance[:colors] = colors
    instance[:indices] = indices
    instance[:vaoId] = vao_id
    instance[:vboId] = vbo_id
  end
end

Instance Method Details

#colorsunsigned char *

Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)

Returns:

  • (unsigned char *)

    colors



59
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 59

def colors = self[:colors]

#colors=(new_colors) ⇒ Object

Sets Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)



62
63
64
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 62

def colors=(new_colors)
  self[:colors] = new_colors
end

#element_countInteger

Number of elements in the buffer (QUADS)

Returns:

  • (Integer)

    elementCount



32
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 32

def element_count = self[:elementCount]

#element_count=(new_element_count) ⇒ Object

Sets Number of elements in the buffer (QUADS)



35
36
37
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 35

def element_count=(new_element_count)
  self[:elementCount] = new_element_count
end

#indicesunsigned int *

Vertex indices (in case vertex data comes indexed) (6 indices per quad)

Returns:

  • (unsigned int *)

    indices



68
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 68

def indices = self[:indices]

#indices=(new_indices) ⇒ Object

Sets Vertex indices (in case vertex data comes indexed) (6 indices per quad)



71
72
73
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 71

def indices=(new_indices)
  self[:indices] = new_indices
end

#texcoordsfloat *

Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)

Returns:

  • (float *)

    texcoords



50
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 50

def texcoords = self[:texcoords]

#texcoords=(new_texcoords) ⇒ Object

Sets Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)



53
54
55
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 53

def texcoords=(new_texcoords)
  self[:texcoords] = new_texcoords
end

#to_sObject



26
27
28
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 26

def to_s
  "Raylib::RlVertexBuffer##{object_id} element_count=#{element_count} vertices=#{vertices} texcoords=#{texcoords} colors=#{colors} indices=#{indices} vao_id=#{vao_id} vbo_id=#{vbo_id}"
end

#vao_idInteger

OpenGL Vertex Array Object id

Returns:

  • (Integer)

    vaoId



77
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 77

def vao_id = self[:vaoId]

#vao_id=(new_vao_id) ⇒ Object

Sets OpenGL Vertex Array Object id



80
81
82
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 80

def vao_id=(new_vao_id)
  self[:vaoId] = new_vao_id
end

#vbo_idunsigned int[4]

OpenGL Vertex Buffer Objects id (4 types of vertex data)

Returns:

  • (unsigned int[4])

    vboId



86
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 86

def vbo_id = self[:vboId]

#vbo_id=(new_vbo_id) ⇒ Object

Sets OpenGL Vertex Buffer Objects id (4 types of vertex data)



89
90
91
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 89

def vbo_id=(new_vbo_id)
  self[:vboId] = new_vbo_id
end

#verticesfloat *

Vertex position (XYZ - 3 components per vertex) (shader-location = 0)

Returns:

  • (float *)

    vertices



41
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 41

def vertices = self[:vertices]

#vertices=(new_vertices) ⇒ Object

Sets Vertex position (XYZ - 3 components per vertex) (shader-location = 0)



44
45
46
# File 'lib/raylib/rlgl/structs/rl_vertex_buffer.rb', line 44

def vertices=(new_vertices)
  self[:vertices] = new_vertices
end