raylib 4.5.0.alpha1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +16 -0
  3. data/README.md +97 -0
  4. data/lib/raylib/core/callbacks.rb +19 -0
  5. data/lib/raylib/core/colors.rb +32 -0
  6. data/lib/raylib/core/enums.rb +694 -0
  7. data/lib/raylib/core/functions.rb +1552 -0
  8. data/lib/raylib/core/structs/audio_stream.rb +71 -0
  9. data/lib/raylib/core/structs/bone_info.rb +38 -0
  10. data/lib/raylib/core/structs/bounding_box.rb +38 -0
  11. data/lib/raylib/core/structs/camera2_d.rb +60 -0
  12. data/lib/raylib/core/structs/camera3_d.rb +74 -0
  13. data/lib/raylib/core/structs/color.rb +60 -0
  14. data/lib/raylib/core/structs/file_path_list.rb +51 -0
  15. data/lib/raylib/core/structs/font.rb +82 -0
  16. data/lib/raylib/core/structs/glyph_info.rb +71 -0
  17. data/lib/raylib/core/structs/image.rb +71 -0
  18. data/lib/raylib/core/structs/material.rb +49 -0
  19. data/lib/raylib/core/structs/material_map.rb +49 -0
  20. data/lib/raylib/core/structs/matrix.rb +192 -0
  21. data/lib/raylib/core/structs/mesh.rb +181 -0
  22. data/lib/raylib/core/structs/model.rb +115 -0
  23. data/lib/raylib/core/structs/model_animation.rb +60 -0
  24. data/lib/raylib/core/structs/music.rb +71 -0
  25. data/lib/raylib/core/structs/n_patch_info.rb +82 -0
  26. data/lib/raylib/core/structs/ray.rb +38 -0
  27. data/lib/raylib/core/structs/ray_collision.rb +60 -0
  28. data/lib/raylib/core/structs/rectangle.rb +60 -0
  29. data/lib/raylib/core/structs/render_texture.rb +52 -0
  30. data/lib/raylib/core/structs/shader.rb +38 -0
  31. data/lib/raylib/core/structs/sound.rb +38 -0
  32. data/lib/raylib/core/structs/texture.rb +77 -0
  33. data/lib/raylib/core/structs/transform.rb +49 -0
  34. data/lib/raylib/core/structs/vector2.rb +38 -0
  35. data/lib/raylib/core/structs/vector3.rb +49 -0
  36. data/lib/raylib/core/structs/vector4.rb +63 -0
  37. data/lib/raylib/core/structs/vr_device_info.rb +126 -0
  38. data/lib/raylib/core/structs/vr_stereo_config.rb +104 -0
  39. data/lib/raylib/core/structs/wave.rb +71 -0
  40. data/lib/raylib/core/structs.rb +32 -0
  41. data/lib/raylib/core.rb +5 -0
  42. data/lib/raylib/dsl.rb +2 -0
  43. data/lib/raylib/raymath/functions.rb +337 -0
  44. data/lib/raylib/raymath/structs/float16.rb +27 -0
  45. data/lib/raylib/raymath/structs/float3.rb +27 -0
  46. data/lib/raylib/raymath/structs.rb +2 -0
  47. data/lib/raylib/raymath.rb +2 -0
  48. data/lib/raylib/rlgl/callbacks.rb +4 -0
  49. data/lib/raylib/rlgl/enums.rb +270 -0
  50. data/lib/raylib/rlgl/functions.rb +448 -0
  51. data/lib/raylib/rlgl/structs/rl_draw_call.rb +60 -0
  52. data/lib/raylib/rlgl/structs/rl_render_batch.rb +82 -0
  53. data/lib/raylib/rlgl/structs/rl_vertex_buffer.rb +93 -0
  54. data/lib/raylib/rlgl/structs.rb +3 -0
  55. data/lib/raylib/rlgl.rb +4 -0
  56. data/lib/raylib/version.rb +5 -0
  57. data/lib/raylib.rb +12 -0
  58. metadata +162 -0
@@ -0,0 +1,27 @@
1
+ module Raylib
2
+ #
3
+ class Float16 < FFI::Struct
4
+ layout(
5
+ :v, [:float, 16], #
6
+ )
7
+
8
+ def self.create(v)
9
+ new.tap do |instance|
10
+ instance[:v] = v
11
+ end
12
+ end
13
+
14
+ def to_s
15
+ "Raylib::Float16##{object_id} v=#{v}"
16
+ end
17
+
18
+ #
19
+ # @return [float[16]] v
20
+ def v = self[:v]
21
+
22
+ # Sets
23
+ def v=(new_v)
24
+ self[:v] = new_v
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ module Raylib
2
+ # NOTE: Helper types to be used instead of array return types for *ToFloat functions
3
+ class Float3 < FFI::Struct
4
+ layout(
5
+ :v, [:float, 3], #
6
+ )
7
+
8
+ def self.create(v)
9
+ new.tap do |instance|
10
+ instance[:v] = v
11
+ end
12
+ end
13
+
14
+ def to_s
15
+ "Raylib::Float3##{object_id} v=#{v}"
16
+ end
17
+
18
+ #
19
+ # @return [float[3]] v
20
+ def v = self[:v]
21
+
22
+ # Sets
23
+ def v=(new_v)
24
+ self[:v] = new_v
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,2 @@
1
+ require 'raylib/raymath/structs/float3'
2
+ require 'raylib/raymath/structs/float16'
@@ -0,0 +1,2 @@
1
+ require 'raylib/raymath/structs'
2
+ require 'raylib/raymath/functions'
@@ -0,0 +1,4 @@
1
+ module Raylib
2
+ # OpenGL extension functions loader signature (same as GLADloadproc)
3
+ callback :rlglLoadProc, [:pointer], :pointer
4
+ end
@@ -0,0 +1,270 @@
1
+ module Raylib
2
+ # ----------------------------------------------------------------------------------------------------
3
+ # rlGlVersion - OpenGL version
4
+ # ----------------------------------------------------------------------------------------------------
5
+
6
+ # OpenGL 1.1
7
+ RL_OPENGL_11 = 1
8
+ # OpenGL 2.1 (GLSL 120)
9
+ RL_OPENGL_21 = 2
10
+ # OpenGL 3.3 (GLSL 330)
11
+ RL_OPENGL_33 = 3
12
+ # OpenGL 4.3 (using GLSL 330)
13
+ RL_OPENGL_43 = 4
14
+ # OpenGL ES 2.0 (GLSL 100)
15
+ RL_OPENGL_ES_20 = 5
16
+
17
+ # ----------------------------------------------------------------------------------------------------
18
+ # rlTraceLogLevel - Trace log level
19
+ # ----------------------------------------------------------------------------------------------------
20
+
21
+ # Display all logs
22
+ RL_LOG_ALL = 0
23
+ # Trace logging, intended for internal use only
24
+ RL_LOG_TRACE = 1
25
+ # Debug logging, used for internal debugging, it should be disabled on release builds
26
+ RL_LOG_DEBUG = 2
27
+ # Info logging, used for program execution info
28
+ RL_LOG_INFO = 3
29
+ # Warning logging, used on recoverable failures
30
+ RL_LOG_WARNING = 4
31
+ # Error logging, used on unrecoverable failures
32
+ RL_LOG_ERROR = 5
33
+ # Fatal logging, used to abort program: exit(EXIT_FAILURE)
34
+ RL_LOG_FATAL = 6
35
+ # Disable logging
36
+ RL_LOG_NONE = 7
37
+
38
+ # ----------------------------------------------------------------------------------------------------
39
+ # rlPixelFormat - Texture pixel formats
40
+ # ----------------------------------------------------------------------------------------------------
41
+
42
+ # 8 bit per pixel (no alpha)
43
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1
44
+ # 8*2 bpp (2 channels)
45
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2
46
+ # 16 bpp
47
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3
48
+ # 24 bpp
49
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4
50
+ # 16 bpp (1 bit alpha)
51
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5
52
+ # 16 bpp (4 bit alpha)
53
+ RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6
54
+ # 32 bpp
55
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7
56
+ # 32 bpp (1 channel - float)
57
+ RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8
58
+ # 32*3 bpp (3 channels - float)
59
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9
60
+ # 32*4 bpp (4 channels - float)
61
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10
62
+ # 4 bpp (no alpha)
63
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11
64
+ # 4 bpp (1 bit alpha)
65
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12
66
+ # 8 bpp
67
+ RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13
68
+ # 8 bpp
69
+ RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14
70
+ # 4 bpp
71
+ RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15
72
+ # 4 bpp
73
+ RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16
74
+ # 8 bpp
75
+ RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17
76
+ # 4 bpp
77
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18
78
+ # 4 bpp
79
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19
80
+ # 8 bpp
81
+ RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20
82
+ # 2 bpp
83
+ RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21
84
+
85
+ # ----------------------------------------------------------------------------------------------------
86
+ # rlTextureFilter - Texture parameters: filter mode
87
+ # ----------------------------------------------------------------------------------------------------
88
+
89
+ # No filter, just pixel approximation
90
+ RL_TEXTURE_FILTER_POINT = 0
91
+ # Linear filtering
92
+ RL_TEXTURE_FILTER_BILINEAR = 1
93
+ # Trilinear filtering (linear with mipmaps)
94
+ RL_TEXTURE_FILTER_TRILINEAR = 2
95
+ # Anisotropic filtering 4x
96
+ RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3
97
+ # Anisotropic filtering 8x
98
+ RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4
99
+ # Anisotropic filtering 16x
100
+ RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5
101
+
102
+ # ----------------------------------------------------------------------------------------------------
103
+ # rlBlendMode - Color blending modes (pre-defined)
104
+ # ----------------------------------------------------------------------------------------------------
105
+
106
+ # Blend textures considering alpha (default)
107
+ RL_BLEND_ALPHA = 0
108
+ # Blend textures adding colors
109
+ RL_BLEND_ADDITIVE = 1
110
+ # Blend textures multiplying colors
111
+ RL_BLEND_MULTIPLIED = 2
112
+ # Blend textures adding colors (alternative)
113
+ RL_BLEND_ADD_COLORS = 3
114
+ # Blend textures subtracting colors (alternative)
115
+ RL_BLEND_SUBTRACT_COLORS = 4
116
+ # Blend premultiplied textures considering alpha
117
+ RL_BLEND_ALPHA_PREMULTIPLY = 5
118
+ # Blend textures using custom src/dst factors (use rlSetBlendFactors())
119
+ RL_BLEND_CUSTOM = 6
120
+ # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
121
+ RL_BLEND_CUSTOM_SEPARATE = 7
122
+
123
+ # ----------------------------------------------------------------------------------------------------
124
+ # rlShaderLocationIndex - Shader location point type
125
+ # ----------------------------------------------------------------------------------------------------
126
+
127
+ # Shader location: vertex attribute: position
128
+ RL_SHADER_LOC_VERTEX_POSITION = 0
129
+ # Shader location: vertex attribute: texcoord01
130
+ RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1
131
+ # Shader location: vertex attribute: texcoord02
132
+ RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2
133
+ # Shader location: vertex attribute: normal
134
+ RL_SHADER_LOC_VERTEX_NORMAL = 3
135
+ # Shader location: vertex attribute: tangent
136
+ RL_SHADER_LOC_VERTEX_TANGENT = 4
137
+ # Shader location: vertex attribute: color
138
+ RL_SHADER_LOC_VERTEX_COLOR = 5
139
+ # Shader location: matrix uniform: model-view-projection
140
+ RL_SHADER_LOC_MATRIX_MVP = 6
141
+ # Shader location: matrix uniform: view (camera transform)
142
+ RL_SHADER_LOC_MATRIX_VIEW = 7
143
+ # Shader location: matrix uniform: projection
144
+ RL_SHADER_LOC_MATRIX_PROJECTION = 8
145
+ # Shader location: matrix uniform: model (transform)
146
+ RL_SHADER_LOC_MATRIX_MODEL = 9
147
+ # Shader location: matrix uniform: normal
148
+ RL_SHADER_LOC_MATRIX_NORMAL = 10
149
+ # Shader location: vector uniform: view
150
+ RL_SHADER_LOC_VECTOR_VIEW = 11
151
+ # Shader location: vector uniform: diffuse color
152
+ RL_SHADER_LOC_COLOR_DIFFUSE = 12
153
+ # Shader location: vector uniform: specular color
154
+ RL_SHADER_LOC_COLOR_SPECULAR = 13
155
+ # Shader location: vector uniform: ambient color
156
+ RL_SHADER_LOC_COLOR_AMBIENT = 14
157
+ # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
158
+ RL_SHADER_LOC_MAP_ALBEDO = 15
159
+ # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
160
+ RL_SHADER_LOC_MAP_METALNESS = 16
161
+ # Shader location: sampler2d texture: normal
162
+ RL_SHADER_LOC_MAP_NORMAL = 17
163
+ # Shader location: sampler2d texture: roughness
164
+ RL_SHADER_LOC_MAP_ROUGHNESS = 18
165
+ # Shader location: sampler2d texture: occlusion
166
+ RL_SHADER_LOC_MAP_OCCLUSION = 19
167
+ # Shader location: sampler2d texture: emission
168
+ RL_SHADER_LOC_MAP_EMISSION = 20
169
+ # Shader location: sampler2d texture: height
170
+ RL_SHADER_LOC_MAP_HEIGHT = 21
171
+ # Shader location: samplerCube texture: cubemap
172
+ RL_SHADER_LOC_MAP_CUBEMAP = 22
173
+ # Shader location: samplerCube texture: irradiance
174
+ RL_SHADER_LOC_MAP_IRRADIANCE = 23
175
+ # Shader location: samplerCube texture: prefilter
176
+ RL_SHADER_LOC_MAP_PREFILTER = 24
177
+ # Shader location: sampler2d texture: brdf
178
+ RL_SHADER_LOC_MAP_BRDF = 25
179
+
180
+ # ----------------------------------------------------------------------------------------------------
181
+ # rlShaderUniformDataType - Shader uniform data type
182
+ # ----------------------------------------------------------------------------------------------------
183
+
184
+ # Shader uniform type: float
185
+ RL_SHADER_UNIFORM_FLOAT = 0
186
+ # Shader uniform type: vec2 (2 float)
187
+ RL_SHADER_UNIFORM_VEC2 = 1
188
+ # Shader uniform type: vec3 (3 float)
189
+ RL_SHADER_UNIFORM_VEC3 = 2
190
+ # Shader uniform type: vec4 (4 float)
191
+ RL_SHADER_UNIFORM_VEC4 = 3
192
+ # Shader uniform type: int
193
+ RL_SHADER_UNIFORM_INT = 4
194
+ # Shader uniform type: ivec2 (2 int)
195
+ RL_SHADER_UNIFORM_IVEC2 = 5
196
+ # Shader uniform type: ivec3 (3 int)
197
+ RL_SHADER_UNIFORM_IVEC3 = 6
198
+ # Shader uniform type: ivec4 (4 int)
199
+ RL_SHADER_UNIFORM_IVEC4 = 7
200
+ # Shader uniform type: sampler2d
201
+ RL_SHADER_UNIFORM_SAMPLER2D = 8
202
+
203
+ # ----------------------------------------------------------------------------------------------------
204
+ # rlShaderAttributeDataType - Shader attribute data types
205
+ # ----------------------------------------------------------------------------------------------------
206
+
207
+ # Shader attribute type: float
208
+ RL_SHADER_ATTRIB_FLOAT = 0
209
+ # Shader attribute type: vec2 (2 float)
210
+ RL_SHADER_ATTRIB_VEC2 = 1
211
+ # Shader attribute type: vec3 (3 float)
212
+ RL_SHADER_ATTRIB_VEC3 = 2
213
+ # Shader attribute type: vec4 (4 float)
214
+ RL_SHADER_ATTRIB_VEC4 = 3
215
+
216
+ # ----------------------------------------------------------------------------------------------------
217
+ # rlFramebufferAttachType - Framebuffer attachment type
218
+ # ----------------------------------------------------------------------------------------------------
219
+
220
+ # Framebuffer attachment type: color 0
221
+ RL_ATTACHMENT_COLOR_CHANNEL0 = 0
222
+ # Framebuffer attachment type: color 1
223
+ RL_ATTACHMENT_COLOR_CHANNEL1 = 1
224
+ # Framebuffer attachment type: color 2
225
+ RL_ATTACHMENT_COLOR_CHANNEL2 = 2
226
+ # Framebuffer attachment type: color 3
227
+ RL_ATTACHMENT_COLOR_CHANNEL3 = 3
228
+ # Framebuffer attachment type: color 4
229
+ RL_ATTACHMENT_COLOR_CHANNEL4 = 4
230
+ # Framebuffer attachment type: color 5
231
+ RL_ATTACHMENT_COLOR_CHANNEL5 = 5
232
+ # Framebuffer attachment type: color 6
233
+ RL_ATTACHMENT_COLOR_CHANNEL6 = 6
234
+ # Framebuffer attachment type: color 7
235
+ RL_ATTACHMENT_COLOR_CHANNEL7 = 7
236
+ # Framebuffer attachment type: depth
237
+ RL_ATTACHMENT_DEPTH = 100
238
+ # Framebuffer attachment type: stencil
239
+ RL_ATTACHMENT_STENCIL = 200
240
+
241
+ # ----------------------------------------------------------------------------------------------------
242
+ # rlFramebufferAttachTextureType - Framebuffer texture attachment type
243
+ # ----------------------------------------------------------------------------------------------------
244
+
245
+ # Framebuffer texture attachment type: cubemap, +X side
246
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0
247
+ # Framebuffer texture attachment type: cubemap, -X side
248
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1
249
+ # Framebuffer texture attachment type: cubemap, +Y side
250
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2
251
+ # Framebuffer texture attachment type: cubemap, -Y side
252
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3
253
+ # Framebuffer texture attachment type: cubemap, +Z side
254
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4
255
+ # Framebuffer texture attachment type: cubemap, -Z side
256
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5
257
+ # Framebuffer texture attachment type: texture2d
258
+ RL_ATTACHMENT_TEXTURE2D = 100
259
+ # Framebuffer texture attachment type: renderbuffer
260
+ RL_ATTACHMENT_RENDERBUFFER = 200
261
+
262
+ # ----------------------------------------------------------------------------------------------------
263
+ # rlCullMode - Face culling mode
264
+ # ----------------------------------------------------------------------------------------------------
265
+
266
+ # TODO
267
+ RL_CULL_FACE_FRONT = 0
268
+ # TODO
269
+ RL_CULL_FACE_BACK = 1
270
+ end