raylib-bindings 0.1.4 → 0.3.0

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.
data/lib/rlgl.rb CHANGED
@@ -1,1078 +1,1107 @@
1
- # Yet another raylib wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/raylib-bindings
4
- #
5
- # [NOTICE] Autogenerated. Do not edit.
6
-
7
- require 'ffi'
8
-
9
- module Raylib
10
- extend FFI::Library
11
-
12
- # Define/Macro
13
-
14
- RLGL_VERSION = "4.0"
15
- RL_DEFAULT_BATCH_BUFFER_ELEMENTS = 8192
16
- RL_DEFAULT_BATCH_BUFFERS = 1 # Default number of batch buffers (multi-buffering)
17
- RL_DEFAULT_BATCH_DRAWCALLS = 256 # Default number of batch draw calls (by state changes: mode, texture)
18
- RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4 # Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
19
- RL_MAX_MATRIX_STACK_SIZE = 32 # Maximum size of Matrix stack
20
- RL_MAX_SHADER_LOCATIONS = 32 # Maximum number of shader locations supported
21
- RL_CULL_DISTANCE_NEAR = 0.01 # Default near cull distance
22
- RL_CULL_DISTANCE_FAR = 1000.0 # Default far cull distance
23
- RL_TEXTURE_WRAP_S = 0x2802 # GL_TEXTURE_WRAP_S
24
- RL_TEXTURE_WRAP_T = 0x2803 # GL_TEXTURE_WRAP_T
25
- RL_TEXTURE_MAG_FILTER = 0x2800 # GL_TEXTURE_MAG_FILTER
26
- RL_TEXTURE_MIN_FILTER = 0x2801 # GL_TEXTURE_MIN_FILTER
27
- RL_TEXTURE_FILTER_NEAREST = 0x2600 # GL_NEAREST
28
- RL_TEXTURE_FILTER_LINEAR = 0x2601 # GL_LINEAR
29
- RL_TEXTURE_FILTER_MIP_NEAREST = 0x2700 # GL_NEAREST_MIPMAP_NEAREST
30
- RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702 # GL_NEAREST_MIPMAP_LINEAR
31
- RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST = 0x2701 # GL_LINEAR_MIPMAP_NEAREST
32
- RL_TEXTURE_FILTER_MIP_LINEAR = 0x2703 # GL_LINEAR_MIPMAP_LINEAR
33
- RL_TEXTURE_FILTER_ANISOTROPIC = 0x3000 # Anisotropic filter (custom identifier)
34
- RL_TEXTURE_MIPMAP_BIAS_RATIO = 0x4000 # Texture mipmap bias, percentage ratio (custom identifier)
35
- RL_TEXTURE_WRAP_REPEAT = 0x2901 # GL_REPEAT
36
- RL_TEXTURE_WRAP_CLAMP = 0x812F # GL_CLAMP_TO_EDGE
37
- RL_TEXTURE_WRAP_MIRROR_REPEAT = 0x8370 # GL_MIRRORED_REPEAT
38
- RL_TEXTURE_WRAP_MIRROR_CLAMP = 0x8742 # GL_MIRROR_CLAMP_EXT
39
- RL_MODELVIEW = 0x1700 # GL_MODELVIEW
40
- RL_PROJECTION = 0x1701 # GL_PROJECTION
41
- RL_TEXTURE = 0x1702 # GL_TEXTURE
42
- RL_LINES = 0x0001 # GL_LINES
43
- RL_TRIANGLES = 0x0004 # GL_TRIANGLES
44
- RL_QUADS = 0x0007 # GL_QUADS
45
- RL_UNSIGNED_BYTE = 0x1401 # GL_UNSIGNED_BYTE
46
- RL_FLOAT = 0x1406 # GL_FLOAT
47
- RL_STREAM_DRAW = 0x88E0 # GL_STREAM_DRAW
48
- RL_STREAM_READ = 0x88E1 # GL_STREAM_READ
49
- RL_STREAM_COPY = 0x88E2 # GL_STREAM_COPY
50
- RL_STATIC_DRAW = 0x88E4 # GL_STATIC_DRAW
51
- RL_STATIC_READ = 0x88E5 # GL_STATIC_READ
52
- RL_STATIC_COPY = 0x88E6 # GL_STATIC_COPY
53
- RL_DYNAMIC_DRAW = 0x88E8 # GL_DYNAMIC_DRAW
54
- RL_DYNAMIC_READ = 0x88E9 # GL_DYNAMIC_READ
55
- RL_DYNAMIC_COPY = 0x88EA # GL_DYNAMIC_COPY
56
- RL_FRAGMENT_SHADER = 0x8B30 # GL_FRAGMENT_SHADER
57
- RL_VERTEX_SHADER = 0x8B31 # GL_VERTEX_SHADER
58
- RL_COMPUTE_SHADER = 0x91B9 # GL_COMPUTE_SHADER
59
- RL_ZERO = 0 # GL_ZERO
60
- RL_ONE = 1 # GL_ONE
61
- RL_SRC_COLOR = 0x0300 # GL_SRC_COLOR
62
- RL_ONE_MINUS_SRC_COLOR = 0x0301 # GL_ONE_MINUS_SRC_COLOR
63
- RL_SRC_ALPHA = 0x0302 # GL_SRC_ALPHA
64
- RL_ONE_MINUS_SRC_ALPHA = 0x0303 # GL_ONE_MINUS_SRC_ALPHA
65
- RL_DST_ALPHA = 0x0304 # GL_DST_ALPHA
66
- RL_ONE_MINUS_DST_ALPHA = 0x0305 # GL_ONE_MINUS_DST_ALPHA
67
- RL_DST_COLOR = 0x0306 # GL_DST_COLOR
68
- RL_ONE_MINUS_DST_COLOR = 0x0307 # GL_ONE_MINUS_DST_COLOR
69
- RL_SRC_ALPHA_SATURATE = 0x0308 # GL_SRC_ALPHA_SATURATE
70
- RL_CONSTANT_COLOR = 0x8001 # GL_CONSTANT_COLOR
71
- RL_ONE_MINUS_CONSTANT_COLOR = 0x8002 # GL_ONE_MINUS_CONSTANT_COLOR
72
- RL_CONSTANT_ALPHA = 0x8003 # GL_CONSTANT_ALPHA
73
- RL_ONE_MINUS_CONSTANT_ALPHA = 0x8004 # GL_ONE_MINUS_CONSTANT_ALPHA
74
- RL_FUNC_ADD = 0x8006 # GL_FUNC_ADD
75
- RL_FUNC_SUBTRACT = 0x800A # GL_FUNC_SUBTRACT
76
- RL_FUNC_REVERSE_SUBTRACT = 0x800B # GL_FUNC_REVERSE_SUBTRACT
77
- RL_BLEND_EQUATION = 0x8009 # GL_BLEND_EQUATION
78
- RL_BLEND_EQUATION_RGB = 0x8009 # GL_BLEND_EQUATION_RGB // (Same as BLEND_EQUATION)
79
- RL_BLEND_EQUATION_ALPHA = 0x883D # GL_BLEND_EQUATION_ALPHA
80
- RL_BLEND_DST_RGB = 0x80C8 # GL_BLEND_DST_RGB
81
- RL_BLEND_SRC_RGB = 0x80C9 # GL_BLEND_SRC_RGB
82
- RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
83
- RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
84
- RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
85
-
86
- # Enum
87
-
88
- RL_OPENGL_11 = 1 # OpenGL 1.1
89
- RL_OPENGL_21 = 2 # OpenGL 2.1 (GLSL 120)
90
- RL_OPENGL_33 = 3 # OpenGL 3.3 (GLSL 330)
91
- RL_OPENGL_43 = 4 # OpenGL 4.3 (using GLSL 330)
92
- RL_OPENGL_ES_20 = 5 # OpenGL ES 2.0 (GLSL 100)
93
- RL_LOG_ALL = 0 # Display all logs
94
- RL_LOG_TRACE = 1 # Trace logging, intended for internal use only
95
- RL_LOG_DEBUG = 2 # Debug logging, used for internal debugging, it should be disabled on release builds
96
- RL_LOG_INFO = 3 # Info logging, used for program execution info
97
- RL_LOG_WARNING = 4 # Warning logging, used on recoverable failures
98
- RL_LOG_ERROR = 5 # Error logging, used on unrecoverable failures
99
- RL_LOG_FATAL = 6 # Fatal logging, used to abort program: exit(EXIT_FAILURE)
100
- RL_LOG_NONE = 7 # Disable logging
101
- RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1 # 8 bit per pixel (no alpha)
102
- RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2 # 8*2 bpp (2 channels)
103
- RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3 # 16 bpp
104
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4 # 24 bpp
105
- RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5 # 16 bpp (1 bit alpha)
106
- RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6 # 16 bpp (4 bit alpha)
107
- RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7 # 32 bpp
108
- RL_PIXELFORMAT_UNCOMPRESSED_R32 = 8 # 32 bpp (1 channel - float)
109
- RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9 # 32*3 bpp (3 channels - float)
110
- RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10 # 32*4 bpp (4 channels - float)
111
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGB = 11 # 4 bpp (no alpha)
112
- RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12 # 4 bpp (1 bit alpha)
113
- RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13 # 8 bpp
114
- RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14 # 8 bpp
115
- RL_PIXELFORMAT_COMPRESSED_ETC1_RGB = 15 # 4 bpp
116
- RL_PIXELFORMAT_COMPRESSED_ETC2_RGB = 16 # 4 bpp
117
- RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17 # 8 bpp
118
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGB = 18 # 4 bpp
119
- RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19 # 4 bpp
120
- RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20 # 8 bpp
121
- RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21 # 2 bpp
122
- RL_TEXTURE_FILTER_POINT = 0 # No filter, just pixel approximation
123
- RL_TEXTURE_FILTER_BILINEAR = 1 # Linear filtering
124
- RL_TEXTURE_FILTER_TRILINEAR = 2 # Trilinear filtering (linear with mipmaps)
125
- RL_TEXTURE_FILTER_ANISOTROPIC_4X = 3 # Anisotropic filtering 4x
126
- RL_TEXTURE_FILTER_ANISOTROPIC_8X = 4 # Anisotropic filtering 8x
127
- RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5 # Anisotropic filtering 16x
128
- RL_BLEND_ALPHA = 0 # Blend textures considering alpha (default)
129
- RL_BLEND_ADDITIVE = 1 # Blend textures adding colors
130
- RL_BLEND_MULTIPLIED = 2 # Blend textures multiplying colors
131
- RL_BLEND_ADD_COLORS = 3 # Blend textures adding colors (alternative)
132
- RL_BLEND_SUBTRACT_COLORS = 4 # Blend textures subtracting colors (alternative)
133
- RL_BLEND_ALPHA_PREMULTIPLY = 5 # Blend premultiplied textures considering alpha
134
- RL_BLEND_CUSTOM = 6 # Blend textures using custom src/dst factors (use rlSetBlendFactors())
135
- RL_BLEND_CUSTOM_SEPARATE = 7 # Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
136
- RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
137
- RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1 # Shader location: vertex attribute: texcoord01
138
- RL_SHADER_LOC_VERTEX_TEXCOORD02 = 2 # Shader location: vertex attribute: texcoord02
139
- RL_SHADER_LOC_VERTEX_NORMAL = 3 # Shader location: vertex attribute: normal
140
- RL_SHADER_LOC_VERTEX_TANGENT = 4 # Shader location: vertex attribute: tangent
141
- RL_SHADER_LOC_VERTEX_COLOR = 5 # Shader location: vertex attribute: color
142
- RL_SHADER_LOC_MATRIX_MVP = 6 # Shader location: matrix uniform: model-view-projection
143
- RL_SHADER_LOC_MATRIX_VIEW = 7 # Shader location: matrix uniform: view (camera transform)
144
- RL_SHADER_LOC_MATRIX_PROJECTION = 8 # Shader location: matrix uniform: projection
145
- RL_SHADER_LOC_MATRIX_MODEL = 9 # Shader location: matrix uniform: model (transform)
146
- RL_SHADER_LOC_MATRIX_NORMAL = 10 # Shader location: matrix uniform: normal
147
- RL_SHADER_LOC_VECTOR_VIEW = 11 # Shader location: vector uniform: view
148
- RL_SHADER_LOC_COLOR_DIFFUSE = 12 # Shader location: vector uniform: diffuse color
149
- RL_SHADER_LOC_COLOR_SPECULAR = 13 # Shader location: vector uniform: specular color
150
- RL_SHADER_LOC_COLOR_AMBIENT = 14 # Shader location: vector uniform: ambient color
151
- RL_SHADER_LOC_MAP_ALBEDO = 15 # Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
152
- RL_SHADER_LOC_MAP_METALNESS = 16 # Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
153
- RL_SHADER_LOC_MAP_NORMAL = 17 # Shader location: sampler2d texture: normal
154
- RL_SHADER_LOC_MAP_ROUGHNESS = 18 # Shader location: sampler2d texture: roughness
155
- RL_SHADER_LOC_MAP_OCCLUSION = 19 # Shader location: sampler2d texture: occlusion
156
- RL_SHADER_LOC_MAP_EMISSION = 20 # Shader location: sampler2d texture: emission
157
- RL_SHADER_LOC_MAP_HEIGHT = 21 # Shader location: sampler2d texture: height
158
- RL_SHADER_LOC_MAP_CUBEMAP = 22 # Shader location: samplerCube texture: cubemap
159
- RL_SHADER_LOC_MAP_IRRADIANCE = 23 # Shader location: samplerCube texture: irradiance
160
- RL_SHADER_LOC_MAP_PREFILTER = 24 # Shader location: samplerCube texture: prefilter
161
- RL_SHADER_LOC_MAP_BRDF = 25 # Shader location: sampler2d texture: brdf
162
- RL_SHADER_UNIFORM_FLOAT = 0 # Shader uniform type: float
163
- RL_SHADER_UNIFORM_VEC2 = 1 # Shader uniform type: vec2 (2 float)
164
- RL_SHADER_UNIFORM_VEC3 = 2 # Shader uniform type: vec3 (3 float)
165
- RL_SHADER_UNIFORM_VEC4 = 3 # Shader uniform type: vec4 (4 float)
166
- RL_SHADER_UNIFORM_INT = 4 # Shader uniform type: int
167
- RL_SHADER_UNIFORM_IVEC2 = 5 # Shader uniform type: ivec2 (2 int)
168
- RL_SHADER_UNIFORM_IVEC3 = 6 # Shader uniform type: ivec3 (3 int)
169
- RL_SHADER_UNIFORM_IVEC4 = 7 # Shader uniform type: ivec4 (4 int)
170
- RL_SHADER_UNIFORM_SAMPLER2D = 8 # Shader uniform type: sampler2d
171
- RL_SHADER_ATTRIB_FLOAT = 0 # Shader attribute type: float
172
- RL_SHADER_ATTRIB_VEC2 = 1 # Shader attribute type: vec2 (2 float)
173
- RL_SHADER_ATTRIB_VEC3 = 2 # Shader attribute type: vec3 (3 float)
174
- RL_SHADER_ATTRIB_VEC4 = 3 # Shader attribute type: vec4 (4 float)
175
- RL_ATTACHMENT_COLOR_CHANNEL0 = 0 # Framebuffer attachmment type: color 0
176
- RL_ATTACHMENT_COLOR_CHANNEL1 = 1 # Framebuffer attachmment type: color 1
177
- RL_ATTACHMENT_COLOR_CHANNEL2 = 2 # Framebuffer attachmment type: color 2
178
- RL_ATTACHMENT_COLOR_CHANNEL3 = 3 # Framebuffer attachmment type: color 3
179
- RL_ATTACHMENT_COLOR_CHANNEL4 = 4 # Framebuffer attachmment type: color 4
180
- RL_ATTACHMENT_COLOR_CHANNEL5 = 5 # Framebuffer attachmment type: color 5
181
- RL_ATTACHMENT_COLOR_CHANNEL6 = 6 # Framebuffer attachmment type: color 6
182
- RL_ATTACHMENT_COLOR_CHANNEL7 = 7 # Framebuffer attachmment type: color 7
183
- RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachmment type: depth
184
- RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachmment type: stencil
185
- RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0 # Framebuffer texture attachment type: cubemap, +X side
186
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1 # Framebuffer texture attachment type: cubemap, -X side
187
- RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2 # Framebuffer texture attachment type: cubemap, +Y side
188
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 # Framebuffer texture attachment type: cubemap, -Y side
189
- RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 # Framebuffer texture attachment type: cubemap, +Z side
190
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5 # Framebuffer texture attachment type: cubemap, -Z side
191
- RL_ATTACHMENT_TEXTURE2D = 100 # Framebuffer texture attachment type: texture2d
192
- RL_ATTACHMENT_RENDERBUFFER = 200 # Framebuffer texture attachment type: renderbuffer
193
- RL_CULL_FACE_FRONT = 0
194
- RL_CULL_FACE_BACK = 1
195
-
196
- # Typedef
197
-
198
- typedef :int, :rlGlVersion
199
- typedef :int, :rlTraceLogLevel
200
- typedef :int, :rlPixelFormat
201
- typedef :int, :rlTextureFilter
202
- typedef :int, :rlBlendMode
203
- typedef :int, :rlShaderLocationIndex
204
- typedef :int, :rlShaderUniformDataType
205
- typedef :int, :rlShaderAttributeDataType
206
- typedef :int, :rlFramebufferAttachType
207
- typedef :int, :rlFramebufferAttachTextureType
208
- typedef :int, :rlCullMode
209
-
210
- # Struct
211
-
212
- # Dynamic vertex buffers (position + texcoords + colors + indices arrays)
213
- class RlVertexBuffer < FFI::Struct
214
- layout(
215
- :elementCount, :int, # Number of elements in the buffer (QUADS)
216
- :vertices, :pointer, # Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
217
- :texcoords, :pointer, # Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
218
- :colors, :pointer, # Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
219
- :indices, :pointer, # Vertex indices (in case vertex data comes indexed) (6 indices per quad)
220
- :vaoId, :uint, # OpenGL Vertex Array Object id
221
- :vboId, [:uint, 4], # OpenGL Vertex Buffer Objects id (4 types of vertex data)
222
- )
223
- end
224
-
225
- # of those state-change happens (this is done in core module)
226
- class RlDrawCall < FFI::Struct
227
- layout(
228
- :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
229
- :vertexCount, :int, # Number of vertex of the draw
230
- :vertexAlignment, :int, # Number of vertex required for index alignment (LINES, TRIANGLES)
231
- :textureId, :uint, # Texture id to be used on the draw -> Use to create new draw call if changes
232
- )
233
- end
234
-
235
- # rlRenderBatch type
236
- class RlRenderBatch < FFI::Struct
237
- layout(
238
- :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
239
- :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
240
- :vertexBuffer, :pointer, # Dynamic buffer(s) for vertex data
241
- :draws, :pointer, # Draw calls array, depends on textureId
242
- :drawCounter, :int, # Draw calls counter
243
- :currentDepth, :float, # Current depth value for next draw
244
- )
245
- end
246
-
247
-
248
- # Function
249
-
250
- def self.setup_rlgl_symbols(output_error = false)
251
- entries = [
252
-
253
- # rlMatrixMode : Choose the current matrix to be transformed
254
- # @param mode [int]
255
- # @return [void]
256
- [:rlMatrixMode, :rlMatrixMode, [:int], :void],
257
-
258
- # rlPushMatrix : Push the current matrix to stack
259
- # @return [void]
260
- [:rlPushMatrix, :rlPushMatrix, [], :void],
261
-
262
- # rlPopMatrix : Pop lattest inserted matrix from stack
263
- # @return [void]
264
- [:rlPopMatrix, :rlPopMatrix, [], :void],
265
-
266
- # rlLoadIdentity : Reset current matrix to identity matrix
267
- # @return [void]
268
- [:rlLoadIdentity, :rlLoadIdentity, [], :void],
269
-
270
- # rlTranslatef : Multiply the current matrix by a translation matrix
271
- # @param x [float]
272
- # @param y [float]
273
- # @param z [float]
274
- # @return [void]
275
- [:rlTranslatef, :rlTranslatef, [:float, :float, :float], :void],
276
-
277
- # rlRotatef : Multiply the current matrix by a rotation matrix
278
- # @param angle [float]
279
- # @param x [float]
280
- # @param y [float]
281
- # @param z [float]
282
- # @return [void]
283
- [:rlRotatef, :rlRotatef, [:float, :float, :float, :float], :void],
284
-
285
- # rlScalef : Multiply the current matrix by a scaling matrix
286
- # @param x [float]
287
- # @param y [float]
288
- # @param z [float]
289
- # @return [void]
290
- [:rlScalef, :rlScalef, [:float, :float, :float], :void],
291
-
292
- # rlMultMatrixf : Multiply the current matrix by another matrix
293
- # @param matf [const float *]
294
- # @return [void]
295
- [:rlMultMatrixf, :rlMultMatrixf, [:pointer], :void],
296
-
297
- # rlFrustum :
298
- # @param left [double]
299
- # @param right [double]
300
- # @param bottom [double]
301
- # @param top [double]
302
- # @param znear [double]
303
- # @param zfar [double]
304
- # @return [void]
305
- [:rlFrustum, :rlFrustum, [:double, :double, :double, :double, :double, :double], :void],
306
-
307
- # rlOrtho :
308
- # @param left [double]
309
- # @param right [double]
310
- # @param bottom [double]
311
- # @param top [double]
312
- # @param znear [double]
313
- # @param zfar [double]
314
- # @return [void]
315
- [:rlOrtho, :rlOrtho, [:double, :double, :double, :double, :double, :double], :void],
316
-
317
- # rlViewport : Set the viewport area
318
- # @param x [int]
319
- # @param y [int]
320
- # @param width [int]
321
- # @param height [int]
322
- # @return [void]
323
- [:rlViewport, :rlViewport, [:int, :int, :int, :int], :void],
324
-
325
- # rlBegin : Initialize drawing mode (how to organize vertex)
326
- # @param mode [int]
327
- # @return [void]
328
- [:rlBegin, :rlBegin, [:int], :void],
329
-
330
- # rlEnd : Finish vertex providing
331
- # @return [void]
332
- [:rlEnd, :rlEnd, [], :void],
333
-
334
- # rlVertex2i : Define one vertex (position) - 2 int
335
- # @param x [int]
336
- # @param y [int]
337
- # @return [void]
338
- [:rlVertex2i, :rlVertex2i, [:int, :int], :void],
339
-
340
- # rlVertex2f : Define one vertex (position) - 2 float
341
- # @param x [float]
342
- # @param y [float]
343
- # @return [void]
344
- [:rlVertex2f, :rlVertex2f, [:float, :float], :void],
345
-
346
- # rlVertex3f : Define one vertex (position) - 3 float
347
- # @param x [float]
348
- # @param y [float]
349
- # @param z [float]
350
- # @return [void]
351
- [:rlVertex3f, :rlVertex3f, [:float, :float, :float], :void],
352
-
353
- # rlTexCoord2f : Define one vertex (texture coordinate) - 2 float
354
- # @param x [float]
355
- # @param y [float]
356
- # @return [void]
357
- [:rlTexCoord2f, :rlTexCoord2f, [:float, :float], :void],
358
-
359
- # rlNormal3f : Define one vertex (normal) - 3 float
360
- # @param x [float]
361
- # @param y [float]
362
- # @param z [float]
363
- # @return [void]
364
- [:rlNormal3f, :rlNormal3f, [:float, :float, :float], :void],
365
-
366
- # rlColor4ub : Define one vertex (color) - 4 byte
367
- # @param r [unsigned char]
368
- # @param g [unsigned char]
369
- # @param b [unsigned char]
370
- # @param a [unsigned char]
371
- # @return [void]
372
- [:rlColor4ub, :rlColor4ub, [:uchar, :uchar, :uchar, :uchar], :void],
373
-
374
- # rlColor3f : Define one vertex (color) - 3 float
375
- # @param x [float]
376
- # @param y [float]
377
- # @param z [float]
378
- # @return [void]
379
- [:rlColor3f, :rlColor3f, [:float, :float, :float], :void],
380
-
381
- # rlColor4f : Define one vertex (color) - 4 float
382
- # @param x [float]
383
- # @param y [float]
384
- # @param z [float]
385
- # @param w [float]
386
- # @return [void]
387
- [:rlColor4f, :rlColor4f, [:float, :float, :float, :float], :void],
388
-
389
- # rlEnableVertexArray : Enable vertex array (VAO, if supported)
390
- # @param vaoId [unsigned int]
391
- # @return [bool]
392
- [:rlEnableVertexArray, :rlEnableVertexArray, [:uint], :bool],
393
-
394
- # rlDisableVertexArray : Disable vertex array (VAO, if supported)
395
- # @return [void]
396
- [:rlDisableVertexArray, :rlDisableVertexArray, [], :void],
397
-
398
- # rlEnableVertexBuffer : Enable vertex buffer (VBO)
399
- # @param id [unsigned int]
400
- # @return [void]
401
- [:rlEnableVertexBuffer, :rlEnableVertexBuffer, [:uint], :void],
402
-
403
- # rlDisableVertexBuffer : Disable vertex buffer (VBO)
404
- # @return [void]
405
- [:rlDisableVertexBuffer, :rlDisableVertexBuffer, [], :void],
406
-
407
- # rlEnableVertexBufferElement : Enable vertex buffer element (VBO element)
408
- # @param id [unsigned int]
409
- # @return [void]
410
- [:rlEnableVertexBufferElement, :rlEnableVertexBufferElement, [:uint], :void],
411
-
412
- # rlDisableVertexBufferElement : Disable vertex buffer element (VBO element)
413
- # @return [void]
414
- [:rlDisableVertexBufferElement, :rlDisableVertexBufferElement, [], :void],
415
-
416
- # rlEnableVertexAttribute : Enable vertex attribute index
417
- # @param index [unsigned int]
418
- # @return [void]
419
- [:rlEnableVertexAttribute, :rlEnableVertexAttribute, [:uint], :void],
420
-
421
- # rlDisableVertexAttribute : Disable vertex attribute index
422
- # @param index [unsigned int]
423
- # @return [void]
424
- [:rlDisableVertexAttribute, :rlDisableVertexAttribute, [:uint], :void],
425
-
426
- # rlActiveTextureSlot : Select and active a texture slot
427
- # @param slot [int]
428
- # @return [void]
429
- [:rlActiveTextureSlot, :rlActiveTextureSlot, [:int], :void],
430
-
431
- # rlEnableTexture : Enable texture
432
- # @param id [unsigned int]
433
- # @return [void]
434
- [:rlEnableTexture, :rlEnableTexture, [:uint], :void],
435
-
436
- # rlDisableTexture : Disable texture
437
- # @return [void]
438
- [:rlDisableTexture, :rlDisableTexture, [], :void],
439
-
440
- # rlEnableTextureCubemap : Enable texture cubemap
441
- # @param id [unsigned int]
442
- # @return [void]
443
- [:rlEnableTextureCubemap, :rlEnableTextureCubemap, [:uint], :void],
444
-
445
- # rlDisableTextureCubemap : Disable texture cubemap
446
- # @return [void]
447
- [:rlDisableTextureCubemap, :rlDisableTextureCubemap, [], :void],
448
-
449
- # rlTextureParameters : Set texture parameters (filter, wrap)
450
- # @param id [unsigned int]
451
- # @param param [int]
452
- # @param value [int]
453
- # @return [void]
454
- [:rlTextureParameters, :rlTextureParameters, [:uint, :int, :int], :void],
455
-
456
- # rlEnableShader : Enable shader program
457
- # @param id [unsigned int]
458
- # @return [void]
459
- [:rlEnableShader, :rlEnableShader, [:uint], :void],
460
-
461
- # rlDisableShader : Disable shader program
462
- # @return [void]
463
- [:rlDisableShader, :rlDisableShader, [], :void],
464
-
465
- # rlEnableFramebuffer : Enable render texture (fbo)
466
- # @param id [unsigned int]
467
- # @return [void]
468
- [:rlEnableFramebuffer, :rlEnableFramebuffer, [:uint], :void],
469
-
470
- # rlDisableFramebuffer : Disable render texture (fbo), return to default framebuffer
471
- # @return [void]
472
- [:rlDisableFramebuffer, :rlDisableFramebuffer, [], :void],
473
-
474
- # rlActiveDrawBuffers : Activate multiple draw color buffers
475
- # @param count [int]
476
- # @return [void]
477
- [:rlActiveDrawBuffers, :rlActiveDrawBuffers, [:int], :void],
478
-
479
- # rlEnableColorBlend : Enable color blending
480
- # @return [void]
481
- [:rlEnableColorBlend, :rlEnableColorBlend, [], :void],
482
-
483
- # rlDisableColorBlend : Disable color blending
484
- # @return [void]
485
- [:rlDisableColorBlend, :rlDisableColorBlend, [], :void],
486
-
487
- # rlEnableDepthTest : Enable depth test
488
- # @return [void]
489
- [:rlEnableDepthTest, :rlEnableDepthTest, [], :void],
490
-
491
- # rlDisableDepthTest : Disable depth test
492
- # @return [void]
493
- [:rlDisableDepthTest, :rlDisableDepthTest, [], :void],
494
-
495
- # rlEnableDepthMask : Enable depth write
496
- # @return [void]
497
- [:rlEnableDepthMask, :rlEnableDepthMask, [], :void],
498
-
499
- # rlDisableDepthMask : Disable depth write
500
- # @return [void]
501
- [:rlDisableDepthMask, :rlDisableDepthMask, [], :void],
502
-
503
- # rlEnableBackfaceCulling : Enable backface culling
504
- # @return [void]
505
- [:rlEnableBackfaceCulling, :rlEnableBackfaceCulling, [], :void],
506
-
507
- # rlDisableBackfaceCulling : Disable backface culling
508
- # @return [void]
509
- [:rlDisableBackfaceCulling, :rlDisableBackfaceCulling, [], :void],
510
-
511
- # rlSetCullFace : Set face culling mode
512
- # @param mode [int]
513
- # @return [void]
514
- [:rlSetCullFace, :rlSetCullFace, [:int], :void],
515
-
516
- # rlEnableScissorTest : Enable scissor test
517
- # @return [void]
518
- [:rlEnableScissorTest, :rlEnableScissorTest, [], :void],
519
-
520
- # rlDisableScissorTest : Disable scissor test
521
- # @return [void]
522
- [:rlDisableScissorTest, :rlDisableScissorTest, [], :void],
523
-
524
- # rlScissor : Scissor test
525
- # @param x [int]
526
- # @param y [int]
527
- # @param width [int]
528
- # @param height [int]
529
- # @return [void]
530
- [:rlScissor, :rlScissor, [:int, :int, :int, :int], :void],
531
-
532
- # rlEnableWireMode : Enable wire mode
533
- # @return [void]
534
- [:rlEnableWireMode, :rlEnableWireMode, [], :void],
535
-
536
- # rlDisableWireMode : Disable wire mode
537
- # @return [void]
538
- [:rlDisableWireMode, :rlDisableWireMode, [], :void],
539
-
540
- # rlSetLineWidth : Set the line drawing width
541
- # @param width [float]
542
- # @return [void]
543
- [:rlSetLineWidth, :rlSetLineWidth, [:float], :void],
544
-
545
- # rlGetLineWidth : Get the line drawing width
546
- # @return [float]
547
- [:rlGetLineWidth, :rlGetLineWidth, [], :float],
548
-
549
- # rlEnableSmoothLines : Enable line aliasing
550
- # @return [void]
551
- [:rlEnableSmoothLines, :rlEnableSmoothLines, [], :void],
552
-
553
- # rlDisableSmoothLines : Disable line aliasing
554
- # @return [void]
555
- [:rlDisableSmoothLines, :rlDisableSmoothLines, [], :void],
556
-
557
- # rlEnableStereoRender : Enable stereo rendering
558
- # @return [void]
559
- [:rlEnableStereoRender, :rlEnableStereoRender, [], :void],
560
-
561
- # rlDisableStereoRender : Disable stereo rendering
562
- # @return [void]
563
- [:rlDisableStereoRender, :rlDisableStereoRender, [], :void],
564
-
565
- # rlIsStereoRenderEnabled : Check if stereo render is enabled
566
- # @return [bool]
567
- [:rlIsStereoRenderEnabled, :rlIsStereoRenderEnabled, [], :bool],
568
-
569
- # rlClearColor : Clear color buffer with color
570
- # @param r [unsigned char]
571
- # @param g [unsigned char]
572
- # @param b [unsigned char]
573
- # @param a [unsigned char]
574
- # @return [void]
575
- [:rlClearColor, :rlClearColor, [:uchar, :uchar, :uchar, :uchar], :void],
576
-
577
- # rlClearScreenBuffers : Clear used screen buffers (color and depth)
578
- # @return [void]
579
- [:rlClearScreenBuffers, :rlClearScreenBuffers, [], :void],
580
-
581
- # rlCheckErrors : Check and log OpenGL error codes
582
- # @return [void]
583
- [:rlCheckErrors, :rlCheckErrors, [], :void],
584
-
585
- # rlSetBlendMode : Set blending mode
586
- # @param mode [int]
587
- # @return [void]
588
- [:rlSetBlendMode, :rlSetBlendMode, [:int], :void],
589
-
590
- # rlSetBlendFactors : Set blending mode factor and equation (using OpenGL factors)
591
- # @param glSrcFactor [int]
592
- # @param glDstFactor [int]
593
- # @param glEquation [int]
594
- # @return [void]
595
- [:rlSetBlendFactors, :rlSetBlendFactors, [:int, :int, :int], :void],
596
-
597
- # rlSetBlendFactorsSeparate : Set blending mode factors and equations separately (using OpenGL factors)
598
- # @param glSrcRGB [int]
599
- # @param glDstRGB [int]
600
- # @param glSrcAlpha [int]
601
- # @param glDstAlpha [int]
602
- # @param glEqRGB [int]
603
- # @param glEqAlpha [int]
604
- # @return [void]
605
- [:rlSetBlendFactorsSeparate, :rlSetBlendFactorsSeparate, [:int, :int, :int, :int, :int, :int], :void],
606
-
607
- # rlglInit : Initialize rlgl (buffers, shaders, textures, states)
608
- # @param width [int]
609
- # @param height [int]
610
- # @return [void]
611
- [:rlglInit, :rlglInit, [:int, :int], :void],
612
-
613
- # rlglClose : De-inititialize rlgl (buffers, shaders, textures)
614
- # @return [void]
615
- [:rlglClose, :rlglClose, [], :void],
616
-
617
- # rlLoadExtensions : Load OpenGL extensions (loader function required)
618
- # @param loader [void *]
619
- # @return [void]
620
- [:rlLoadExtensions, :rlLoadExtensions, [:pointer], :void],
621
-
622
- # rlGetVersion : Get current OpenGL version
623
- # @return [int]
624
- [:rlGetVersion, :rlGetVersion, [], :int],
625
-
626
- # rlSetFramebufferWidth : Set current framebuffer width
627
- # @param width [int]
628
- # @return [void]
629
- [:rlSetFramebufferWidth, :rlSetFramebufferWidth, [:int], :void],
630
-
631
- # rlGetFramebufferWidth : Get default framebuffer width
632
- # @return [int]
633
- [:rlGetFramebufferWidth, :rlGetFramebufferWidth, [], :int],
634
-
635
- # rlSetFramebufferHeight : Set current framebuffer height
636
- # @param height [int]
637
- # @return [void]
638
- [:rlSetFramebufferHeight, :rlSetFramebufferHeight, [:int], :void],
639
-
640
- # rlGetFramebufferHeight : Get default framebuffer height
641
- # @return [int]
642
- [:rlGetFramebufferHeight, :rlGetFramebufferHeight, [], :int],
643
-
644
- # rlGetTextureIdDefault : Get default texture id
645
- # @return [unsigned int]
646
- [:rlGetTextureIdDefault, :rlGetTextureIdDefault, [], :uint],
647
-
648
- # rlGetShaderIdDefault : Get default shader id
649
- # @return [unsigned int]
650
- [:rlGetShaderIdDefault, :rlGetShaderIdDefault, [], :uint],
651
-
652
- # rlGetShaderLocsDefault : Get default shader locations
653
- # @return [int *]
654
- [:rlGetShaderLocsDefault, :rlGetShaderLocsDefault, [], :pointer],
655
-
656
- # rlLoadRenderBatch : Load a render batch system
657
- # @param numBuffers [int]
658
- # @param bufferElements [int]
659
- # @return [rlRenderBatch]
660
- [:rlLoadRenderBatch, :rlLoadRenderBatch, [:int, :int], RlRenderBatch.by_value],
661
-
662
- # rlUnloadRenderBatch : Unload render batch system
663
- # @param batch [rlRenderBatch]
664
- # @return [void]
665
- [:rlUnloadRenderBatch, :rlUnloadRenderBatch, [RlRenderBatch.by_value], :void],
666
-
667
- # rlDrawRenderBatch : Draw render batch data (Update->Draw->Reset)
668
- # @param batch [rlRenderBatch *]
669
- # @return [void]
670
- [:rlDrawRenderBatch, :rlDrawRenderBatch, [:pointer], :void],
671
-
672
- # rlSetRenderBatchActive : Set the active render batch for rlgl (NULL for default internal)
673
- # @param batch [rlRenderBatch *]
674
- # @return [void]
675
- [:rlSetRenderBatchActive, :rlSetRenderBatchActive, [:pointer], :void],
676
-
677
- # rlDrawRenderBatchActive : Update and draw internal render batch
678
- # @return [void]
679
- [:rlDrawRenderBatchActive, :rlDrawRenderBatchActive, [], :void],
680
-
681
- # rlCheckRenderBatchLimit : Check internal buffer overflow for a given number of vertex
682
- # @param vCount [int]
683
- # @return [bool]
684
- [:rlCheckRenderBatchLimit, :rlCheckRenderBatchLimit, [:int], :bool],
685
-
686
- # rlSetTexture : Set current texture for render batch and check buffers limits
687
- # @param id [unsigned int]
688
- # @return [void]
689
- [:rlSetTexture, :rlSetTexture, [:uint], :void],
690
-
691
- # rlLoadVertexArray : Load vertex array (vao) if supported
692
- # @return [unsigned int]
693
- [:rlLoadVertexArray, :rlLoadVertexArray, [], :uint],
694
-
695
- # rlLoadVertexBuffer : Load a vertex buffer attribute
696
- # @param buffer [const void *]
697
- # @param size [int]
698
- # @param dynamic [bool]
699
- # @return [unsigned int]
700
- [:rlLoadVertexBuffer, :rlLoadVertexBuffer, [:pointer, :int, :bool], :uint],
701
-
702
- # rlLoadVertexBufferElement : Load a new attributes element buffer
703
- # @param buffer [const void *]
704
- # @param size [int]
705
- # @param dynamic [bool]
706
- # @return [unsigned int]
707
- [:rlLoadVertexBufferElement, :rlLoadVertexBufferElement, [:pointer, :int, :bool], :uint],
708
-
709
- # rlUpdateVertexBuffer : Update GPU buffer with new data
710
- # @param bufferId [unsigned int]
711
- # @param data [const void *]
712
- # @param dataSize [int]
713
- # @param offset [int]
714
- # @return [void]
715
- [:rlUpdateVertexBuffer, :rlUpdateVertexBuffer, [:uint, :pointer, :int, :int], :void],
716
-
717
- # rlUpdateVertexBufferElements : Update vertex buffer elements with new data
718
- # @param id [unsigned int]
719
- # @param data [const void *]
720
- # @param dataSize [int]
721
- # @param offset [int]
722
- # @return [void]
723
- [:rlUpdateVertexBufferElements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void],
724
-
725
- # rlUnloadVertexArray :
726
- # @param vaoId [unsigned int]
727
- # @return [void]
728
- [:rlUnloadVertexArray, :rlUnloadVertexArray, [:uint], :void],
729
-
730
- # rlUnloadVertexBuffer :
731
- # @param vboId [unsigned int]
732
- # @return [void]
733
- [:rlUnloadVertexBuffer, :rlUnloadVertexBuffer, [:uint], :void],
734
-
735
- # rlSetVertexAttribute :
736
- # @param index [unsigned int]
737
- # @param compSize [int]
738
- # @param type [int]
739
- # @param normalized [bool]
740
- # @param stride [int]
741
- # @param pointer [const void *]
742
- # @return [void]
743
- [:rlSetVertexAttribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void],
744
-
745
- # rlSetVertexAttributeDivisor :
746
- # @param index [unsigned int]
747
- # @param divisor [int]
748
- # @return [void]
749
- [:rlSetVertexAttributeDivisor, :rlSetVertexAttributeDivisor, [:uint, :int], :void],
750
-
751
- # rlSetVertexAttributeDefault : Set vertex attribute default value
752
- # @param locIndex [int]
753
- # @param value [const void *]
754
- # @param attribType [int]
755
- # @param count [int]
756
- # @return [void]
757
- [:rlSetVertexAttributeDefault, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void],
758
-
759
- # rlDrawVertexArray :
760
- # @param offset [int]
761
- # @param count [int]
762
- # @return [void]
763
- [:rlDrawVertexArray, :rlDrawVertexArray, [:int, :int], :void],
764
-
765
- # rlDrawVertexArrayElements :
766
- # @param offset [int]
767
- # @param count [int]
768
- # @param buffer [const void *]
769
- # @return [void]
770
- [:rlDrawVertexArrayElements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void],
771
-
772
- # rlDrawVertexArrayInstanced :
773
- # @param offset [int]
774
- # @param count [int]
775
- # @param instances [int]
776
- # @return [void]
777
- [:rlDrawVertexArrayInstanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void],
778
-
779
- # rlDrawVertexArrayElementsInstanced :
780
- # @param offset [int]
781
- # @param count [int]
782
- # @param buffer [const void *]
783
- # @param instances [int]
784
- # @return [void]
785
- [:rlDrawVertexArrayElementsInstanced, :rlDrawVertexArrayElementsInstanced, [:int, :int, :pointer, :int], :void],
786
-
787
- # rlLoadTexture : Load texture in GPU
788
- # @param data [const void *]
789
- # @param width [int]
790
- # @param height [int]
791
- # @param format [int]
792
- # @param mipmapCount [int]
793
- # @return [unsigned int]
794
- [:rlLoadTexture, :rlLoadTexture, [:pointer, :int, :int, :int, :int], :uint],
795
-
796
- # rlLoadTextureDepth : Load depth texture/renderbuffer (to be attached to fbo)
797
- # @param width [int]
798
- # @param height [int]
799
- # @param useRenderBuffer [bool]
800
- # @return [unsigned int]
801
- [:rlLoadTextureDepth, :rlLoadTextureDepth, [:int, :int, :bool], :uint],
802
-
803
- # rlLoadTextureCubemap : Load texture cubemap
804
- # @param data [const void *]
805
- # @param size [int]
806
- # @param format [int]
807
- # @return [unsigned int]
808
- [:rlLoadTextureCubemap, :rlLoadTextureCubemap, [:pointer, :int, :int], :uint],
809
-
810
- # rlUpdateTexture : Update GPU texture with new data
811
- # @param id [unsigned int]
812
- # @param offsetX [int]
813
- # @param offsetY [int]
814
- # @param width [int]
815
- # @param height [int]
816
- # @param format [int]
817
- # @param data [const void *]
818
- # @return [void]
819
- [:rlUpdateTexture, :rlUpdateTexture, [:uint, :int, :int, :int, :int, :int, :pointer], :void],
820
-
821
- # rlGetGlTextureFormats : Get OpenGL internal formats
822
- # @param format [int]
823
- # @param glInternalFormat [unsigned int *]
824
- # @param glFormat [unsigned int *]
825
- # @param glType [unsigned int *]
826
- # @return [void]
827
- [:rlGetGlTextureFormats, :rlGetGlTextureFormats, [:int, :pointer, :pointer, :pointer], :void],
828
-
829
- # rlGetPixelFormatName : Get name string for pixel format
830
- # @param format [unsigned int]
831
- # @return [const char *]
832
- [:rlGetPixelFormatName, :rlGetPixelFormatName, [:uint], :pointer],
833
-
834
- # rlUnloadTexture : Unload texture from GPU memory
835
- # @param id [unsigned int]
836
- # @return [void]
837
- [:rlUnloadTexture, :rlUnloadTexture, [:uint], :void],
838
-
839
- # rlGenTextureMipmaps : Generate mipmap data for selected texture
840
- # @param id [unsigned int]
841
- # @param width [int]
842
- # @param height [int]
843
- # @param format [int]
844
- # @param mipmaps [int *]
845
- # @return [void]
846
- [:rlGenTextureMipmaps, :rlGenTextureMipmaps, [:uint, :int, :int, :int, :pointer], :void],
847
-
848
- # rlReadTexturePixels : Read texture pixel data
849
- # @param id [unsigned int]
850
- # @param width [int]
851
- # @param height [int]
852
- # @param format [int]
853
- # @return [void *]
854
- [:rlReadTexturePixels, :rlReadTexturePixels, [:uint, :int, :int, :int], :pointer],
855
-
856
- # rlReadScreenPixels : Read screen pixel data (color buffer)
857
- # @param width [int]
858
- # @param height [int]
859
- # @return [unsigned char *]
860
- [:rlReadScreenPixels, :rlReadScreenPixels, [:int, :int], :pointer],
861
-
862
- # rlLoadFramebuffer : Load an empty framebuffer
863
- # @param width [int]
864
- # @param height [int]
865
- # @return [unsigned int]
866
- [:rlLoadFramebuffer, :rlLoadFramebuffer, [:int, :int], :uint],
867
-
868
- # rlFramebufferAttach : Attach texture/renderbuffer to a framebuffer
869
- # @param fboId [unsigned int]
870
- # @param texId [unsigned int]
871
- # @param attachType [int]
872
- # @param texType [int]
873
- # @param mipLevel [int]
874
- # @return [void]
875
- [:rlFramebufferAttach, :rlFramebufferAttach, [:uint, :uint, :int, :int, :int], :void],
876
-
877
- # rlFramebufferComplete : Verify framebuffer is complete
878
- # @param id [unsigned int]
879
- # @return [bool]
880
- [:rlFramebufferComplete, :rlFramebufferComplete, [:uint], :bool],
881
-
882
- # rlUnloadFramebuffer : Delete framebuffer from GPU
883
- # @param id [unsigned int]
884
- # @return [void]
885
- [:rlUnloadFramebuffer, :rlUnloadFramebuffer, [:uint], :void],
886
-
887
- # rlLoadShaderCode : Load shader from code strings
888
- # @param vsCode [const char *]
889
- # @param fsCode [const char *]
890
- # @return [unsigned int]
891
- [:rlLoadShaderCode, :rlLoadShaderCode, [:pointer, :pointer], :uint],
892
-
893
- # rlCompileShader : Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
894
- # @param shaderCode [const char *]
895
- # @param type [int]
896
- # @return [unsigned int]
897
- [:rlCompileShader, :rlCompileShader, [:pointer, :int], :uint],
898
-
899
- # rlLoadShaderProgram : Load custom shader program
900
- # @param vShaderId [unsigned int]
901
- # @param fShaderId [unsigned int]
902
- # @return [unsigned int]
903
- [:rlLoadShaderProgram, :rlLoadShaderProgram, [:uint, :uint], :uint],
904
-
905
- # rlUnloadShaderProgram : Unload shader program
906
- # @param id [unsigned int]
907
- # @return [void]
908
- [:rlUnloadShaderProgram, :rlUnloadShaderProgram, [:uint], :void],
909
-
910
- # rlGetLocationUniform : Get shader location uniform
911
- # @param shaderId [unsigned int]
912
- # @param uniformName [const char *]
913
- # @return [int]
914
- [:rlGetLocationUniform, :rlGetLocationUniform, [:uint, :pointer], :int],
915
-
916
- # rlGetLocationAttrib : Get shader location attribute
917
- # @param shaderId [unsigned int]
918
- # @param attribName [const char *]
919
- # @return [int]
920
- [:rlGetLocationAttrib, :rlGetLocationAttrib, [:uint, :pointer], :int],
921
-
922
- # rlSetUniform : Set shader value uniform
923
- # @param locIndex [int]
924
- # @param value [const void *]
925
- # @param uniformType [int]
926
- # @param count [int]
927
- # @return [void]
928
- [:rlSetUniform, :rlSetUniform, [:int, :pointer, :int, :int], :void],
929
-
930
- # rlSetUniformMatrix : Set shader value matrix
931
- # @param locIndex [int]
932
- # @param mat [Matrix]
933
- # @return [void]
934
- [:rlSetUniformMatrix, :rlSetUniformMatrix, [:int, Matrix.by_value], :void],
935
-
936
- # rlSetUniformSampler : Set shader value sampler
937
- # @param locIndex [int]
938
- # @param textureId [unsigned int]
939
- # @return [void]
940
- [:rlSetUniformSampler, :rlSetUniformSampler, [:int, :uint], :void],
941
-
942
- # rlSetShader : Set shader currently active (id and locations)
943
- # @param id [unsigned int]
944
- # @param locs [int *]
945
- # @return [void]
946
- [:rlSetShader, :rlSetShader, [:uint, :pointer], :void],
947
-
948
- # rlLoadComputeShaderProgram : Load compute shader program
949
- # @param shaderId [unsigned int]
950
- # @return [unsigned int]
951
- [:rlLoadComputeShaderProgram, :rlLoadComputeShaderProgram, [:uint], :uint],
952
-
953
- # rlComputeShaderDispatch : Dispatch compute shader (equivalent to *draw* for graphics pilepine)
954
- # @param groupX [unsigned int]
955
- # @param groupY [unsigned int]
956
- # @param groupZ [unsigned int]
957
- # @return [void]
958
- [:rlComputeShaderDispatch, :rlComputeShaderDispatch, [:uint, :uint, :uint], :void],
959
-
960
- # rlLoadShaderBuffer : Load shader storage buffer object (SSBO)
961
- # @param size [unsigned int]
962
- # @param data [const void *]
963
- # @param usageHint [int]
964
- # @return [unsigned int]
965
- [:rlLoadShaderBuffer, :rlLoadShaderBuffer, [:uint, :pointer, :int], :uint],
966
-
967
- # rlUnloadShaderBuffer : Unload shader storage buffer object (SSBO)
968
- # @param ssboId [unsigned int]
969
- # @return [void]
970
- [:rlUnloadShaderBuffer, :rlUnloadShaderBuffer, [:uint], :void],
971
-
972
- # rlUpdateShaderBuffer : Update SSBO buffer data
973
- # @param id [unsigned int]
974
- # @param data [const void *]
975
- # @param dataSize [unsigned int]
976
- # @param offset [unsigned int]
977
- # @return [void]
978
- [:rlUpdateShaderBuffer, :rlUpdateShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
979
-
980
- # rlBindShaderBuffer : Bind SSBO buffer
981
- # @param id [unsigned int]
982
- # @param index [unsigned int]
983
- # @return [void]
984
- [:rlBindShaderBuffer, :rlBindShaderBuffer, [:uint, :uint], :void],
985
-
986
- # rlReadShaderBuffer : Read SSBO buffer data (GPU->CPU)
987
- # @param id [unsigned int]
988
- # @param dest [void *]
989
- # @param count [unsigned int]
990
- # @param offset [unsigned int]
991
- # @return [void]
992
- [:rlReadShaderBuffer, :rlReadShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
993
-
994
- # rlCopyShaderBuffer : Copy SSBO data between buffers
995
- # @param destId [unsigned int]
996
- # @param srcId [unsigned int]
997
- # @param destOffset [unsigned int]
998
- # @param srcOffset [unsigned int]
999
- # @param count [unsigned int]
1000
- # @return [void]
1001
- [:rlCopyShaderBuffer, :rlCopyShaderBuffer, [:uint, :uint, :uint, :uint, :uint], :void],
1002
-
1003
- # rlGetShaderBufferSize : Get SSBO buffer size
1004
- # @param id [unsigned int]
1005
- # @return [unsigned int]
1006
- [:rlGetShaderBufferSize, :rlGetShaderBufferSize, [:uint], :uint],
1007
-
1008
- # rlBindImageTexture : Bind image texture
1009
- # @param id [unsigned int]
1010
- # @param index [unsigned int]
1011
- # @param format [int]
1012
- # @param readonly [bool]
1013
- # @return [void]
1014
- [:rlBindImageTexture, :rlBindImageTexture, [:uint, :uint, :int, :bool], :void],
1015
-
1016
- # rlGetMatrixModelview : Get internal modelview matrix
1017
- # @return [Matrix]
1018
- [:rlGetMatrixModelview, :rlGetMatrixModelview, [], Matrix.by_value],
1019
-
1020
- # rlGetMatrixProjection : Get internal projection matrix
1021
- # @return [Matrix]
1022
- [:rlGetMatrixProjection, :rlGetMatrixProjection, [], Matrix.by_value],
1023
-
1024
- # rlGetMatrixTransform : Get internal accumulated transform matrix
1025
- # @return [Matrix]
1026
- [:rlGetMatrixTransform, :rlGetMatrixTransform, [], Matrix.by_value],
1027
-
1028
- # rlGetMatrixProjectionStereo : Get internal projection matrix for stereo render (selected eye)
1029
- # @param eye [int]
1030
- # @return [Matrix]
1031
- [:rlGetMatrixProjectionStereo, :rlGetMatrixProjectionStereo, [:int], Matrix.by_value],
1032
-
1033
- # rlGetMatrixViewOffsetStereo : Get internal view offset matrix for stereo render (selected eye)
1034
- # @param eye [int]
1035
- # @return [Matrix]
1036
- [:rlGetMatrixViewOffsetStereo, :rlGetMatrixViewOffsetStereo, [:int], Matrix.by_value],
1037
-
1038
- # rlSetMatrixProjection : Set a custom projection matrix (replaces internal projection matrix)
1039
- # @param proj [Matrix]
1040
- # @return [void]
1041
- [:rlSetMatrixProjection, :rlSetMatrixProjection, [Matrix.by_value], :void],
1042
-
1043
- # rlSetMatrixModelview : Set a custom modelview matrix (replaces internal modelview matrix)
1044
- # @param view [Matrix]
1045
- # @return [void]
1046
- [:rlSetMatrixModelview, :rlSetMatrixModelview, [Matrix.by_value], :void],
1047
-
1048
- # rlSetMatrixProjectionStereo : Set eyes projection matrices for stereo rendering
1049
- # @param right [Matrix]
1050
- # @param left [Matrix]
1051
- # @return [void]
1052
- [:rlSetMatrixProjectionStereo, :rlSetMatrixProjectionStereo, [Matrix.by_value, Matrix.by_value], :void],
1053
-
1054
- # rlSetMatrixViewOffsetStereo : Set eyes view offsets matrices for stereo rendering
1055
- # @param right [Matrix]
1056
- # @param left [Matrix]
1057
- # @return [void]
1058
- [:rlSetMatrixViewOffsetStereo, :rlSetMatrixViewOffsetStereo, [Matrix.by_value, Matrix.by_value], :void],
1059
-
1060
- # rlLoadDrawCube : Load and draw a cube
1061
- # @return [void]
1062
- [:rlLoadDrawCube, :rlLoadDrawCube, [], :void],
1063
-
1064
- # rlLoadDrawQuad : Load and draw a quad
1065
- # @return [void]
1066
- [:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
1067
- ]
1068
- entries.each do |entry|
1069
- begin
1070
- attach_function entry[0], entry[1], entry[2], entry[3]
1071
- rescue FFI::NotFoundError => error
1072
- $stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
1073
- end
1074
- end
1075
- end
1076
-
1077
- end
1078
-
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+ RLGL_VERSION = "4.2"
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
23
+ RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR = 0x2702 # GL_NEAREST_MIPMAP_LINEAR
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
78
+
79
+ # Enum
80
+
81
+ # enum rlGlVersion
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)
87
+ RL_OPENGL_ES_20 = 5 # OpenGL ES 2.0 (GLSL 100)
88
+
89
+ # enum rlTraceLogLevel
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
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
99
+
100
+ # enum rlPixelFormat
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)
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
123
+
124
+ # enum rlTextureFilter
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
131
+ RL_TEXTURE_FILTER_ANISOTROPIC_16X = 5 # Anisotropic filtering 16x
132
+
133
+ # enum rlBlendMode
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)
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())
143
+
144
+ # enum rlShaderLocationIndex
145
+ # Shader location point type
146
+ RL_SHADER_LOC_VERTEX_POSITION = 0 # Shader location: vertex attribute: position
147
+ RL_SHADER_LOC_VERTEX_TEXCOORD01 = 1 # Shader location: vertex attribute: texcoord01
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)
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
172
+
173
+ # enum rlShaderUniformDataType
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)
183
+ RL_SHADER_UNIFORM_SAMPLER2D = 8 # Shader uniform type: sampler2d
184
+
185
+ # enum rlShaderAttributeDataType
186
+ # Shader attribute data types
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)
191
+
192
+ # enum rlFramebufferAttachType
193
+ # Framebuffer attachment type
194
+ RL_ATTACHMENT_COLOR_CHANNEL0 = 0 # Framebuffer attachment type: color 0
195
+ RL_ATTACHMENT_COLOR_CHANNEL1 = 1 # Framebuffer attachment type: color 1
196
+ RL_ATTACHMENT_COLOR_CHANNEL2 = 2 # Framebuffer attachment type: color 2
197
+ RL_ATTACHMENT_COLOR_CHANNEL3 = 3 # Framebuffer attachment type: color 3
198
+ RL_ATTACHMENT_COLOR_CHANNEL4 = 4 # Framebuffer attachment type: color 4
199
+ RL_ATTACHMENT_COLOR_CHANNEL5 = 5 # Framebuffer attachment type: color 5
200
+ RL_ATTACHMENT_COLOR_CHANNEL6 = 6 # Framebuffer attachment type: color 6
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
204
+
205
+ # enum rlFramebufferAttachTextureType
206
+ # Framebuffer texture attachment type
207
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0 # Framebuffer texture attachment type: cubemap, +X side
208
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1 # Framebuffer texture attachment type: cubemap, -X side
209
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2 # Framebuffer texture attachment type: cubemap, +Y side
210
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3 # Framebuffer texture attachment type: cubemap, -Y side
211
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4 # Framebuffer texture attachment type: cubemap, +Z side
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
215
+
216
+ # enum rlCullMode
217
+ # Face culling mode
218
+ RL_CULL_FACE_FRONT = 0
219
+ RL_CULL_FACE_BACK = 1
220
+
221
+
222
+ # Typedef
223
+
224
+ typedef :int, :rlGlVersion
225
+ typedef :int, :rlTraceLogLevel
226
+ typedef :int, :rlPixelFormat
227
+ typedef :int, :rlTextureFilter
228
+ typedef :int, :rlBlendMode
229
+ typedef :int, :rlShaderLocationIndex
230
+ typedef :int, :rlShaderUniformDataType
231
+ typedef :int, :rlShaderAttributeDataType
232
+ typedef :int, :rlFramebufferAttachType
233
+ typedef :int, :rlFramebufferAttachTextureType
234
+ typedef :int, :rlCullMode
235
+
236
+ # Struct
237
+
238
+ # Dynamic vertex buffers (position + texcoords + colors + indices arrays)
239
+ class RlVertexBuffer < FFI::Struct
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)
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)
248
+ )
249
+ end
250
+
251
+ # of those state-change happens (this is done in core module)
252
+ class RlDrawCall < FFI::Struct
253
+ layout(
254
+ :mode, :int, # Drawing mode: LINES, TRIANGLES, QUADS
255
+ :vertexCount, :int, # Number of vertex of the draw
256
+ :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
258
+ )
259
+ end
260
+
261
+ # rlRenderBatch type
262
+ class RlRenderBatch < FFI::Struct
263
+ layout(
264
+ :bufferCount, :int, # Number of vertex buffers (multi-buffering support)
265
+ :currentBuffer, :int, # Current buffer tracking in case of multi-buffering
266
+ :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
270
+ )
271
+ end
272
+
273
+
274
+ # Function
275
+
276
+ def self.setup_rlgl_symbols
277
+ entries = [
278
+
279
+ # rlMatrixMode : Choose the current matrix to be transformed
280
+ # @param mode [int]
281
+ # @return [void]
282
+ [:rlMatrixMode, :rlMatrixMode, [:int], :void],
283
+
284
+ # rlPushMatrix : Push the current matrix to stack
285
+ # @return [void]
286
+ [:rlPushMatrix, :rlPushMatrix, [], :void],
287
+
288
+ # rlPopMatrix : Pop latest inserted matrix from stack
289
+ # @return [void]
290
+ [:rlPopMatrix, :rlPopMatrix, [], :void],
291
+
292
+ # rlLoadIdentity : Reset current matrix to identity matrix
293
+ # @return [void]
294
+ [:rlLoadIdentity, :rlLoadIdentity, [], :void],
295
+
296
+ # rlTranslatef : Multiply the current matrix by a translation matrix
297
+ # @param x [float]
298
+ # @param y [float]
299
+ # @param z [float]
300
+ # @return [void]
301
+ [:rlTranslatef, :rlTranslatef, [:float, :float, :float], :void],
302
+
303
+ # rlRotatef : Multiply the current matrix by a rotation matrix
304
+ # @param angle [float]
305
+ # @param x [float]
306
+ # @param y [float]
307
+ # @param z [float]
308
+ # @return [void]
309
+ [:rlRotatef, :rlRotatef, [:float, :float, :float, :float], :void],
310
+
311
+ # rlScalef : Multiply the current matrix by a scaling matrix
312
+ # @param x [float]
313
+ # @param y [float]
314
+ # @param z [float]
315
+ # @return [void]
316
+ [:rlScalef, :rlScalef, [:float, :float, :float], :void],
317
+
318
+ # rlMultMatrixf : Multiply the current matrix by another matrix
319
+ # @param matf [const float *]
320
+ # @return [void]
321
+ [:rlMultMatrixf, :rlMultMatrixf, [:pointer], :void],
322
+
323
+ # rlFrustum
324
+ # @param left [double]
325
+ # @param right [double]
326
+ # @param bottom [double]
327
+ # @param top [double]
328
+ # @param znear [double]
329
+ # @param zfar [double]
330
+ # @return [void]
331
+ [:rlFrustum, :rlFrustum, [:double, :double, :double, :double, :double, :double], :void],
332
+
333
+ # rlOrtho
334
+ # @param left [double]
335
+ # @param right [double]
336
+ # @param bottom [double]
337
+ # @param top [double]
338
+ # @param znear [double]
339
+ # @param zfar [double]
340
+ # @return [void]
341
+ [:rlOrtho, :rlOrtho, [:double, :double, :double, :double, :double, :double], :void],
342
+
343
+ # rlViewport : Set the viewport area
344
+ # @param x [int]
345
+ # @param y [int]
346
+ # @param width [int]
347
+ # @param height [int]
348
+ # @return [void]
349
+ [:rlViewport, :rlViewport, [:int, :int, :int, :int], :void],
350
+
351
+ # rlBegin : Initialize drawing mode (how to organize vertex)
352
+ # @param mode [int]
353
+ # @return [void]
354
+ [:rlBegin, :rlBegin, [:int], :void],
355
+
356
+ # rlEnd : Finish vertex providing
357
+ # @return [void]
358
+ [:rlEnd, :rlEnd, [], :void],
359
+
360
+ # rlVertex2i : Define one vertex (position) - 2 int
361
+ # @param x [int]
362
+ # @param y [int]
363
+ # @return [void]
364
+ [:rlVertex2i, :rlVertex2i, [:int, :int], :void],
365
+
366
+ # rlVertex2f : Define one vertex (position) - 2 float
367
+ # @param x [float]
368
+ # @param y [float]
369
+ # @return [void]
370
+ [:rlVertex2f, :rlVertex2f, [:float, :float], :void],
371
+
372
+ # rlVertex3f : Define one vertex (position) - 3 float
373
+ # @param x [float]
374
+ # @param y [float]
375
+ # @param z [float]
376
+ # @return [void]
377
+ [:rlVertex3f, :rlVertex3f, [:float, :float, :float], :void],
378
+
379
+ # rlTexCoord2f : Define one vertex (texture coordinate) - 2 float
380
+ # @param x [float]
381
+ # @param y [float]
382
+ # @return [void]
383
+ [:rlTexCoord2f, :rlTexCoord2f, [:float, :float], :void],
384
+
385
+ # rlNormal3f : Define one vertex (normal) - 3 float
386
+ # @param x [float]
387
+ # @param y [float]
388
+ # @param z [float]
389
+ # @return [void]
390
+ [:rlNormal3f, :rlNormal3f, [:float, :float, :float], :void],
391
+
392
+ # rlColor4ub : Define one vertex (color) - 4 byte
393
+ # @param r [unsigned char]
394
+ # @param g [unsigned char]
395
+ # @param b [unsigned char]
396
+ # @param a [unsigned char]
397
+ # @return [void]
398
+ [:rlColor4ub, :rlColor4ub, [:uchar, :uchar, :uchar, :uchar], :void],
399
+
400
+ # rlColor3f : Define one vertex (color) - 3 float
401
+ # @param x [float]
402
+ # @param y [float]
403
+ # @param z [float]
404
+ # @return [void]
405
+ [:rlColor3f, :rlColor3f, [:float, :float, :float], :void],
406
+
407
+ # rlColor4f : Define one vertex (color) - 4 float
408
+ # @param x [float]
409
+ # @param y [float]
410
+ # @param z [float]
411
+ # @param w [float]
412
+ # @return [void]
413
+ [:rlColor4f, :rlColor4f, [:float, :float, :float, :float], :void],
414
+
415
+ # rlEnableVertexArray : Enable vertex array (VAO, if supported)
416
+ # @param vaoId [unsigned int]
417
+ # @return [bool]
418
+ [:rlEnableVertexArray, :rlEnableVertexArray, [:uint], :bool],
419
+
420
+ # rlDisableVertexArray : Disable vertex array (VAO, if supported)
421
+ # @return [void]
422
+ [:rlDisableVertexArray, :rlDisableVertexArray, [], :void],
423
+
424
+ # rlEnableVertexBuffer : Enable vertex buffer (VBO)
425
+ # @param id [unsigned int]
426
+ # @return [void]
427
+ [:rlEnableVertexBuffer, :rlEnableVertexBuffer, [:uint], :void],
428
+
429
+ # rlDisableVertexBuffer : Disable vertex buffer (VBO)
430
+ # @return [void]
431
+ [:rlDisableVertexBuffer, :rlDisableVertexBuffer, [], :void],
432
+
433
+ # rlEnableVertexBufferElement : Enable vertex buffer element (VBO element)
434
+ # @param id [unsigned int]
435
+ # @return [void]
436
+ [:rlEnableVertexBufferElement, :rlEnableVertexBufferElement, [:uint], :void],
437
+
438
+ # rlDisableVertexBufferElement : Disable vertex buffer element (VBO element)
439
+ # @return [void]
440
+ [:rlDisableVertexBufferElement, :rlDisableVertexBufferElement, [], :void],
441
+
442
+ # rlEnableVertexAttribute : Enable vertex attribute index
443
+ # @param index [unsigned int]
444
+ # @return [void]
445
+ [:rlEnableVertexAttribute, :rlEnableVertexAttribute, [:uint], :void],
446
+
447
+ # rlDisableVertexAttribute : Disable vertex attribute index
448
+ # @param index [unsigned int]
449
+ # @return [void]
450
+ [:rlDisableVertexAttribute, :rlDisableVertexAttribute, [:uint], :void],
451
+
452
+ # rlActiveTextureSlot : Select and active a texture slot
453
+ # @param slot [int]
454
+ # @return [void]
455
+ [:rlActiveTextureSlot, :rlActiveTextureSlot, [:int], :void],
456
+
457
+ # rlEnableTexture : Enable texture
458
+ # @param id [unsigned int]
459
+ # @return [void]
460
+ [:rlEnableTexture, :rlEnableTexture, [:uint], :void],
461
+
462
+ # rlDisableTexture : Disable texture
463
+ # @return [void]
464
+ [:rlDisableTexture, :rlDisableTexture, [], :void],
465
+
466
+ # rlEnableTextureCubemap : Enable texture cubemap
467
+ # @param id [unsigned int]
468
+ # @return [void]
469
+ [:rlEnableTextureCubemap, :rlEnableTextureCubemap, [:uint], :void],
470
+
471
+ # rlDisableTextureCubemap : Disable texture cubemap
472
+ # @return [void]
473
+ [:rlDisableTextureCubemap, :rlDisableTextureCubemap, [], :void],
474
+
475
+ # rlTextureParameters : Set texture parameters (filter, wrap)
476
+ # @param id [unsigned int]
477
+ # @param param [int]
478
+ # @param value [int]
479
+ # @return [void]
480
+ [:rlTextureParameters, :rlTextureParameters, [:uint, :int, :int], :void],
481
+
482
+ # rlCubemapParameters : Set cubemap parameters (filter, wrap)
483
+ # @param id [unsigned int]
484
+ # @param param [int]
485
+ # @param value [int]
486
+ # @return [void]
487
+ [:rlCubemapParameters, :rlCubemapParameters, [:uint, :int, :int], :void],
488
+
489
+ # rlEnableShader : Enable shader program
490
+ # @param id [unsigned int]
491
+ # @return [void]
492
+ [:rlEnableShader, :rlEnableShader, [:uint], :void],
493
+
494
+ # rlDisableShader : Disable shader program
495
+ # @return [void]
496
+ [:rlDisableShader, :rlDisableShader, [], :void],
497
+
498
+ # rlEnableFramebuffer : Enable render texture (fbo)
499
+ # @param id [unsigned int]
500
+ # @return [void]
501
+ [:rlEnableFramebuffer, :rlEnableFramebuffer, [:uint], :void],
502
+
503
+ # rlDisableFramebuffer : Disable render texture (fbo), return to default framebuffer
504
+ # @return [void]
505
+ [:rlDisableFramebuffer, :rlDisableFramebuffer, [], :void],
506
+
507
+ # rlActiveDrawBuffers : Activate multiple draw color buffers
508
+ # @param count [int]
509
+ # @return [void]
510
+ [:rlActiveDrawBuffers, :rlActiveDrawBuffers, [:int], :void],
511
+
512
+ # rlEnableColorBlend : Enable color blending
513
+ # @return [void]
514
+ [:rlEnableColorBlend, :rlEnableColorBlend, [], :void],
515
+
516
+ # rlDisableColorBlend : Disable color blending
517
+ # @return [void]
518
+ [:rlDisableColorBlend, :rlDisableColorBlend, [], :void],
519
+
520
+ # rlEnableDepthTest : Enable depth test
521
+ # @return [void]
522
+ [:rlEnableDepthTest, :rlEnableDepthTest, [], :void],
523
+
524
+ # rlDisableDepthTest : Disable depth test
525
+ # @return [void]
526
+ [:rlDisableDepthTest, :rlDisableDepthTest, [], :void],
527
+
528
+ # rlEnableDepthMask : Enable depth write
529
+ # @return [void]
530
+ [:rlEnableDepthMask, :rlEnableDepthMask, [], :void],
531
+
532
+ # rlDisableDepthMask : Disable depth write
533
+ # @return [void]
534
+ [:rlDisableDepthMask, :rlDisableDepthMask, [], :void],
535
+
536
+ # rlEnableBackfaceCulling : Enable backface culling
537
+ # @return [void]
538
+ [:rlEnableBackfaceCulling, :rlEnableBackfaceCulling, [], :void],
539
+
540
+ # rlDisableBackfaceCulling : Disable backface culling
541
+ # @return [void]
542
+ [:rlDisableBackfaceCulling, :rlDisableBackfaceCulling, [], :void],
543
+
544
+ # rlSetCullFace : Set face culling mode
545
+ # @param mode [int]
546
+ # @return [void]
547
+ [:rlSetCullFace, :rlSetCullFace, [:int], :void],
548
+
549
+ # rlEnableScissorTest : Enable scissor test
550
+ # @return [void]
551
+ [:rlEnableScissorTest, :rlEnableScissorTest, [], :void],
552
+
553
+ # rlDisableScissorTest : Disable scissor test
554
+ # @return [void]
555
+ [:rlDisableScissorTest, :rlDisableScissorTest, [], :void],
556
+
557
+ # rlScissor : Scissor test
558
+ # @param x [int]
559
+ # @param y [int]
560
+ # @param width [int]
561
+ # @param height [int]
562
+ # @return [void]
563
+ [:rlScissor, :rlScissor, [:int, :int, :int, :int], :void],
564
+
565
+ # rlEnableWireMode : Enable wire mode
566
+ # @return [void]
567
+ [:rlEnableWireMode, :rlEnableWireMode, [], :void],
568
+
569
+ # rlDisableWireMode : Disable wire mode
570
+ # @return [void]
571
+ [:rlDisableWireMode, :rlDisableWireMode, [], :void],
572
+
573
+ # rlSetLineWidth : Set the line drawing width
574
+ # @param width [float]
575
+ # @return [void]
576
+ [:rlSetLineWidth, :rlSetLineWidth, [:float], :void],
577
+
578
+ # rlGetLineWidth : Get the line drawing width
579
+ # @return [float]
580
+ [:rlGetLineWidth, :rlGetLineWidth, [], :float],
581
+
582
+ # rlEnableSmoothLines : Enable line aliasing
583
+ # @return [void]
584
+ [:rlEnableSmoothLines, :rlEnableSmoothLines, [], :void],
585
+
586
+ # rlDisableSmoothLines : Disable line aliasing
587
+ # @return [void]
588
+ [:rlDisableSmoothLines, :rlDisableSmoothLines, [], :void],
589
+
590
+ # rlEnableStereoRender : Enable stereo rendering
591
+ # @return [void]
592
+ [:rlEnableStereoRender, :rlEnableStereoRender, [], :void],
593
+
594
+ # rlDisableStereoRender : Disable stereo rendering
595
+ # @return [void]
596
+ [:rlDisableStereoRender, :rlDisableStereoRender, [], :void],
597
+
598
+ # rlIsStereoRenderEnabled : Check if stereo render is enabled
599
+ # @return [bool]
600
+ [:rlIsStereoRenderEnabled, :rlIsStereoRenderEnabled, [], :bool],
601
+
602
+ # rlClearColor : Clear color buffer with color
603
+ # @param r [unsigned char]
604
+ # @param g [unsigned char]
605
+ # @param b [unsigned char]
606
+ # @param a [unsigned char]
607
+ # @return [void]
608
+ [:rlClearColor, :rlClearColor, [:uchar, :uchar, :uchar, :uchar], :void],
609
+
610
+ # rlClearScreenBuffers : Clear used screen buffers (color and depth)
611
+ # @return [void]
612
+ [:rlClearScreenBuffers, :rlClearScreenBuffers, [], :void],
613
+
614
+ # rlCheckErrors : Check and log OpenGL error codes
615
+ # @return [void]
616
+ [:rlCheckErrors, :rlCheckErrors, [], :void],
617
+
618
+ # rlSetBlendMode : Set blending mode
619
+ # @param mode [int]
620
+ # @return [void]
621
+ [:rlSetBlendMode, :rlSetBlendMode, [:int], :void],
622
+
623
+ # rlSetBlendFactors : Set blending mode factor and equation (using OpenGL factors)
624
+ # @param glSrcFactor [int]
625
+ # @param glDstFactor [int]
626
+ # @param glEquation [int]
627
+ # @return [void]
628
+ [:rlSetBlendFactors, :rlSetBlendFactors, [:int, :int, :int], :void],
629
+
630
+ # rlSetBlendFactorsSeparate : Set blending mode factors and equations separately (using OpenGL factors)
631
+ # @param glSrcRGB [int]
632
+ # @param glDstRGB [int]
633
+ # @param glSrcAlpha [int]
634
+ # @param glDstAlpha [int]
635
+ # @param glEqRGB [int]
636
+ # @param glEqAlpha [int]
637
+ # @return [void]
638
+ [:rlSetBlendFactorsSeparate, :rlSetBlendFactorsSeparate, [:int, :int, :int, :int, :int, :int], :void],
639
+
640
+ # rlglInit : Initialize rlgl (buffers, shaders, textures, states)
641
+ # @param width [int]
642
+ # @param height [int]
643
+ # @return [void]
644
+ [:rlglInit, :rlglInit, [:int, :int], :void],
645
+
646
+ # rlglClose : De-initialize rlgl (buffers, shaders, textures)
647
+ # @return [void]
648
+ [:rlglClose, :rlglClose, [], :void],
649
+
650
+ # rlLoadExtensions : Load OpenGL extensions (loader function required)
651
+ # @param loader [void *]
652
+ # @return [void]
653
+ [:rlLoadExtensions, :rlLoadExtensions, [:pointer], :void],
654
+
655
+ # rlGetVersion : Get current OpenGL version
656
+ # @return [int]
657
+ [:rlGetVersion, :rlGetVersion, [], :int],
658
+
659
+ # rlSetFramebufferWidth : Set current framebuffer width
660
+ # @param width [int]
661
+ # @return [void]
662
+ [:rlSetFramebufferWidth, :rlSetFramebufferWidth, [:int], :void],
663
+
664
+ # rlGetFramebufferWidth : Get default framebuffer width
665
+ # @return [int]
666
+ [:rlGetFramebufferWidth, :rlGetFramebufferWidth, [], :int],
667
+
668
+ # rlSetFramebufferHeight : Set current framebuffer height
669
+ # @param height [int]
670
+ # @return [void]
671
+ [:rlSetFramebufferHeight, :rlSetFramebufferHeight, [:int], :void],
672
+
673
+ # rlGetFramebufferHeight : Get default framebuffer height
674
+ # @return [int]
675
+ [:rlGetFramebufferHeight, :rlGetFramebufferHeight, [], :int],
676
+
677
+ # rlGetTextureIdDefault : Get default texture id
678
+ # @return [unsigned int]
679
+ [:rlGetTextureIdDefault, :rlGetTextureIdDefault, [], :uint],
680
+
681
+ # rlGetShaderIdDefault : Get default shader id
682
+ # @return [unsigned int]
683
+ [:rlGetShaderIdDefault, :rlGetShaderIdDefault, [], :uint],
684
+
685
+ # rlGetShaderLocsDefault : Get default shader locations
686
+ # @return [int *]
687
+ [:rlGetShaderLocsDefault, :rlGetShaderLocsDefault, [], :pointer],
688
+
689
+ # rlLoadRenderBatch : Load a render batch system
690
+ # @param numBuffers [int]
691
+ # @param bufferElements [int]
692
+ # @return [rlRenderBatch]
693
+ [:rlLoadRenderBatch, :rlLoadRenderBatch, [:int, :int], RlRenderBatch.by_value],
694
+
695
+ # rlUnloadRenderBatch : Unload render batch system
696
+ # @param batch [rlRenderBatch]
697
+ # @return [void]
698
+ [:rlUnloadRenderBatch, :rlUnloadRenderBatch, [RlRenderBatch.by_value], :void],
699
+
700
+ # rlDrawRenderBatch : Draw render batch data (Update->Draw->Reset)
701
+ # @param batch [rlRenderBatch *]
702
+ # @return [void]
703
+ [:rlDrawRenderBatch, :rlDrawRenderBatch, [:pointer], :void],
704
+
705
+ # rlSetRenderBatchActive : Set the active render batch for rlgl (NULL for default internal)
706
+ # @param batch [rlRenderBatch *]
707
+ # @return [void]
708
+ [:rlSetRenderBatchActive, :rlSetRenderBatchActive, [:pointer], :void],
709
+
710
+ # rlDrawRenderBatchActive : Update and draw internal render batch
711
+ # @return [void]
712
+ [:rlDrawRenderBatchActive, :rlDrawRenderBatchActive, [], :void],
713
+
714
+ # rlCheckRenderBatchLimit : Check internal buffer overflow for a given number of vertex
715
+ # @param vCount [int]
716
+ # @return [bool]
717
+ [:rlCheckRenderBatchLimit, :rlCheckRenderBatchLimit, [:int], :bool],
718
+
719
+ # rlSetTexture : Set current texture for render batch and check buffers limits
720
+ # @param id [unsigned int]
721
+ # @return [void]
722
+ [:rlSetTexture, :rlSetTexture, [:uint], :void],
723
+
724
+ # rlLoadVertexArray : Load vertex array (vao) if supported
725
+ # @return [unsigned int]
726
+ [:rlLoadVertexArray, :rlLoadVertexArray, [], :uint],
727
+
728
+ # rlLoadVertexBuffer : Load a vertex buffer attribute
729
+ # @param buffer [const void *]
730
+ # @param size [int]
731
+ # @param dynamic [bool]
732
+ # @return [unsigned int]
733
+ [:rlLoadVertexBuffer, :rlLoadVertexBuffer, [:pointer, :int, :bool], :uint],
734
+
735
+ # rlLoadVertexBufferElement : Load a new attributes element buffer
736
+ # @param buffer [const void *]
737
+ # @param size [int]
738
+ # @param dynamic [bool]
739
+ # @return [unsigned int]
740
+ [:rlLoadVertexBufferElement, :rlLoadVertexBufferElement, [:pointer, :int, :bool], :uint],
741
+
742
+ # rlUpdateVertexBuffer : Update GPU buffer with new data
743
+ # @param bufferId [unsigned int]
744
+ # @param data [const void *]
745
+ # @param dataSize [int]
746
+ # @param offset [int]
747
+ # @return [void]
748
+ [:rlUpdateVertexBuffer, :rlUpdateVertexBuffer, [:uint, :pointer, :int, :int], :void],
749
+
750
+ # rlUpdateVertexBufferElements : Update vertex buffer elements with new data
751
+ # @param id [unsigned int]
752
+ # @param data [const void *]
753
+ # @param dataSize [int]
754
+ # @param offset [int]
755
+ # @return [void]
756
+ [:rlUpdateVertexBufferElements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void],
757
+
758
+ # rlUnloadVertexArray
759
+ # @param vaoId [unsigned int]
760
+ # @return [void]
761
+ [:rlUnloadVertexArray, :rlUnloadVertexArray, [:uint], :void],
762
+
763
+ # rlUnloadVertexBuffer
764
+ # @param vboId [unsigned int]
765
+ # @return [void]
766
+ [:rlUnloadVertexBuffer, :rlUnloadVertexBuffer, [:uint], :void],
767
+
768
+ # rlSetVertexAttribute
769
+ # @param index [unsigned int]
770
+ # @param compSize [int]
771
+ # @param type [int]
772
+ # @param normalized [bool]
773
+ # @param stride [int]
774
+ # @param pointer [const void *]
775
+ # @return [void]
776
+ [:rlSetVertexAttribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void],
777
+
778
+ # rlSetVertexAttributeDivisor
779
+ # @param index [unsigned int]
780
+ # @param divisor [int]
781
+ # @return [void]
782
+ [:rlSetVertexAttributeDivisor, :rlSetVertexAttributeDivisor, [:uint, :int], :void],
783
+
784
+ # rlSetVertexAttributeDefault : Set vertex attribute default value
785
+ # @param locIndex [int]
786
+ # @param value [const void *]
787
+ # @param attribType [int]
788
+ # @param count [int]
789
+ # @return [void]
790
+ [:rlSetVertexAttributeDefault, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void],
791
+
792
+ # rlDrawVertexArray
793
+ # @param offset [int]
794
+ # @param count [int]
795
+ # @return [void]
796
+ [:rlDrawVertexArray, :rlDrawVertexArray, [:int, :int], :void],
797
+
798
+ # rlDrawVertexArrayElements
799
+ # @param offset [int]
800
+ # @param count [int]
801
+ # @param buffer [const void *]
802
+ # @return [void]
803
+ [:rlDrawVertexArrayElements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void],
804
+
805
+ # rlDrawVertexArrayInstanced
806
+ # @param offset [int]
807
+ # @param count [int]
808
+ # @param instances [int]
809
+ # @return [void]
810
+ [:rlDrawVertexArrayInstanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void],
811
+
812
+ # rlDrawVertexArrayElementsInstanced
813
+ # @param offset [int]
814
+ # @param count [int]
815
+ # @param buffer [const void *]
816
+ # @param instances [int]
817
+ # @return [void]
818
+ [:rlDrawVertexArrayElementsInstanced, :rlDrawVertexArrayElementsInstanced, [:int, :int, :pointer, :int], :void],
819
+
820
+ # rlLoadTexture : Load texture in GPU
821
+ # @param data [const void *]
822
+ # @param width [int]
823
+ # @param height [int]
824
+ # @param format [int]
825
+ # @param mipmapCount [int]
826
+ # @return [unsigned int]
827
+ [:rlLoadTexture, :rlLoadTexture, [:pointer, :int, :int, :int, :int], :uint],
828
+
829
+ # rlLoadTextureDepth : Load depth texture/renderbuffer (to be attached to fbo)
830
+ # @param width [int]
831
+ # @param height [int]
832
+ # @param useRenderBuffer [bool]
833
+ # @return [unsigned int]
834
+ [:rlLoadTextureDepth, :rlLoadTextureDepth, [:int, :int, :bool], :uint],
835
+
836
+ # rlLoadTextureCubemap : Load texture cubemap
837
+ # @param data [const void *]
838
+ # @param size [int]
839
+ # @param format [int]
840
+ # @return [unsigned int]
841
+ [:rlLoadTextureCubemap, :rlLoadTextureCubemap, [:pointer, :int, :int], :uint],
842
+
843
+ # rlUpdateTexture : Update GPU texture with new data
844
+ # @param id [unsigned int]
845
+ # @param offsetX [int]
846
+ # @param offsetY [int]
847
+ # @param width [int]
848
+ # @param height [int]
849
+ # @param format [int]
850
+ # @param data [const void *]
851
+ # @return [void]
852
+ [:rlUpdateTexture, :rlUpdateTexture, [:uint, :int, :int, :int, :int, :int, :pointer], :void],
853
+
854
+ # rlGetGlTextureFormats : Get OpenGL internal formats
855
+ # @param format [int]
856
+ # @param glInternalFormat [unsigned int *]
857
+ # @param glFormat [unsigned int *]
858
+ # @param glType [unsigned int *]
859
+ # @return [void]
860
+ [:rlGetGlTextureFormats, :rlGetGlTextureFormats, [:int, :pointer, :pointer, :pointer], :void],
861
+
862
+ # rlGetPixelFormatName : Get name string for pixel format
863
+ # @param format [unsigned int]
864
+ # @return [const char *]
865
+ [:rlGetPixelFormatName, :rlGetPixelFormatName, [:uint], :pointer],
866
+
867
+ # rlUnloadTexture : Unload texture from GPU memory
868
+ # @param id [unsigned int]
869
+ # @return [void]
870
+ [:rlUnloadTexture, :rlUnloadTexture, [:uint], :void],
871
+
872
+ # rlGenTextureMipmaps : Generate mipmap data for selected texture
873
+ # @param id [unsigned int]
874
+ # @param width [int]
875
+ # @param height [int]
876
+ # @param format [int]
877
+ # @param mipmaps [int *]
878
+ # @return [void]
879
+ [:rlGenTextureMipmaps, :rlGenTextureMipmaps, [:uint, :int, :int, :int, :pointer], :void],
880
+
881
+ # rlReadTexturePixels : Read texture pixel data
882
+ # @param id [unsigned int]
883
+ # @param width [int]
884
+ # @param height [int]
885
+ # @param format [int]
886
+ # @return [void *]
887
+ [:rlReadTexturePixels, :rlReadTexturePixels, [:uint, :int, :int, :int], :pointer],
888
+
889
+ # rlReadScreenPixels : Read screen pixel data (color buffer)
890
+ # @param width [int]
891
+ # @param height [int]
892
+ # @return [unsigned char *]
893
+ [:rlReadScreenPixels, :rlReadScreenPixels, [:int, :int], :pointer],
894
+
895
+ # rlLoadFramebuffer : Load an empty framebuffer
896
+ # @param width [int]
897
+ # @param height [int]
898
+ # @return [unsigned int]
899
+ [:rlLoadFramebuffer, :rlLoadFramebuffer, [:int, :int], :uint],
900
+
901
+ # rlFramebufferAttach : Attach texture/renderbuffer to a framebuffer
902
+ # @param fboId [unsigned int]
903
+ # @param texId [unsigned int]
904
+ # @param attachType [int]
905
+ # @param texType [int]
906
+ # @param mipLevel [int]
907
+ # @return [void]
908
+ [:rlFramebufferAttach, :rlFramebufferAttach, [:uint, :uint, :int, :int, :int], :void],
909
+
910
+ # rlFramebufferComplete : Verify framebuffer is complete
911
+ # @param id [unsigned int]
912
+ # @return [bool]
913
+ [:rlFramebufferComplete, :rlFramebufferComplete, [:uint], :bool],
914
+
915
+ # rlUnloadFramebuffer : Delete framebuffer from GPU
916
+ # @param id [unsigned int]
917
+ # @return [void]
918
+ [:rlUnloadFramebuffer, :rlUnloadFramebuffer, [:uint], :void],
919
+
920
+ # rlLoadShaderCode : Load shader from code strings
921
+ # @param vsCode [const char *]
922
+ # @param fsCode [const char *]
923
+ # @return [unsigned int]
924
+ [:rlLoadShaderCode, :rlLoadShaderCode, [:pointer, :pointer], :uint],
925
+
926
+ # rlCompileShader : Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
927
+ # @param shaderCode [const char *]
928
+ # @param type [int]
929
+ # @return [unsigned int]
930
+ [:rlCompileShader, :rlCompileShader, [:pointer, :int], :uint],
931
+
932
+ # rlLoadShaderProgram : Load custom shader program
933
+ # @param vShaderId [unsigned int]
934
+ # @param fShaderId [unsigned int]
935
+ # @return [unsigned int]
936
+ [:rlLoadShaderProgram, :rlLoadShaderProgram, [:uint, :uint], :uint],
937
+
938
+ # rlUnloadShaderProgram : Unload shader program
939
+ # @param id [unsigned int]
940
+ # @return [void]
941
+ [:rlUnloadShaderProgram, :rlUnloadShaderProgram, [:uint], :void],
942
+
943
+ # rlGetLocationUniform : Get shader location uniform
944
+ # @param shaderId [unsigned int]
945
+ # @param uniformName [const char *]
946
+ # @return [int]
947
+ [:rlGetLocationUniform, :rlGetLocationUniform, [:uint, :pointer], :int],
948
+
949
+ # rlGetLocationAttrib : Get shader location attribute
950
+ # @param shaderId [unsigned int]
951
+ # @param attribName [const char *]
952
+ # @return [int]
953
+ [:rlGetLocationAttrib, :rlGetLocationAttrib, [:uint, :pointer], :int],
954
+
955
+ # rlSetUniform : Set shader value uniform
956
+ # @param locIndex [int]
957
+ # @param value [const void *]
958
+ # @param uniformType [int]
959
+ # @param count [int]
960
+ # @return [void]
961
+ [:rlSetUniform, :rlSetUniform, [:int, :pointer, :int, :int], :void],
962
+
963
+ # rlSetUniformMatrix : Set shader value matrix
964
+ # @param locIndex [int]
965
+ # @param mat [Matrix]
966
+ # @return [void]
967
+ [:rlSetUniformMatrix, :rlSetUniformMatrix, [:int, Matrix.by_value], :void],
968
+
969
+ # rlSetUniformSampler : Set shader value sampler
970
+ # @param locIndex [int]
971
+ # @param textureId [unsigned int]
972
+ # @return [void]
973
+ [:rlSetUniformSampler, :rlSetUniformSampler, [:int, :uint], :void],
974
+
975
+ # rlSetShader : Set shader currently active (id and locations)
976
+ # @param id [unsigned int]
977
+ # @param locs [int *]
978
+ # @return [void]
979
+ [:rlSetShader, :rlSetShader, [:uint, :pointer], :void],
980
+
981
+ # rlLoadComputeShaderProgram : Load compute shader program
982
+ # @param shaderId [unsigned int]
983
+ # @return [unsigned int]
984
+ [:rlLoadComputeShaderProgram, :rlLoadComputeShaderProgram, [:uint], :uint],
985
+
986
+ # rlComputeShaderDispatch : Dispatch compute shader (equivalent to *draw* for graphics pipeline)
987
+ # @param groupX [unsigned int]
988
+ # @param groupY [unsigned int]
989
+ # @param groupZ [unsigned int]
990
+ # @return [void]
991
+ [:rlComputeShaderDispatch, :rlComputeShaderDispatch, [:uint, :uint, :uint], :void],
992
+
993
+ # rlLoadShaderBuffer : Load shader storage buffer object (SSBO)
994
+ # @param size [unsigned int]
995
+ # @param data [const void *]
996
+ # @param usageHint [int]
997
+ # @return [unsigned int]
998
+ [:rlLoadShaderBuffer, :rlLoadShaderBuffer, [:uint, :pointer, :int], :uint],
999
+
1000
+ # rlUnloadShaderBuffer : Unload shader storage buffer object (SSBO)
1001
+ # @param ssboId [unsigned int]
1002
+ # @return [void]
1003
+ [:rlUnloadShaderBuffer, :rlUnloadShaderBuffer, [:uint], :void],
1004
+
1005
+ # rlUpdateShaderBuffer : Update SSBO buffer data
1006
+ # @param id [unsigned int]
1007
+ # @param data [const void *]
1008
+ # @param dataSize [unsigned int]
1009
+ # @param offset [unsigned int]
1010
+ # @return [void]
1011
+ [:rlUpdateShaderBuffer, :rlUpdateShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
1012
+
1013
+ # rlBindShaderBuffer : Bind SSBO buffer
1014
+ # @param id [unsigned int]
1015
+ # @param index [unsigned int]
1016
+ # @return [void]
1017
+ [:rlBindShaderBuffer, :rlBindShaderBuffer, [:uint, :uint], :void],
1018
+
1019
+ # rlReadShaderBuffer : Read SSBO buffer data (GPU->CPU)
1020
+ # @param id [unsigned int]
1021
+ # @param dest [void *]
1022
+ # @param count [unsigned int]
1023
+ # @param offset [unsigned int]
1024
+ # @return [void]
1025
+ [:rlReadShaderBuffer, :rlReadShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
1026
+
1027
+ # rlCopyShaderBuffer : Copy SSBO data between buffers
1028
+ # @param destId [unsigned int]
1029
+ # @param srcId [unsigned int]
1030
+ # @param destOffset [unsigned int]
1031
+ # @param srcOffset [unsigned int]
1032
+ # @param count [unsigned int]
1033
+ # @return [void]
1034
+ [:rlCopyShaderBuffer, :rlCopyShaderBuffer, [:uint, :uint, :uint, :uint, :uint], :void],
1035
+
1036
+ # rlGetShaderBufferSize : Get SSBO buffer size
1037
+ # @param id [unsigned int]
1038
+ # @return [unsigned int]
1039
+ [:rlGetShaderBufferSize, :rlGetShaderBufferSize, [:uint], :uint],
1040
+
1041
+ # rlBindImageTexture : Bind image texture
1042
+ # @param id [unsigned int]
1043
+ # @param index [unsigned int]
1044
+ # @param format [int]
1045
+ # @param readonly [bool]
1046
+ # @return [void]
1047
+ [:rlBindImageTexture, :rlBindImageTexture, [:uint, :uint, :int, :bool], :void],
1048
+
1049
+ # rlGetMatrixModelview : Get internal modelview matrix
1050
+ # @return [Matrix]
1051
+ [:rlGetMatrixModelview, :rlGetMatrixModelview, [], Matrix.by_value],
1052
+
1053
+ # rlGetMatrixProjection : Get internal projection matrix
1054
+ # @return [Matrix]
1055
+ [:rlGetMatrixProjection, :rlGetMatrixProjection, [], Matrix.by_value],
1056
+
1057
+ # rlGetMatrixTransform : Get internal accumulated transform matrix
1058
+ # @return [Matrix]
1059
+ [:rlGetMatrixTransform, :rlGetMatrixTransform, [], Matrix.by_value],
1060
+
1061
+ # rlGetMatrixProjectionStereo : Get internal projection matrix for stereo render (selected eye)
1062
+ # @param eye [int]
1063
+ # @return [Matrix]
1064
+ [:rlGetMatrixProjectionStereo, :rlGetMatrixProjectionStereo, [:int], Matrix.by_value],
1065
+
1066
+ # rlGetMatrixViewOffsetStereo : Get internal view offset matrix for stereo render (selected eye)
1067
+ # @param eye [int]
1068
+ # @return [Matrix]
1069
+ [:rlGetMatrixViewOffsetStereo, :rlGetMatrixViewOffsetStereo, [:int], Matrix.by_value],
1070
+
1071
+ # rlSetMatrixProjection : Set a custom projection matrix (replaces internal projection matrix)
1072
+ # @param proj [Matrix]
1073
+ # @return [void]
1074
+ [:rlSetMatrixProjection, :rlSetMatrixProjection, [Matrix.by_value], :void],
1075
+
1076
+ # rlSetMatrixModelview : Set a custom modelview matrix (replaces internal modelview matrix)
1077
+ # @param view [Matrix]
1078
+ # @return [void]
1079
+ [:rlSetMatrixModelview, :rlSetMatrixModelview, [Matrix.by_value], :void],
1080
+
1081
+ # rlSetMatrixProjectionStereo : Set eyes projection matrices for stereo rendering
1082
+ # @param right [Matrix]
1083
+ # @param left [Matrix]
1084
+ # @return [void]
1085
+ [:rlSetMatrixProjectionStereo, :rlSetMatrixProjectionStereo, [Matrix.by_value, Matrix.by_value], :void],
1086
+
1087
+ # rlSetMatrixViewOffsetStereo : Set eyes view offsets matrices for stereo rendering
1088
+ # @param right [Matrix]
1089
+ # @param left [Matrix]
1090
+ # @return [void]
1091
+ [:rlSetMatrixViewOffsetStereo, :rlSetMatrixViewOffsetStereo, [Matrix.by_value, Matrix.by_value], :void],
1092
+
1093
+ # rlLoadDrawCube : Load and draw a cube
1094
+ # @return [void]
1095
+ [:rlLoadDrawCube, :rlLoadDrawCube, [], :void],
1096
+
1097
+ # rlLoadDrawQuad : Load and draw a quad
1098
+ # @return [void]
1099
+ [:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
1100
+ ]
1101
+ entries.each do |entry|
1102
+ attach_function entry[0], entry[1], entry[2], entry[3]
1103
+ rescue FFI::NotFoundError => e
1104
+ warn "[Warning] Failed to import #{entry[0]} (#{e})."
1105
+ end
1106
+ end
1107
+ end