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.
- checksums.yaml +7 -0
- data/LICENSE.txt +16 -0
- data/README.md +97 -0
- data/lib/raylib/core/callbacks.rb +19 -0
- data/lib/raylib/core/colors.rb +32 -0
- data/lib/raylib/core/enums.rb +694 -0
- data/lib/raylib/core/functions.rb +1552 -0
- data/lib/raylib/core/structs/audio_stream.rb +71 -0
- data/lib/raylib/core/structs/bone_info.rb +38 -0
- data/lib/raylib/core/structs/bounding_box.rb +38 -0
- data/lib/raylib/core/structs/camera2_d.rb +60 -0
- data/lib/raylib/core/structs/camera3_d.rb +74 -0
- data/lib/raylib/core/structs/color.rb +60 -0
- data/lib/raylib/core/structs/file_path_list.rb +51 -0
- data/lib/raylib/core/structs/font.rb +82 -0
- data/lib/raylib/core/structs/glyph_info.rb +71 -0
- data/lib/raylib/core/structs/image.rb +71 -0
- data/lib/raylib/core/structs/material.rb +49 -0
- data/lib/raylib/core/structs/material_map.rb +49 -0
- data/lib/raylib/core/structs/matrix.rb +192 -0
- data/lib/raylib/core/structs/mesh.rb +181 -0
- data/lib/raylib/core/structs/model.rb +115 -0
- data/lib/raylib/core/structs/model_animation.rb +60 -0
- data/lib/raylib/core/structs/music.rb +71 -0
- data/lib/raylib/core/structs/n_patch_info.rb +82 -0
- data/lib/raylib/core/structs/ray.rb +38 -0
- data/lib/raylib/core/structs/ray_collision.rb +60 -0
- data/lib/raylib/core/structs/rectangle.rb +60 -0
- data/lib/raylib/core/structs/render_texture.rb +52 -0
- data/lib/raylib/core/structs/shader.rb +38 -0
- data/lib/raylib/core/structs/sound.rb +38 -0
- data/lib/raylib/core/structs/texture.rb +77 -0
- data/lib/raylib/core/structs/transform.rb +49 -0
- data/lib/raylib/core/structs/vector2.rb +38 -0
- data/lib/raylib/core/structs/vector3.rb +49 -0
- data/lib/raylib/core/structs/vector4.rb +63 -0
- data/lib/raylib/core/structs/vr_device_info.rb +126 -0
- data/lib/raylib/core/structs/vr_stereo_config.rb +104 -0
- data/lib/raylib/core/structs/wave.rb +71 -0
- data/lib/raylib/core/structs.rb +32 -0
- data/lib/raylib/core.rb +5 -0
- data/lib/raylib/dsl.rb +2 -0
- data/lib/raylib/raymath/functions.rb +337 -0
- data/lib/raylib/raymath/structs/float16.rb +27 -0
- data/lib/raylib/raymath/structs/float3.rb +27 -0
- data/lib/raylib/raymath/structs.rb +2 -0
- data/lib/raylib/raymath.rb +2 -0
- data/lib/raylib/rlgl/callbacks.rb +4 -0
- data/lib/raylib/rlgl/enums.rb +270 -0
- data/lib/raylib/rlgl/functions.rb +448 -0
- data/lib/raylib/rlgl/structs/rl_draw_call.rb +60 -0
- data/lib/raylib/rlgl/structs/rl_render_batch.rb +82 -0
- data/lib/raylib/rlgl/structs/rl_vertex_buffer.rb +93 -0
- data/lib/raylib/rlgl/structs.rb +3 -0
- data/lib/raylib/rlgl.rb +4 -0
- data/lib/raylib/version.rb +5 -0
- data/lib/raylib.rb +12 -0
- metadata +162 -0
@@ -0,0 +1,448 @@
|
|
1
|
+
module Raylib
|
2
|
+
# Choose the current matrix to be transformed
|
3
|
+
attach_function :rl_matrix_mode, :rlMatrixMode, [:int], :void
|
4
|
+
|
5
|
+
# Push the current matrix to stack
|
6
|
+
attach_function :rl_push_matrix, :rlPushMatrix, [], :void
|
7
|
+
|
8
|
+
# Pop latest inserted matrix from stack
|
9
|
+
attach_function :rl_pop_matrix, :rlPopMatrix, [], :void
|
10
|
+
|
11
|
+
# Reset current matrix to identity matrix
|
12
|
+
attach_function :rl_load_identity, :rlLoadIdentity, [], :void
|
13
|
+
|
14
|
+
# Multiply the current matrix by a translation matrix
|
15
|
+
attach_function :rl_translatef, :rlTranslatef, [:float, :float, :float], :void
|
16
|
+
|
17
|
+
# Multiply the current matrix by a rotation matrix
|
18
|
+
attach_function :rl_rotatef, :rlRotatef, [:float, :float, :float, :float], :void
|
19
|
+
|
20
|
+
# Multiply the current matrix by a scaling matrix
|
21
|
+
attach_function :rl_scalef, :rlScalef, [:float, :float, :float], :void
|
22
|
+
|
23
|
+
# Multiply the current matrix by another matrix
|
24
|
+
attach_function :rl_mult_matrixf, :rlMultMatrixf, [:pointer], :void
|
25
|
+
|
26
|
+
# TODO
|
27
|
+
attach_function :rl_frustum, :rlFrustum, [:double, :double, :double, :double, :double, :double], :void
|
28
|
+
|
29
|
+
# TODO
|
30
|
+
attach_function :rl_ortho, :rlOrtho, [:double, :double, :double, :double, :double, :double], :void
|
31
|
+
|
32
|
+
# Set the viewport area
|
33
|
+
attach_function :rl_viewport, :rlViewport, [:int, :int, :int, :int], :void
|
34
|
+
|
35
|
+
# Initialize drawing mode (how to organize vertex)
|
36
|
+
attach_function :rl_begin, :rlBegin, [:int], :void
|
37
|
+
|
38
|
+
# Finish vertex providing
|
39
|
+
attach_function :rl_end, :rlEnd, [], :void
|
40
|
+
|
41
|
+
# Define one vertex (position) - 2 int
|
42
|
+
attach_function :rl_vertex2i, :rlVertex2i, [:int, :int], :void
|
43
|
+
|
44
|
+
# Define one vertex (position) - 2 float
|
45
|
+
attach_function :rl_vertex2f, :rlVertex2f, [:float, :float], :void
|
46
|
+
|
47
|
+
# Define one vertex (position) - 3 float
|
48
|
+
attach_function :rl_vertex3f, :rlVertex3f, [:float, :float, :float], :void
|
49
|
+
|
50
|
+
# Define one vertex (texture coordinate) - 2 float
|
51
|
+
attach_function :rl_tex_coord2f, :rlTexCoord2f, [:float, :float], :void
|
52
|
+
|
53
|
+
# Define one vertex (normal) - 3 float
|
54
|
+
attach_function :rl_normal3f, :rlNormal3f, [:float, :float, :float], :void
|
55
|
+
|
56
|
+
# Define one vertex (color) - 4 byte
|
57
|
+
attach_function :rl_color4ub, :rlColor4ub, [:uchar, :uchar, :uchar, :uchar], :void
|
58
|
+
|
59
|
+
# Define one vertex (color) - 3 float
|
60
|
+
attach_function :rl_color3f, :rlColor3f, [:float, :float, :float], :void
|
61
|
+
|
62
|
+
# Define one vertex (color) - 4 float
|
63
|
+
attach_function :rl_color4f, :rlColor4f, [:float, :float, :float, :float], :void
|
64
|
+
|
65
|
+
# Enable vertex array (VAO, if supported)
|
66
|
+
attach_function :rl_enable_vertex_array, :rlEnableVertexArray, [:uint], :bool
|
67
|
+
|
68
|
+
# Disable vertex array (VAO, if supported)
|
69
|
+
attach_function :rl_disable_vertex_array, :rlDisableVertexArray, [], :void
|
70
|
+
|
71
|
+
# Enable vertex buffer (VBO)
|
72
|
+
attach_function :rl_enable_vertex_buffer, :rlEnableVertexBuffer, [:uint], :void
|
73
|
+
|
74
|
+
# Disable vertex buffer (VBO)
|
75
|
+
attach_function :rl_disable_vertex_buffer, :rlDisableVertexBuffer, [], :void
|
76
|
+
|
77
|
+
# Enable vertex buffer element (VBO element)
|
78
|
+
attach_function :rl_enable_vertex_buffer_element, :rlEnableVertexBufferElement, [:uint], :void
|
79
|
+
|
80
|
+
# Disable vertex buffer element (VBO element)
|
81
|
+
attach_function :rl_disable_vertex_buffer_element, :rlDisableVertexBufferElement, [], :void
|
82
|
+
|
83
|
+
# Enable vertex attribute index
|
84
|
+
attach_function :rl_enable_vertex_attribute, :rlEnableVertexAttribute, [:uint], :void
|
85
|
+
|
86
|
+
# Disable vertex attribute index
|
87
|
+
attach_function :rl_disable_vertex_attribute, :rlDisableVertexAttribute, [:uint], :void
|
88
|
+
|
89
|
+
# Enable attribute state pointer
|
90
|
+
# attach_function :rl_enable_state_pointer, :rlEnableStatePointer, [:int, :pointer], :void
|
91
|
+
|
92
|
+
# Disable attribute state pointer
|
93
|
+
# attach_function :rl_disable_state_pointer, :rlDisableStatePointer, [:int], :void
|
94
|
+
|
95
|
+
# Select and active a texture slot
|
96
|
+
attach_function :rl_active_texture_slot, :rlActiveTextureSlot, [:int], :void
|
97
|
+
|
98
|
+
# Enable texture
|
99
|
+
attach_function :rl_enable_texture, :rlEnableTexture, [:uint], :void
|
100
|
+
|
101
|
+
# Disable texture
|
102
|
+
attach_function :rl_disable_texture, :rlDisableTexture, [], :void
|
103
|
+
|
104
|
+
# Enable texture cubemap
|
105
|
+
attach_function :rl_enable_texture_cubemap, :rlEnableTextureCubemap, [:uint], :void
|
106
|
+
|
107
|
+
# Disable texture cubemap
|
108
|
+
attach_function :rl_disable_texture_cubemap, :rlDisableTextureCubemap, [], :void
|
109
|
+
|
110
|
+
# Set texture parameters (filter, wrap)
|
111
|
+
attach_function :rl_texture_parameters, :rlTextureParameters, [:uint, :int, :int], :void
|
112
|
+
|
113
|
+
# Set cubemap parameters (filter, wrap)
|
114
|
+
attach_function :rl_cubemap_parameters, :rlCubemapParameters, [:uint, :int, :int], :void
|
115
|
+
|
116
|
+
# Enable shader program
|
117
|
+
attach_function :rl_enable_shader, :rlEnableShader, [:uint], :void
|
118
|
+
|
119
|
+
# Disable shader program
|
120
|
+
attach_function :rl_disable_shader, :rlDisableShader, [], :void
|
121
|
+
|
122
|
+
# Enable render texture (fbo)
|
123
|
+
attach_function :rl_enable_framebuffer, :rlEnableFramebuffer, [:uint], :void
|
124
|
+
|
125
|
+
# Disable render texture (fbo), return to default framebuffer
|
126
|
+
attach_function :rl_disable_framebuffer, :rlDisableFramebuffer, [], :void
|
127
|
+
|
128
|
+
# Activate multiple draw color buffers
|
129
|
+
attach_function :rl_active_draw_buffers, :rlActiveDrawBuffers, [:int], :void
|
130
|
+
|
131
|
+
# Enable color blending
|
132
|
+
attach_function :rl_enable_color_blend, :rlEnableColorBlend, [], :void
|
133
|
+
|
134
|
+
# Disable color blending
|
135
|
+
attach_function :rl_disable_color_blend, :rlDisableColorBlend, [], :void
|
136
|
+
|
137
|
+
# Enable depth test
|
138
|
+
attach_function :rl_enable_depth_test, :rlEnableDepthTest, [], :void
|
139
|
+
|
140
|
+
# Disable depth test
|
141
|
+
attach_function :rl_disable_depth_test, :rlDisableDepthTest, [], :void
|
142
|
+
|
143
|
+
# Enable depth write
|
144
|
+
attach_function :rl_enable_depth_mask, :rlEnableDepthMask, [], :void
|
145
|
+
|
146
|
+
# Disable depth write
|
147
|
+
attach_function :rl_disable_depth_mask, :rlDisableDepthMask, [], :void
|
148
|
+
|
149
|
+
# Enable backface culling
|
150
|
+
attach_function :rl_enable_backface_culling, :rlEnableBackfaceCulling, [], :void
|
151
|
+
|
152
|
+
# Disable backface culling
|
153
|
+
attach_function :rl_disable_backface_culling, :rlDisableBackfaceCulling, [], :void
|
154
|
+
|
155
|
+
# Set face culling mode
|
156
|
+
attach_function :rl_set_cull_face, :rlSetCullFace, [:int], :void
|
157
|
+
|
158
|
+
# Enable scissor test
|
159
|
+
attach_function :rl_enable_scissor_test, :rlEnableScissorTest, [], :void
|
160
|
+
|
161
|
+
# Disable scissor test
|
162
|
+
attach_function :rl_disable_scissor_test, :rlDisableScissorTest, [], :void
|
163
|
+
|
164
|
+
# Scissor test
|
165
|
+
attach_function :rl_scissor, :rlScissor, [:int, :int, :int, :int], :void
|
166
|
+
|
167
|
+
# Enable wire mode
|
168
|
+
attach_function :rl_enable_wire_mode, :rlEnableWireMode, [], :void
|
169
|
+
|
170
|
+
# Disable wire mode
|
171
|
+
attach_function :rl_disable_wire_mode, :rlDisableWireMode, [], :void
|
172
|
+
|
173
|
+
# Set the line drawing width
|
174
|
+
attach_function :rl_set_line_width, :rlSetLineWidth, [:float], :void
|
175
|
+
|
176
|
+
# Get the line drawing width
|
177
|
+
attach_function :rl_get_line_width, :rlGetLineWidth, [], :float
|
178
|
+
|
179
|
+
# Enable line aliasing
|
180
|
+
attach_function :rl_enable_smooth_lines, :rlEnableSmoothLines, [], :void
|
181
|
+
|
182
|
+
# Disable line aliasing
|
183
|
+
attach_function :rl_disable_smooth_lines, :rlDisableSmoothLines, [], :void
|
184
|
+
|
185
|
+
# Enable stereo rendering
|
186
|
+
attach_function :rl_enable_stereo_render, :rlEnableStereoRender, [], :void
|
187
|
+
|
188
|
+
# Disable stereo rendering
|
189
|
+
attach_function :rl_disable_stereo_render, :rlDisableStereoRender, [], :void
|
190
|
+
|
191
|
+
# Check if stereo render is enabled
|
192
|
+
attach_function :rl_is_stereo_render_enabled, :rlIsStereoRenderEnabled, [], :bool
|
193
|
+
|
194
|
+
# Clear color buffer with color
|
195
|
+
attach_function :rl_clear_color, :rlClearColor, [:uchar, :uchar, :uchar, :uchar], :void
|
196
|
+
|
197
|
+
# Clear used screen buffers (color and depth)
|
198
|
+
attach_function :rl_clear_screen_buffers, :rlClearScreenBuffers, [], :void
|
199
|
+
|
200
|
+
# Check and log OpenGL error codes
|
201
|
+
attach_function :rl_check_errors, :rlCheckErrors, [], :void
|
202
|
+
|
203
|
+
# Set blending mode
|
204
|
+
attach_function :rl_set_blend_mode, :rlSetBlendMode, [:int], :void
|
205
|
+
|
206
|
+
# Set blending mode factor and equation (using OpenGL factors)
|
207
|
+
attach_function :rl_set_blend_factors, :rlSetBlendFactors, [:int, :int, :int], :void
|
208
|
+
|
209
|
+
# Set blending mode factors and equations separately (using OpenGL factors)
|
210
|
+
attach_function :rl_set_blend_factors_separate, :rlSetBlendFactorsSeparate, [:int, :int, :int, :int, :int, :int], :void
|
211
|
+
|
212
|
+
# Initialize rlgl (buffers, shaders, textures, states)
|
213
|
+
attach_function :rlgl_init, :rlglInit, [:int, :int], :void
|
214
|
+
|
215
|
+
# De-initialize rlgl (buffers, shaders, textures)
|
216
|
+
attach_function :rlgl_close, :rlglClose, [], :void
|
217
|
+
|
218
|
+
# Load OpenGL extensions (loader function required)
|
219
|
+
attach_function :rl_load_extensions, :rlLoadExtensions, [:pointer], :void
|
220
|
+
|
221
|
+
# Get current OpenGL version
|
222
|
+
attach_function :rl_get_version, :rlGetVersion, [], :int
|
223
|
+
|
224
|
+
# Set current framebuffer width
|
225
|
+
attach_function :rl_set_framebuffer_width, :rlSetFramebufferWidth, [:int], :void
|
226
|
+
|
227
|
+
# Get default framebuffer width
|
228
|
+
attach_function :rl_get_framebuffer_width, :rlGetFramebufferWidth, [], :int
|
229
|
+
|
230
|
+
# Set current framebuffer height
|
231
|
+
attach_function :rl_set_framebuffer_height, :rlSetFramebufferHeight, [:int], :void
|
232
|
+
|
233
|
+
# Get default framebuffer height
|
234
|
+
attach_function :rl_get_framebuffer_height, :rlGetFramebufferHeight, [], :int
|
235
|
+
|
236
|
+
# Get default texture id
|
237
|
+
attach_function :rl_get_texture_id_default, :rlGetTextureIdDefault, [], :uint
|
238
|
+
|
239
|
+
# Get default shader id
|
240
|
+
attach_function :rl_get_shader_id_default, :rlGetShaderIdDefault, [], :uint
|
241
|
+
|
242
|
+
# Get default shader locations
|
243
|
+
attach_function :rl_get_shader_locs_default, :rlGetShaderLocsDefault, [], :pointer
|
244
|
+
|
245
|
+
# Load a render batch system
|
246
|
+
attach_function :rl_load_render_batch, :rlLoadRenderBatch, [:int, :int], RlRenderBatch.by_value
|
247
|
+
|
248
|
+
# Unload render batch system
|
249
|
+
attach_function :rl_unload_render_batch, :rlUnloadRenderBatch, [RlRenderBatch.by_value], :void
|
250
|
+
|
251
|
+
# Draw render batch data (Update->Draw->Reset)
|
252
|
+
attach_function :rl_draw_render_batch, :rlDrawRenderBatch, [:pointer], :void
|
253
|
+
|
254
|
+
# Set the active render batch for rlgl (NULL for default internal)
|
255
|
+
attach_function :rl_set_render_batch_active, :rlSetRenderBatchActive, [:pointer], :void
|
256
|
+
|
257
|
+
# Update and draw internal render batch
|
258
|
+
attach_function :rl_draw_render_batch_active, :rlDrawRenderBatchActive, [], :void
|
259
|
+
|
260
|
+
# Check internal buffer overflow for a given number of vertex
|
261
|
+
attach_function :rl_check_render_batch_limit, :rlCheckRenderBatchLimit, [:int], :bool
|
262
|
+
|
263
|
+
# Set current texture for render batch and check buffers limits
|
264
|
+
attach_function :rl_set_texture, :rlSetTexture, [:uint], :void
|
265
|
+
|
266
|
+
# Load vertex array (vao) if supported
|
267
|
+
attach_function :rl_load_vertex_array, :rlLoadVertexArray, [], :uint
|
268
|
+
|
269
|
+
# Load a vertex buffer attribute
|
270
|
+
attach_function :rl_load_vertex_buffer, :rlLoadVertexBuffer, [:pointer, :int, :bool], :uint
|
271
|
+
|
272
|
+
# Load a new attributes element buffer
|
273
|
+
attach_function :rl_load_vertex_buffer_element, :rlLoadVertexBufferElement, [:pointer, :int, :bool], :uint
|
274
|
+
|
275
|
+
# Update GPU buffer with new data
|
276
|
+
attach_function :rl_update_vertex_buffer, :rlUpdateVertexBuffer, [:uint, :pointer, :int, :int], :void
|
277
|
+
|
278
|
+
# Update vertex buffer elements with new data
|
279
|
+
attach_function :rl_update_vertex_buffer_elements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void
|
280
|
+
|
281
|
+
# TODO
|
282
|
+
attach_function :rl_unload_vertex_array, :rlUnloadVertexArray, [:uint], :void
|
283
|
+
|
284
|
+
# TODO
|
285
|
+
attach_function :rl_unload_vertex_buffer, :rlUnloadVertexBuffer, [:uint], :void
|
286
|
+
|
287
|
+
# TODO
|
288
|
+
attach_function :rl_set_vertex_attribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void
|
289
|
+
|
290
|
+
# TODO
|
291
|
+
attach_function :rl_set_vertex_attribute_divisor, :rlSetVertexAttributeDivisor, [:uint, :int], :void
|
292
|
+
|
293
|
+
# Set vertex attribute default value
|
294
|
+
attach_function :rl_set_vertex_attribute_default, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void
|
295
|
+
|
296
|
+
# TODO
|
297
|
+
attach_function :rl_draw_vertex_array, :rlDrawVertexArray, [:int, :int], :void
|
298
|
+
|
299
|
+
# TODO
|
300
|
+
attach_function :rl_draw_vertex_array_elements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void
|
301
|
+
|
302
|
+
# TODO
|
303
|
+
attach_function :rl_draw_vertex_array_instanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void
|
304
|
+
|
305
|
+
# TODO
|
306
|
+
attach_function :rl_draw_vertex_array_elements_instanced, :rlDrawVertexArrayElementsInstanced, [:int, :int, :pointer, :int], :void
|
307
|
+
|
308
|
+
# Load texture in GPU
|
309
|
+
attach_function :rl_load_texture, :rlLoadTexture, [:pointer, :int, :int, :int, :int], :uint
|
310
|
+
|
311
|
+
# Load depth texture/renderbuffer (to be attached to fbo)
|
312
|
+
attach_function :rl_load_texture_depth, :rlLoadTextureDepth, [:int, :int, :bool], :uint
|
313
|
+
|
314
|
+
# Load texture cubemap
|
315
|
+
attach_function :rl_load_texture_cubemap, :rlLoadTextureCubemap, [:pointer, :int, :int], :uint
|
316
|
+
|
317
|
+
# Update GPU texture with new data
|
318
|
+
attach_function :rl_update_texture, :rlUpdateTexture, [:uint, :int, :int, :int, :int, :int, :pointer], :void
|
319
|
+
|
320
|
+
# Get OpenGL internal formats
|
321
|
+
attach_function :rl_get_gl_texture_formats, :rlGetGlTextureFormats, [:int, :pointer, :pointer, :pointer], :void
|
322
|
+
|
323
|
+
# Get name string for pixel format
|
324
|
+
attach_function :rl_get_pixel_format_name, :rlGetPixelFormatName, [:uint], :pointer
|
325
|
+
|
326
|
+
# Unload texture from GPU memory
|
327
|
+
attach_function :rl_unload_texture, :rlUnloadTexture, [:uint], :void
|
328
|
+
|
329
|
+
# Generate mipmap data for selected texture
|
330
|
+
attach_function :rl_gen_texture_mipmaps, :rlGenTextureMipmaps, [:uint, :int, :int, :int, :pointer], :void
|
331
|
+
|
332
|
+
# Read texture pixel data
|
333
|
+
attach_function :rl_read_texture_pixels, :rlReadTexturePixels, [:uint, :int, :int, :int], :pointer
|
334
|
+
|
335
|
+
# Read screen pixel data (color buffer)
|
336
|
+
attach_function :rl_read_screen_pixels, :rlReadScreenPixels, [:int, :int], :pointer
|
337
|
+
|
338
|
+
# Load an empty framebuffer
|
339
|
+
attach_function :rl_load_framebuffer, :rlLoadFramebuffer, [:int, :int], :uint
|
340
|
+
|
341
|
+
# Attach texture/renderbuffer to a framebuffer
|
342
|
+
attach_function :rl_framebuffer_attach, :rlFramebufferAttach, [:uint, :uint, :int, :int, :int], :void
|
343
|
+
|
344
|
+
# Verify framebuffer is complete
|
345
|
+
attach_function :rl_framebuffer_complete, :rlFramebufferComplete, [:uint], :bool
|
346
|
+
|
347
|
+
# Delete framebuffer from GPU
|
348
|
+
attach_function :rl_unload_framebuffer, :rlUnloadFramebuffer, [:uint], :void
|
349
|
+
|
350
|
+
# Load shader from code strings
|
351
|
+
attach_function :rl_load_shader_code, :rlLoadShaderCode, [:pointer, :pointer], :uint
|
352
|
+
|
353
|
+
# Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
|
354
|
+
attach_function :rl_compile_shader, :rlCompileShader, [:pointer, :int], :uint
|
355
|
+
|
356
|
+
# Load custom shader program
|
357
|
+
attach_function :rl_load_shader_program, :rlLoadShaderProgram, [:uint, :uint], :uint
|
358
|
+
|
359
|
+
# Unload shader program
|
360
|
+
attach_function :rl_unload_shader_program, :rlUnloadShaderProgram, [:uint], :void
|
361
|
+
|
362
|
+
# Get shader location uniform
|
363
|
+
attach_function :rl_get_location_uniform, :rlGetLocationUniform, [:uint, :pointer], :int
|
364
|
+
|
365
|
+
# Get shader location attribute
|
366
|
+
attach_function :rl_get_location_attrib, :rlGetLocationAttrib, [:uint, :pointer], :int
|
367
|
+
|
368
|
+
# Set shader value uniform
|
369
|
+
attach_function :rl_set_uniform, :rlSetUniform, [:int, :pointer, :int, :int], :void
|
370
|
+
|
371
|
+
# Set shader value matrix
|
372
|
+
attach_function :rl_set_uniform_matrix, :rlSetUniformMatrix, [:int, Matrix.by_value], :void
|
373
|
+
|
374
|
+
# Set shader value sampler
|
375
|
+
attach_function :rl_set_uniform_sampler, :rlSetUniformSampler, [:int, :uint], :void
|
376
|
+
|
377
|
+
# Set shader currently active (id and locations)
|
378
|
+
attach_function :rl_set_shader, :rlSetShader, [:uint, :pointer], :void
|
379
|
+
|
380
|
+
# Load compute shader program
|
381
|
+
attach_function :rl_load_compute_shader_program, :rlLoadComputeShaderProgram, [:uint], :uint
|
382
|
+
|
383
|
+
# Dispatch compute shader (equivalent to *draw* for graphics pipeline)
|
384
|
+
attach_function :rl_compute_shader_dispatch, :rlComputeShaderDispatch, [:uint, :uint, :uint], :void
|
385
|
+
|
386
|
+
# Load shader storage buffer object (SSBO)
|
387
|
+
attach_function :rl_load_shader_buffer, :rlLoadShaderBuffer, [:uint, :pointer, :int], :uint
|
388
|
+
|
389
|
+
# Unload shader storage buffer object (SSBO)
|
390
|
+
attach_function :rl_unload_shader_buffer, :rlUnloadShaderBuffer, [:uint], :void
|
391
|
+
|
392
|
+
# Update SSBO buffer data
|
393
|
+
attach_function :rl_update_shader_buffer, :rlUpdateShaderBuffer, [:uint, :pointer, :uint, :uint], :void
|
394
|
+
|
395
|
+
# Bind SSBO buffer
|
396
|
+
attach_function :rl_bind_shader_buffer, :rlBindShaderBuffer, [:uint, :uint], :void
|
397
|
+
|
398
|
+
# Read SSBO buffer data (GPU->CPU)
|
399
|
+
attach_function :rl_read_shader_buffer, :rlReadShaderBuffer, [:uint, :pointer, :uint, :uint], :void
|
400
|
+
|
401
|
+
# Copy SSBO data between buffers
|
402
|
+
attach_function :rl_copy_shader_buffer, :rlCopyShaderBuffer, [:uint, :uint, :uint, :uint, :uint], :void
|
403
|
+
|
404
|
+
# Get SSBO buffer size
|
405
|
+
attach_function :rl_get_shader_buffer_size, :rlGetShaderBufferSize, [:uint], :uint
|
406
|
+
|
407
|
+
# Bind image texture
|
408
|
+
attach_function :rl_bind_image_texture, :rlBindImageTexture, [:uint, :uint, :int, :bool], :void
|
409
|
+
|
410
|
+
# Get internal modelview matrix
|
411
|
+
attach_function :rl_get_matrix_modelview, :rlGetMatrixModelview, [], Matrix.by_value
|
412
|
+
|
413
|
+
# Get internal projection matrix
|
414
|
+
attach_function :rl_get_matrix_projection, :rlGetMatrixProjection, [], Matrix.by_value
|
415
|
+
|
416
|
+
# Get internal accumulated transform matrix
|
417
|
+
attach_function :rl_get_matrix_transform, :rlGetMatrixTransform, [], Matrix.by_value
|
418
|
+
|
419
|
+
# Get internal projection matrix for stereo render (selected eye)
|
420
|
+
attach_function :rl_get_matrix_projection_stereo, :rlGetMatrixProjectionStereo, [:int], Matrix.by_value
|
421
|
+
|
422
|
+
# Get internal view offset matrix for stereo render (selected eye)
|
423
|
+
attach_function :rl_get_matrix_view_offset_stereo, :rlGetMatrixViewOffsetStereo, [:int], Matrix.by_value
|
424
|
+
|
425
|
+
# Set a custom projection matrix (replaces internal projection matrix)
|
426
|
+
attach_function :rl_set_matrix_projection, :rlSetMatrixProjection, [Matrix.by_value], :void
|
427
|
+
|
428
|
+
# Set a custom modelview matrix (replaces internal modelview matrix)
|
429
|
+
attach_function :rl_set_matrix_modelview, :rlSetMatrixModelview, [Matrix.by_value], :void
|
430
|
+
|
431
|
+
# Set eyes projection matrices for stereo rendering
|
432
|
+
attach_function :rl_set_matrix_projection_stereo, :rlSetMatrixProjectionStereo, [Matrix.by_value, Matrix.by_value], :void
|
433
|
+
|
434
|
+
# Set eyes view offsets matrices for stereo rendering
|
435
|
+
attach_function :rl_set_matrix_view_offset_stereo, :rlSetMatrixViewOffsetStereo, [Matrix.by_value, Matrix.by_value], :void
|
436
|
+
|
437
|
+
# Load and draw a cube
|
438
|
+
attach_function :rl_load_draw_cube, :rlLoadDrawCube, [], :void
|
439
|
+
|
440
|
+
# Load and draw a quad
|
441
|
+
attach_function :rl_load_draw_quad, :rlLoadDrawQuad, [], :void
|
442
|
+
|
443
|
+
# TODO
|
444
|
+
attach_function :rl_get_matrix_projection_stereo, :rlGetMatrixProjectionStereo, [:int], Matrix.by_value
|
445
|
+
|
446
|
+
# TODO
|
447
|
+
attach_function :rl_get_matrix_view_offset_stereo, :rlGetMatrixViewOffsetStereo, [:int], Matrix.by_value
|
448
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Raylib
|
2
|
+
# of those state-change happens (this is done in core module)
|
3
|
+
class RlDrawCall < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS,
|
6
|
+
:vertexCount, :int, # Number of vertex of the draw,
|
7
|
+
:vertexAlignment, :int, # Number of vertex required for index alignment (LINES, TRIANGLES),
|
8
|
+
:textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
|
9
|
+
)
|
10
|
+
|
11
|
+
def self.create(mode, vertex_count, vertex_alignment, texture_id)
|
12
|
+
new.tap do |instance|
|
13
|
+
instance[:mode] = mode
|
14
|
+
instance[:vertexCount] = vertex_count
|
15
|
+
instance[:vertexAlignment] = vertex_alignment
|
16
|
+
instance[:textureId] = texture_id
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_s
|
21
|
+
"Raylib::RlDrawCall##{object_id} mode=#{mode} vertex_count=#{vertex_count} vertex_alignment=#{vertex_alignment} texture_id=#{texture_id}"
|
22
|
+
end
|
23
|
+
|
24
|
+
# Drawing mode: LINES, TRIANGLES, QUADS
|
25
|
+
# @return [Integer] mode
|
26
|
+
def mode = self[:mode]
|
27
|
+
|
28
|
+
# Sets Drawing mode: LINES, TRIANGLES, QUADS
|
29
|
+
def mode=(new_mode)
|
30
|
+
self[:mode] = new_mode
|
31
|
+
end
|
32
|
+
|
33
|
+
# Number of vertex of the draw
|
34
|
+
# @return [Integer] vertexCount
|
35
|
+
def vertex_count = self[:vertexCount]
|
36
|
+
|
37
|
+
# Sets Number of vertex of the draw
|
38
|
+
def vertex_count=(new_vertex_count)
|
39
|
+
self[:vertexCount] = new_vertex_count
|
40
|
+
end
|
41
|
+
|
42
|
+
# Number of vertex required for index alignment (LINES, TRIANGLES)
|
43
|
+
# @return [Integer] vertexAlignment
|
44
|
+
def vertex_alignment = self[:vertexAlignment]
|
45
|
+
|
46
|
+
# Sets Number of vertex required for index alignment (LINES, TRIANGLES)
|
47
|
+
def vertex_alignment=(new_vertex_alignment)
|
48
|
+
self[:vertexAlignment] = new_vertex_alignment
|
49
|
+
end
|
50
|
+
|
51
|
+
# Texture id to be used on the draw -> Use to create new draw call if changes
|
52
|
+
# @return [Integer] textureId
|
53
|
+
def texture_id = self[:textureId]
|
54
|
+
|
55
|
+
# Sets Texture id to be used on the draw -> Use to create new draw call if changes
|
56
|
+
def texture_id=(new_texture_id)
|
57
|
+
self[:textureId] = new_texture_id
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module Raylib
|
2
|
+
# rlRenderBatch type
|
3
|
+
class RlRenderBatch < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:bufferCount, :int, # Number of vertex buffers (multi-buffering support),
|
6
|
+
:currentBuffer, :int, # Current buffer tracking in case of multi-buffering,
|
7
|
+
:vertexBuffer, :pointer, # Dynamic buffer(s) for vertex data,
|
8
|
+
:draws, :pointer, # Draw calls array, depends on textureId,
|
9
|
+
:drawCounter, :int, # Draw calls counter,
|
10
|
+
:currentDepth, :float, # Current depth value for next draw
|
11
|
+
)
|
12
|
+
|
13
|
+
def self.create(buffer_count, current_buffer, vertex_buffer, draws, draw_counter, current_depth)
|
14
|
+
new.tap do |instance|
|
15
|
+
instance[:bufferCount] = buffer_count
|
16
|
+
instance[:currentBuffer] = current_buffer
|
17
|
+
instance[:vertexBuffer] = vertex_buffer
|
18
|
+
instance[:draws] = draws
|
19
|
+
instance[:drawCounter] = draw_counter
|
20
|
+
instance[:currentDepth] = current_depth
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_s
|
25
|
+
"Raylib::RlRenderBatch##{object_id} buffer_count=#{buffer_count} current_buffer=#{current_buffer} vertex_buffer=#{vertex_buffer} draws=#{draws} draw_counter=#{draw_counter} current_depth=#{current_depth}"
|
26
|
+
end
|
27
|
+
|
28
|
+
# Number of vertex buffers (multi-buffering support)
|
29
|
+
# @return [Integer] bufferCount
|
30
|
+
def buffer_count = self[:bufferCount]
|
31
|
+
|
32
|
+
# Sets Number of vertex buffers (multi-buffering support)
|
33
|
+
def buffer_count=(new_buffer_count)
|
34
|
+
self[:bufferCount] = new_buffer_count
|
35
|
+
end
|
36
|
+
|
37
|
+
# Current buffer tracking in case of multi-buffering
|
38
|
+
# @return [Integer] currentBuffer
|
39
|
+
def current_buffer = self[:currentBuffer]
|
40
|
+
|
41
|
+
# Sets Current buffer tracking in case of multi-buffering
|
42
|
+
def current_buffer=(new_current_buffer)
|
43
|
+
self[:currentBuffer] = new_current_buffer
|
44
|
+
end
|
45
|
+
|
46
|
+
# Dynamic buffer(s) for vertex data
|
47
|
+
# @return [rlVertexBuffer *] vertexBuffer
|
48
|
+
def vertex_buffer = self[:vertexBuffer]
|
49
|
+
|
50
|
+
# Sets Dynamic buffer(s) for vertex data
|
51
|
+
def vertex_buffer=(new_vertex_buffer)
|
52
|
+
self[:vertexBuffer] = new_vertex_buffer
|
53
|
+
end
|
54
|
+
|
55
|
+
# Draw calls array, depends on textureId
|
56
|
+
# @return [rlDrawCall *] draws
|
57
|
+
def draws = self[:draws]
|
58
|
+
|
59
|
+
# Sets Draw calls array, depends on textureId
|
60
|
+
def draws=(new_draws)
|
61
|
+
self[:draws] = new_draws
|
62
|
+
end
|
63
|
+
|
64
|
+
# Draw calls counter
|
65
|
+
# @return [Integer] drawCounter
|
66
|
+
def draw_counter = self[:drawCounter]
|
67
|
+
|
68
|
+
# Sets Draw calls counter
|
69
|
+
def draw_counter=(new_draw_counter)
|
70
|
+
self[:drawCounter] = new_draw_counter
|
71
|
+
end
|
72
|
+
|
73
|
+
# Current depth value for next draw
|
74
|
+
# @return [Float] currentDepth
|
75
|
+
def current_depth = self[:currentDepth]
|
76
|
+
|
77
|
+
# Sets Current depth value for next draw
|
78
|
+
def current_depth=(new_current_depth)
|
79
|
+
self[:currentDepth] = new_current_depth
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Raylib
|
2
|
+
# Dynamic vertex buffers (position + texcoords + colors + indices arrays)
|
3
|
+
class RlVertexBuffer < FFI::Struct
|
4
|
+
layout(
|
5
|
+
:elementCount, :int, # Number of elements in the buffer (QUADS),
|
6
|
+
:vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0),
|
7
|
+
:texcoords, :pointer, # Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1),
|
8
|
+
:colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3),
|
9
|
+
:indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad),
|
10
|
+
:vaoId, :uint, # OpenGL Vertex Array Object id,
|
11
|
+
:vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
12
|
+
)
|
13
|
+
|
14
|
+
def self.create(element_count, vertices, texcoords, colors, indices, vao_id, vbo_id)
|
15
|
+
new.tap do |instance|
|
16
|
+
instance[:elementCount] = element_count
|
17
|
+
instance[:vertices] = vertices
|
18
|
+
instance[:texcoords] = texcoords
|
19
|
+
instance[:colors] = colors
|
20
|
+
instance[:indices] = indices
|
21
|
+
instance[:vaoId] = vao_id
|
22
|
+
instance[:vboId] = vbo_id
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_s
|
27
|
+
"Raylib::RlVertexBuffer##{object_id} element_count=#{element_count} vertices=#{vertices} texcoords=#{texcoords} colors=#{colors} indices=#{indices} vao_id=#{vao_id} vbo_id=#{vbo_id}"
|
28
|
+
end
|
29
|
+
|
30
|
+
# Number of elements in the buffer (QUADS)
|
31
|
+
# @return [Integer] elementCount
|
32
|
+
def element_count = self[:elementCount]
|
33
|
+
|
34
|
+
# Sets Number of elements in the buffer (QUADS)
|
35
|
+
def element_count=(new_element_count)
|
36
|
+
self[:elementCount] = new_element_count
|
37
|
+
end
|
38
|
+
|
39
|
+
# Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
40
|
+
# @return [float *] vertices
|
41
|
+
def vertices = self[:vertices]
|
42
|
+
|
43
|
+
# Sets Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
|
44
|
+
def vertices=(new_vertices)
|
45
|
+
self[:vertices] = new_vertices
|
46
|
+
end
|
47
|
+
|
48
|
+
# Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
49
|
+
# @return [float *] texcoords
|
50
|
+
def texcoords = self[:texcoords]
|
51
|
+
|
52
|
+
# Sets Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
|
53
|
+
def texcoords=(new_texcoords)
|
54
|
+
self[:texcoords] = new_texcoords
|
55
|
+
end
|
56
|
+
|
57
|
+
# Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
58
|
+
# @return [unsigned char *] colors
|
59
|
+
def colors = self[:colors]
|
60
|
+
|
61
|
+
# Sets Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
|
62
|
+
def colors=(new_colors)
|
63
|
+
self[:colors] = new_colors
|
64
|
+
end
|
65
|
+
|
66
|
+
# Vertex indices (in case vertex data comes indexed) (6 indices per quad)
|
67
|
+
# @return [unsigned int *] indices
|
68
|
+
def indices = self[:indices]
|
69
|
+
|
70
|
+
# Sets Vertex indices (in case vertex data comes indexed) (6 indices per quad)
|
71
|
+
def indices=(new_indices)
|
72
|
+
self[:indices] = new_indices
|
73
|
+
end
|
74
|
+
|
75
|
+
# OpenGL Vertex Array Object id
|
76
|
+
# @return [Integer] vaoId
|
77
|
+
def vao_id = self[:vaoId]
|
78
|
+
|
79
|
+
# Sets OpenGL Vertex Array Object id
|
80
|
+
def vao_id=(new_vao_id)
|
81
|
+
self[:vaoId] = new_vao_id
|
82
|
+
end
|
83
|
+
|
84
|
+
# OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
85
|
+
# @return [unsigned int[4]] vboId
|
86
|
+
def vbo_id = self[:vboId]
|
87
|
+
|
88
|
+
# Sets OpenGL Vertex Buffer Objects id (4 types of vertex data)
|
89
|
+
def vbo_id=(new_vbo_id)
|
90
|
+
self[:vboId] = new_vbo_id
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/lib/raylib/rlgl.rb
ADDED