raylib-bindings 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/raymath.rb CHANGED
@@ -23,12 +23,16 @@ module Raylib
23
23
  layout(
24
24
  :v, [:float, 3],
25
25
  )
26
+ def v = self[:v]
27
+ def v=(v) self[:v] = v end
26
28
  end
27
29
 
28
30
  class Float16 < FFI::Struct
29
31
  layout(
30
32
  :v, [:float, 16],
31
33
  )
34
+ def v = self[:v]
35
+ def v=(v) self[:v] = v end
32
36
  end
33
37
 
34
38
 
@@ -146,6 +150,12 @@ module Raylib
146
150
  # @return [float]
147
151
  [:Vector2Angle, :Vector2Angle, [Vector2.by_value, Vector2.by_value], :float],
148
152
 
153
+ # Vector2LineAngle
154
+ # @param start [Vector2]
155
+ # @param end [Vector2]
156
+ # @return [float]
157
+ [:Vector2LineAngle, :Vector2LineAngle, [Vector2.by_value, Vector2.by_value], :float],
158
+
149
159
  # Vector2Scale
150
160
  # @param v [Vector2]
151
161
  # @param scale [float]
data/lib/rlgl.rb CHANGED
@@ -13,181 +13,181 @@ module Raylib
13
13
 
14
14
  RLGL_VERSION = "4.2"
15
15
  RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192
16
- RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
17
- RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
18
- RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
19
- RL_TEXTURE_MIN_FILTER = 0x2801 # GL_TEXTURE_MIN_FILTER
20
- RL_TEXTURE_FILTER_NEAREST = 0x2600 # GL_NEAREST
21
- RL_TEXTURE_FILTER_LINEAR = 0x2601 # GL_LINEAR
22
- RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700 # GL_NEAREST_MIPMAP_NEAREST
16
+ RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
17
+ RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
18
+ RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
19
+ RL_TEXTURE_MIN_FILTER = 0x2801 # GL_TEXTURE_MIN_FILTER
20
+ RL_TEXTURE_FILTER_NEAREST = 0x2600 # GL_NEAREST
21
+ RL_TEXTURE_FILTER_LINEAR = 0x2601 # GL_LINEAR
22
+ RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700 # GL_NEAREST_MIPMAP_NEAREST
23
23
  RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702 # GL_NEAREST_MIPMAP_LINEAR
24
24
  RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 0x2701 # GL_LINEAR_MIPMAP_NEAREST
25
- RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703 # GL_LINEAR_MIPMAP_LINEAR
26
- RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000 # Anisotropic filter (custom identifier)
27
- RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000 # Texture mipmap bias, percentage ratio (custom identifier)
28
- RL_TEXTURE_WRAP_REPEAT = 0x2901 # GL_REPEAT
29
- RL_TEXTURE_WRAP_CLAMP = 0x812F # GL_CLAMP_TO_EDGE
30
- RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370 # GL_MIRRORED_REPEAT
31
- RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742 # GL_MIRROR_CLAMP_EXT
32
- RL_MODELVIEW = 0x1700 # GL_MODELVIEW
33
- RL_PROJECTION = 0x1701 # GL_PROJECTION
34
- RL_TEXTURE = 0x1702 # GL_TEXTURE
35
- RL_LINES = 0x0001 # GL_LINES
36
- RL_TRIANGLES = 0x0004 # GL_TRIANGLES
37
- RL_QUADS = 0x0007 # GL_QUADS
38
- RL_UNSIGNED_BYTE = 0x1401 # GL_UNSIGNED_BYTE
39
- RL_FLOAT = 0x1406 # GL_FLOAT
40
- RL_STREAM_DRAW = 0x88E0 # GL_STREAM_DRAW
41
- RL_STREAM_READ = 0x88E1 # GL_STREAM_READ
42
- RL_STREAM_COPY = 0x88E2 # GL_STREAM_COPY
43
- RL_STATIC_DRAW = 0x88E4 # GL_STATIC_DRAW
44
- RL_STATIC_READ = 0x88E5 # GL_STATIC_READ
45
- RL_STATIC_COPY = 0x88E6 # GL_STATIC_COPY
46
- RL_DYNAMIC_DRAW = 0x88E8 # GL_DYNAMIC_DRAW
47
- RL_DYNAMIC_READ = 0x88E9 # GL_DYNAMIC_READ
48
- RL_DYNAMIC_COPY = 0x88EA # GL_DYNAMIC_COPY
49
- RL_FRAGMENT_SHADER = 0x8B30 # GL_FRAGMENT_SHADER
50
- RL_VERTEX_SHADER = 0x8B31 # GL_VERTEX_SHADER
51
- RL_COMPUTE_SHADER = 0x91B9 # GL_COMPUTE_SHADER
52
- RL_ZERO = 0 # GL_ZERO
53
- RL_ONE = 1 # GL_ONE
54
- RL_SRC_COLOR = 0x0300 # GL_SRC_COLOR
55
- RL_ONE_MINUS_SRC_COLOR = 0x0301 # GL_ONE_MINUS_SRC_COLOR
56
- RL_SRC_ALPHA = 0x0302 # GL_SRC_ALPHA
57
- RL_ONE_MINUS_SRC_ALPHA = 0x0303 # GL_ONE_MINUS_SRC_ALPHA
58
- RL_DST_ALPHA = 0x0304 # GL_DST_ALPHA
59
- RL_ONE_MINUS_DST_ALPHA = 0x0305 # GL_ONE_MINUS_DST_ALPHA
60
- RL_DST_COLOR = 0x0306 # GL_DST_COLOR
61
- RL_ONE_MINUS_DST_COLOR = 0x0307 # GL_ONE_MINUS_DST_COLOR
62
- RL_SRC_ALPHA_SATURATE = 0x0308 # GL_SRC_ALPHA_SATURATE
63
- RL_CONSTANT_COLOR = 0x8001 # GL_CONSTANT_COLOR
64
- RL_ONE_MINUS_CONSTANT_COLOR = 0x8002 # GL_ONE_MINUS_CONSTANT_COLOR
65
- RL_CONSTANT_ALPHA = 0x8003 # GL_CONSTANT_ALPHA
66
- RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 # GL_ONE_MINUS_CONSTANT_ALPHA
67
- RL_FUNC_ADD = 0x8006 # GL_FUNC_ADD
68
- RL_FUNC_SUBTRACT = 0x800A # GL_FUNC_SUBTRACT
69
- RL_FUNC_REVERSE_SUBTRACT = 0x800B # GL_FUNC_REVERSE_SUBTRACT
70
- RL_BLEND_EQUATION = 0x8009 # GL_BLEND_EQUATION
71
- RL_BLEND_EQUATION_RGB = 0x8009 # GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
72
- RL_BLEND_EQUATION_ALPHA = 0x883D # GL_BLEND_EQUATION_ALPHA
73
- RL_BLEND_DST_RGB = 0x80C8 # GL_BLEND_DST_RGB
74
- RL_BLEND_SRC_RGB = 0x80C9 # GL_BLEND_SRC_RGB
75
- RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
76
- RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
77
- RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
25
+ RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703 # GL_LINEAR_MIPMAP_LINEAR
26
+ RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000 # Anisotropic filter (custom identifier)
27
+ RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000 # Texture mipmap bias, percentage ratio (custom identifier)
28
+ RL_TEXTURE_WRAP_REPEAT = 0x2901 # GL_REPEAT
29
+ RL_TEXTURE_WRAP_CLAMP = 0x812F # GL_CLAMP_TO_EDGE
30
+ RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370 # GL_MIRRORED_REPEAT
31
+ RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742 # GL_MIRROR_CLAMP_EXT
32
+ RL_MODELVIEW = 0x1700 # GL_MODELVIEW
33
+ RL_PROJECTION = 0x1701 # GL_PROJECTION
34
+ RL_TEXTURE = 0x1702 # GL_TEXTURE
35
+ RL_LINES = 0x0001 # GL_LINES
36
+ RL_TRIANGLES = 0x0004 # GL_TRIANGLES
37
+ RL_QUADS = 0x0007 # GL_QUADS
38
+ RL_UNSIGNED_BYTE = 0x1401 # GL_UNSIGNED_BYTE
39
+ RL_FLOAT = 0x1406 # GL_FLOAT
40
+ RL_STREAM_DRAW = 0x88E0 # GL_STREAM_DRAW
41
+ RL_STREAM_READ = 0x88E1 # GL_STREAM_READ
42
+ RL_STREAM_COPY = 0x88E2 # GL_STREAM_COPY
43
+ RL_STATIC_DRAW = 0x88E4 # GL_STATIC_DRAW
44
+ RL_STATIC_READ = 0x88E5 # GL_STATIC_READ
45
+ RL_STATIC_COPY = 0x88E6 # GL_STATIC_COPY
46
+ RL_DYNAMIC_DRAW = 0x88E8 # GL_DYNAMIC_DRAW
47
+ RL_DYNAMIC_READ = 0x88E9 # GL_DYNAMIC_READ
48
+ RL_DYNAMIC_COPY = 0x88EA # GL_DYNAMIC_COPY
49
+ RL_FRAGMENT_SHADER = 0x8B30 # GL_FRAGMENT_SHADER
50
+ RL_VERTEX_SHADER = 0x8B31 # GL_VERTEX_SHADER
51
+ RL_COMPUTE_SHADER = 0x91B9 # GL_COMPUTE_SHADER
52
+ RL_ZERO = 0 # GL_ZERO
53
+ RL_ONE = 1 # GL_ONE
54
+ RL_SRC_COLOR = 0x0300 # GL_SRC_COLOR
55
+ RL_ONE_MINUS_SRC_COLOR = 0x0301 # GL_ONE_MINUS_SRC_COLOR
56
+ RL_SRC_ALPHA = 0x0302 # GL_SRC_ALPHA
57
+ RL_ONE_MINUS_SRC_ALPHA = 0x0303 # GL_ONE_MINUS_SRC_ALPHA
58
+ RL_DST_ALPHA = 0x0304 # GL_DST_ALPHA
59
+ RL_ONE_MINUS_DST_ALPHA = 0x0305 # GL_ONE_MINUS_DST_ALPHA
60
+ RL_DST_COLOR = 0x0306 # GL_DST_COLOR
61
+ RL_ONE_MINUS_DST_COLOR = 0x0307 # GL_ONE_MINUS_DST_COLOR
62
+ RL_SRC_ALPHA_SATURATE = 0x0308 # GL_SRC_ALPHA_SATURATE
63
+ RL_CONSTANT_COLOR = 0x8001 # GL_CONSTANT_COLOR
64
+ RL_ONE_MINUS_CONSTANT_COLOR = 0x8002 # GL_ONE_MINUS_CONSTANT_COLOR
65
+ RL_CONSTANT_ALPHA = 0x8003 # GL_CONSTANT_ALPHA
66
+ RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 # GL_ONE_MINUS_CONSTANT_ALPHA
67
+ RL_FUNC_ADD = 0x8006 # GL_FUNC_ADD
68
+ RL_FUNC_SUBTRACT = 0x800A # GL_FUNC_SUBTRACT
69
+ RL_FUNC_REVERSE_SUBTRACT = 0x800B # GL_FUNC_REVERSE_SUBTRACT
70
+ RL_BLEND_EQUATION = 0x8009 # GL_BLEND_EQUATION
71
+ RL_BLEND_EQUATION_RGB = 0x8009 # GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
72
+ RL_BLEND_EQUATION_ALPHA = 0x883D # GL_BLEND_EQUATION_ALPHA
73
+ RL_BLEND_DST_RGB = 0x80C8 # GL_BLEND_DST_RGB
74
+ RL_BLEND_SRC_RGB = 0x80C9 # GL_BLEND_SRC_RGB
75
+ RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
76
+ RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
77
+ RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
78
78
 
79
79
  # Enum
80
80
 
81
81
  # enum rlGlVersion
82
82
  # OpenGL version
83
- RL_OPENGL_11 = 1 # OpenGL 1.1
84
- RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
85
- RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
86
- RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
83
+ RL_OPENGL_11 = 1 # OpenGL 1.1
84
+ RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
85
+ RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
86
+ RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
87
87
  RL_OPENGL_ES_20 = 5 # OpenGL ES 2.0 (GLSL 100)
88
88
 
89
89
  # enum rlTraceLogLevel
90
90
  # Trace log level
91
- RL_LOG_ALL = 0 # Display all logs
92
- RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
93
- RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
94
- RL_LOG_INFO = 3 # Info logging, used for program execution info
91
+ RL_LOG_ALL = 0 # Display all logs
92
+ RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
93
+ RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
94
+ RL_LOG_INFO = 3 # Info logging, used for program execution info
95
95
  RL_LOG_WARNING = 4 # Warning logging, used on recoverable failures
96
- RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
97
- RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
98
- RL_LOG_NONE = 7 # Disable logging
96
+ RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
97
+ RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
98
+ RL_LOG_NONE = 7 # Disable logging
99
99
 
100
100
  # enum rlPixelFormat
101
101
  # Texture pixel formats
102
- RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
103
- RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
104
- RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
105
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 # 24 bpp
106
- RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 # 16 bpp (1 bit alpha)
107
- RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 # 16 bpp (4 bit alpha)
108
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 # 32 bpp
109
- RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8 # 32 bpp (1 channel - float)
110
- RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 # 32*3 bpp (3 channels - float)
102
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
103
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
104
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
105
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 # 24 bpp
106
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 # 16 bpp (1 bit alpha)
107
+ RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 # 16 bpp (4 bit alpha)
108
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 # 32 bpp
109
+ RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8 # 32 bpp (1 channel - float)
110
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 # 32*3 bpp (3 channels - float)
111
111
  RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 # 32*4 bpp (4 channels - float)
112
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 # 4 bpp (no alpha)
113
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 # 4 bpp (1 bit alpha)
114
- RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 # 8 bpp
115
- RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 # 8 bpp
116
- RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 # 4 bpp
117
- RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 # 4 bpp
118
- RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 # 8 bpp
119
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 # 4 bpp
120
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
121
- RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
122
- RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
112
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 # 4 bpp (no alpha)
113
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 # 4 bpp (1 bit alpha)
114
+ RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 # 8 bpp
115
+ RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 # 8 bpp
116
+ RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 # 4 bpp
117
+ RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 # 4 bpp
118
+ RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 # 8 bpp
119
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 # 4 bpp
120
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
121
+ RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
122
+ RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
123
123
 
124
124
  # enum rlTextureFilter
125
125
  # Texture parameters: filter mode
126
- RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
127
- RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
128
- RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
129
- RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
130
- RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
126
+ RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
127
+ RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
128
+ RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
129
+ RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
130
+ RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
131
131
  RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5 # Anisotropic filtering 16x
132
132
 
133
133
  # enum rlBlendMode
134
134
  # Color blending modes (pre-defined)
135
- RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
136
- RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
137
- RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
138
- RL_BLEND_ADD_COLORS = 3 # Blend textures adding colors (alternative)
139
- RL_BLEND_SUBTRACT_COLORS = 4 # Blend textures subtracting colors (alternative)
135
+ RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
136
+ RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
137
+ RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
138
+ RL_BLEND_ADD_COLORS = 3 # Blend textures adding colors (alternative)
139
+ RL_BLEND_SUBTRACT_COLORS = 4 # Blend textures subtracting colors (alternative)
140
140
  RL_BLEND_ALPHA_PREMULTIPLY = 5 # Blend premultiplied textures considering alpha
141
- RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
142
- RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
141
+ RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
142
+ RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
143
143
 
144
144
  # enum rlShaderLocationIndex
145
145
  # Shader location point type
146
- RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
146
+ RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
147
147
  RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1 # Shader location: vertex attribute: texcoord01
148
148
  RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2 # Shader location: vertex attribute: texcoord02
149
- RL_SHADER_LOC_VERTEX_NORMAL = 3 # Shader location: vertex attribute: normal
150
- RL_SHADER_LOC_VERTEX_TANGENT = 4 # Shader location: vertex attribute: tangent
151
- RL_SHADER_LOC_VERTEX_COLOR = 5 # Shader location: vertex attribute: color
152
- RL_SHADER_LOC_MATRIX_MVP = 6 # Shader location: matrix uniform: model-view-projection
153
- RL_SHADER_LOC_MATRIX_VIEW = 7 # Shader location: matrix uniform: view (camera transform)
149
+ RL_SHADER_LOC_VERTEX_NORMAL = 3 # Shader location: vertex attribute: normal
150
+ RL_SHADER_LOC_VERTEX_TANGENT = 4 # Shader location: vertex attribute: tangent
151
+ RL_SHADER_LOC_VERTEX_COLOR = 5 # Shader location: vertex attribute: color
152
+ RL_SHADER_LOC_MATRIX_MVP = 6 # Shader location: matrix uniform: model-view-projection
153
+ RL_SHADER_LOC_MATRIX_VIEW = 7 # Shader location: matrix uniform: view (camera transform)
154
154
  RL_SHADER_LOC_MATRIX_PROJECTION = 8 # Shader location: matrix uniform: projection
155
- RL_SHADER_LOC_MATRIX_MODEL = 9 # Shader location: matrix uniform: model (transform)
156
- RL_SHADER_LOC_MATRIX_NORMAL = 10 # Shader location: matrix uniform: normal
157
- RL_SHADER_LOC_VECTOR_VIEW = 11 # Shader location: vector uniform: view
158
- RL_SHADER_LOC_COLOR_DIFFUSE = 12 # Shader location: vector uniform: diffuse color
159
- RL_SHADER_LOC_COLOR_SPECULAR = 13 # Shader location: vector uniform: specular color
160
- RL_SHADER_LOC_COLOR_AMBIENT = 14 # Shader location: vector uniform: ambient color
161
- RL_SHADER_LOC_MAP_ALBEDO = 15 # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
162
- RL_SHADER_LOC_MAP_METALNESS = 16 # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
163
- RL_SHADER_LOC_MAP_NORMAL = 17 # Shader location: sampler2d texture: normal
164
- RL_SHADER_LOC_MAP_ROUGHNESS = 18 # Shader location: sampler2d texture: roughness
165
- RL_SHADER_LOC_MAP_OCCLUSION = 19 # Shader location: sampler2d texture: occlusion
166
- RL_SHADER_LOC_MAP_EMISSION = 20 # Shader location: sampler2d texture: emission
167
- RL_SHADER_LOC_MAP_HEIGHT = 21 # Shader location: sampler2d texture: height
168
- RL_SHADER_LOC_MAP_CUBEMAP = 22 # Shader location: samplerCube texture: cubemap
169
- RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
170
- RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
171
- RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
155
+ RL_SHADER_LOC_MATRIX_MODEL = 9 # Shader location: matrix uniform: model (transform)
156
+ RL_SHADER_LOC_MATRIX_NORMAL = 10 # Shader location: matrix uniform: normal
157
+ RL_SHADER_LOC_VECTOR_VIEW = 11 # Shader location: vector uniform: view
158
+ RL_SHADER_LOC_COLOR_DIFFUSE = 12 # Shader location: vector uniform: diffuse color
159
+ RL_SHADER_LOC_COLOR_SPECULAR = 13 # Shader location: vector uniform: specular color
160
+ RL_SHADER_LOC_COLOR_AMBIENT = 14 # Shader location: vector uniform: ambient color
161
+ RL_SHADER_LOC_MAP_ALBEDO = 15 # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
162
+ RL_SHADER_LOC_MAP_METALNESS = 16 # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
163
+ RL_SHADER_LOC_MAP_NORMAL = 17 # Shader location: sampler2d texture: normal
164
+ RL_SHADER_LOC_MAP_ROUGHNESS = 18 # Shader location: sampler2d texture: roughness
165
+ RL_SHADER_LOC_MAP_OCCLUSION = 19 # Shader location: sampler2d texture: occlusion
166
+ RL_SHADER_LOC_MAP_EMISSION = 20 # Shader location: sampler2d texture: emission
167
+ RL_SHADER_LOC_MAP_HEIGHT = 21 # Shader location: sampler2d texture: height
168
+ RL_SHADER_LOC_MAP_CUBEMAP = 22 # Shader location: samplerCube texture: cubemap
169
+ RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
170
+ RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
171
+ RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
172
172
 
173
173
  # enum rlShaderUniformDataType
174
174
  # Shader uniform data type
175
- RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
176
- RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
177
- RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
178
- RL_SHADER_UNIFORM_VEC4 = 3 # Shader uniform type: vec4 (4 float)
179
- RL_SHADER_UNIFORM_INT = 4 # Shader uniform type: int
180
- RL_SHADER_UNIFORM_IVEC2 = 5 # Shader uniform type: ivec2 (2 int)
181
- RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
182
- RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
175
+ RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
176
+ RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
177
+ RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
178
+ RL_SHADER_UNIFORM_VEC4 = 3 # Shader uniform type: vec4 (4 float)
179
+ RL_SHADER_UNIFORM_INT = 4 # Shader uniform type: int
180
+ RL_SHADER_UNIFORM_IVEC2 = 5 # Shader uniform type: ivec2 (2 int)
181
+ RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
182
+ RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
183
183
  RL_SHADER_UNIFORM_SAMPLER2D = 8 # Shader uniform type: sampler2d
184
184
 
185
185
  # enum rlShaderAttributeDataType
186
186
  # Shader attribute data types
187
187
  RL_SHADER_ATTRIB_FLOAT = 0 # Shader attribute type: float
188
- RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
189
- RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
190
- RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
188
+ RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
189
+ RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
190
+ RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
191
191
 
192
192
  # enum rlFramebufferAttachType
193
193
  # Framebuffer attachment type
@@ -199,8 +199,8 @@ module Raylib
199
199
  RL_ATTACHMENT_COLOR_CHANNEL5 = 5 # Framebuffer attachment type: color 5
200
200
  RL_ATTACHMENT_COLOR_CHANNEL6 = 6 # Framebuffer attachment type: color 6
201
201
  RL_ATTACHMENT_COLOR_CHANNEL7 = 7 # Framebuffer attachment type: color 7
202
- RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachment type: depth
203
- RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachment type: stencil
202
+ RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachment type: depth
203
+ RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachment type: stencil
204
204
 
205
205
  # enum rlFramebufferAttachTextureType
206
206
  # Framebuffer texture attachment type
@@ -210,8 +210,8 @@ module Raylib
210
210
  RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 # Framebuffer texture attachment type: cubemap, -Y side
211
211
  RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 # Framebuffer texture attachment type: cubemap, +Z side
212
212
  RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 # Framebuffer texture attachment type: cubemap, -Z side
213
- RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
214
- RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
213
+ RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
214
+ RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
215
215
 
216
216
  # enum rlCullMode
217
217
  # Face culling mode
@@ -238,36 +238,70 @@ module Raylib
238
238
  # Dynamic vertex buffers (position + texcoords + colors + indices arrays)
239
239
  class RlVertexBuffer < FFI::Struct
240
240
  layout(
241
- :elementCount, :int, # Number of elements in the buffer (QUADS)
242
- :vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
241
+ :elementCount, :int, # Number of elements in the buffer (QUADS)
242
+ :vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
243
243
  :texcoords, :pointer, # Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
244
- :colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
245
- :indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad)
246
- :vaoId, :uint, # OpenGL Vertex Array Object id
247
- :vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
244
+ :colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
245
+ :indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad)
246
+ :vaoId, :uint, # OpenGL Vertex Array Object id
247
+ :vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
248
248
  )
249
+ def elementCount = self[:elementCount]
250
+ def elementCount=(v) self[:elementCount] = v end
251
+ def vertices = self[:vertices]
252
+ def vertices=(v) self[:vertices] = v end
253
+ def texcoords = self[:texcoords]
254
+ def texcoords=(v) self[:texcoords] = v end
255
+ def colors = self[:colors]
256
+ def colors=(v) self[:colors] = v end
257
+ def indices = self[:indices]
258
+ def indices=(v) self[:indices] = v end
259
+ def vaoId = self[:vaoId]
260
+ def vaoId=(v) self[:vaoId] = v end
261
+ def vboId = self[:vboId]
262
+ def vboId=(v) self[:vboId] = v end
249
263
  end
250
264
 
251
265
  # of those state-change happens (this is done in core module)
252
266
  class RlDrawCall < FFI::Struct
253
267
  layout(
254
- :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
255
- :vertexCount, :int, # Number of vertex of the draw
268
+ :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
269
+ :vertexCount, :int, # Number of vertex of the draw
256
270
  :vertexAlignment, :int, # Number of vertex required for index alignment (LINES, TRIANGLES)
257
- :textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
271
+ :textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
258
272
  )
273
+ def mode = self[:mode]
274
+ def mode=(v) self[:mode] = v end
275
+ def vertexCount = self[:vertexCount]
276
+ def vertexCount=(v) self[:vertexCount] = v end
277
+ def vertexAlignment = self[:vertexAlignment]
278
+ def vertexAlignment=(v) self[:vertexAlignment] = v end
279
+ def textureId = self[:textureId]
280
+ def textureId=(v) self[:textureId] = v end
259
281
  end
260
282
 
261
283
  # rlRenderBatch type
262
284
  class RlRenderBatch < FFI::Struct
263
285
  layout(
264
- :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
265
- :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
286
+ :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
287
+ :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
266
288
  :vertexBuffer, :pointer, # Dynamic buffer(s) for vertex data
267
- :draws, :pointer, # Draw calls array, depends on textureId
268
- :drawCounter, :int, # Draw calls counter
269
- :currentDepth, :float, # Current depth value for next draw
289
+ :draws, :pointer, # Draw calls array, depends on textureId
290
+ :drawCounter, :int, # Draw calls counter
291
+ :currentDepth, :float, # Current depth value for next draw
270
292
  )
293
+ def bufferCount = self[:bufferCount]
294
+ def bufferCount=(v) self[:bufferCount] = v end
295
+ def currentBuffer = self[:currentBuffer]
296
+ def currentBuffer=(v) self[:currentBuffer] = v end
297
+ def vertexBuffer = self[:vertexBuffer]
298
+ def vertexBuffer=(v) self[:vertexBuffer] = v end
299
+ def draws = self[:draws]
300
+ def draws=(v) self[:draws] = v end
301
+ def drawCounter = self[:drawCounter]
302
+ def drawCounter=(v) self[:drawCounter] = v end
303
+ def currentDepth = self[:currentDepth]
304
+ def currentDepth=(v) self[:currentDepth] = v end
271
305
  end
272
306
 
273
307
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: raylib-bindings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-28 00:00:00.000000000 Z
11
+ date: 2023-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  - !ruby/object:Gem::Version
91
91
  version: '0'
92
92
  requirements: []
93
- rubygems_version: 3.4.1
93
+ rubygems_version: 3.4.6
94
94
  signing_key:
95
95
  specification_version: 4
96
96
  summary: Provides latest raylib API for Ruby