raylib-bindings 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rlgl.rb CHANGED
@@ -1,1100 +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_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 attachmment type: color 0
195
- RL_ATTACHMENT_COLOR_CHANNEL1 = 1 # Framebuffer attachmment type: color 1
196
- RL_ATTACHMENT_COLOR_CHANNEL2 = 2 # Framebuffer attachmment type: color 2
197
- RL_ATTACHMENT_COLOR_CHANNEL3 = 3 # Framebuffer attachmment type: color 3
198
- RL_ATTACHMENT_COLOR_CHANNEL4 = 4 # Framebuffer attachmment type: color 4
199
- RL_ATTACHMENT_COLOR_CHANNEL5 = 5 # Framebuffer attachmment type: color 5
200
- RL_ATTACHMENT_COLOR_CHANNEL6 = 6 # Framebuffer attachmment type: color 6
201
- RL_ATTACHMENT_COLOR_CHANNEL7 = 7 # Framebuffer attachmment type: color 7
202
- RL_ATTACHMENT_DEPTH = 100 # Framebuffer attachmment type: depth
203
- RL_ATTACHMENT_STENCIL = 200 # Framebuffer attachmment 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 lattest 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
- # rlEnableShader : Enable shader program
483
- # @param id [unsigned int]
484
- # @return [void]
485
- [:rlEnableShader, :rlEnableShader, [:uint], :void],
486
-
487
- # rlDisableShader : Disable shader program
488
- # @return [void]
489
- [:rlDisableShader, :rlDisableShader, [], :void],
490
-
491
- # rlEnableFramebuffer : Enable render texture (fbo)
492
- # @param id [unsigned int]
493
- # @return [void]
494
- [:rlEnableFramebuffer, :rlEnableFramebuffer, [:uint], :void],
495
-
496
- # rlDisableFramebuffer : Disable render texture (fbo), return to default framebuffer
497
- # @return [void]
498
- [:rlDisableFramebuffer, :rlDisableFramebuffer, [], :void],
499
-
500
- # rlActiveDrawBuffers : Activate multiple draw color buffers
501
- # @param count [int]
502
- # @return [void]
503
- [:rlActiveDrawBuffers, :rlActiveDrawBuffers, [:int], :void],
504
-
505
- # rlEnableColorBlend : Enable color blending
506
- # @return [void]
507
- [:rlEnableColorBlend, :rlEnableColorBlend, [], :void],
508
-
509
- # rlDisableColorBlend : Disable color blending
510
- # @return [void]
511
- [:rlDisableColorBlend, :rlDisableColorBlend, [], :void],
512
-
513
- # rlEnableDepthTest : Enable depth test
514
- # @return [void]
515
- [:rlEnableDepthTest, :rlEnableDepthTest, [], :void],
516
-
517
- # rlDisableDepthTest : Disable depth test
518
- # @return [void]
519
- [:rlDisableDepthTest, :rlDisableDepthTest, [], :void],
520
-
521
- # rlEnableDepthMask : Enable depth write
522
- # @return [void]
523
- [:rlEnableDepthMask, :rlEnableDepthMask, [], :void],
524
-
525
- # rlDisableDepthMask : Disable depth write
526
- # @return [void]
527
- [:rlDisableDepthMask, :rlDisableDepthMask, [], :void],
528
-
529
- # rlEnableBackfaceCulling : Enable backface culling
530
- # @return [void]
531
- [:rlEnableBackfaceCulling, :rlEnableBackfaceCulling, [], :void],
532
-
533
- # rlDisableBackfaceCulling : Disable backface culling
534
- # @return [void]
535
- [:rlDisableBackfaceCulling, :rlDisableBackfaceCulling, [], :void],
536
-
537
- # rlSetCullFace : Set face culling mode
538
- # @param mode [int]
539
- # @return [void]
540
- [:rlSetCullFace, :rlSetCullFace, [:int], :void],
541
-
542
- # rlEnableScissorTest : Enable scissor test
543
- # @return [void]
544
- [:rlEnableScissorTest, :rlEnableScissorTest, [], :void],
545
-
546
- # rlDisableScissorTest : Disable scissor test
547
- # @return [void]
548
- [:rlDisableScissorTest, :rlDisableScissorTest, [], :void],
549
-
550
- # rlScissor : Scissor test
551
- # @param x [int]
552
- # @param y [int]
553
- # @param width [int]
554
- # @param height [int]
555
- # @return [void]
556
- [:rlScissor, :rlScissor, [:int, :int, :int, :int], :void],
557
-
558
- # rlEnableWireMode : Enable wire mode
559
- # @return [void]
560
- [:rlEnableWireMode, :rlEnableWireMode, [], :void],
561
-
562
- # rlDisableWireMode : Disable wire mode
563
- # @return [void]
564
- [:rlDisableWireMode, :rlDisableWireMode, [], :void],
565
-
566
- # rlSetLineWidth : Set the line drawing width
567
- # @param width [float]
568
- # @return [void]
569
- [:rlSetLineWidth, :rlSetLineWidth, [:float], :void],
570
-
571
- # rlGetLineWidth : Get the line drawing width
572
- # @return [float]
573
- [:rlGetLineWidth, :rlGetLineWidth, [], :float],
574
-
575
- # rlEnableSmoothLines : Enable line aliasing
576
- # @return [void]
577
- [:rlEnableSmoothLines, :rlEnableSmoothLines, [], :void],
578
-
579
- # rlDisableSmoothLines : Disable line aliasing
580
- # @return [void]
581
- [:rlDisableSmoothLines, :rlDisableSmoothLines, [], :void],
582
-
583
- # rlEnableStereoRender : Enable stereo rendering
584
- # @return [void]
585
- [:rlEnableStereoRender, :rlEnableStereoRender, [], :void],
586
-
587
- # rlDisableStereoRender : Disable stereo rendering
588
- # @return [void]
589
- [:rlDisableStereoRender, :rlDisableStereoRender, [], :void],
590
-
591
- # rlIsStereoRenderEnabled : Check if stereo render is enabled
592
- # @return [bool]
593
- [:rlIsStereoRenderEnabled, :rlIsStereoRenderEnabled, [], :bool],
594
-
595
- # rlClearColor : Clear color buffer with color
596
- # @param r [unsigned char]
597
- # @param g [unsigned char]
598
- # @param b [unsigned char]
599
- # @param a [unsigned char]
600
- # @return [void]
601
- [:rlClearColor, :rlClearColor, [:uchar, :uchar, :uchar, :uchar], :void],
602
-
603
- # rlClearScreenBuffers : Clear used screen buffers (color and depth)
604
- # @return [void]
605
- [:rlClearScreenBuffers, :rlClearScreenBuffers, [], :void],
606
-
607
- # rlCheckErrors : Check and log OpenGL error codes
608
- # @return [void]
609
- [:rlCheckErrors, :rlCheckErrors, [], :void],
610
-
611
- # rlSetBlendMode : Set blending mode
612
- # @param mode [int]
613
- # @return [void]
614
- [:rlSetBlendMode, :rlSetBlendMode, [:int], :void],
615
-
616
- # rlSetBlendFactors : Set blending mode factor and equation (using OpenGL factors)
617
- # @param glSrcFactor [int]
618
- # @param glDstFactor [int]
619
- # @param glEquation [int]
620
- # @return [void]
621
- [:rlSetBlendFactors, :rlSetBlendFactors, [:int, :int, :int], :void],
622
-
623
- # rlSetBlendFactorsSeparate : Set blending mode factors and equations separately (using OpenGL factors)
624
- # @param glSrcRGB [int]
625
- # @param glDstRGB [int]
626
- # @param glSrcAlpha [int]
627
- # @param glDstAlpha [int]
628
- # @param glEqRGB [int]
629
- # @param glEqAlpha [int]
630
- # @return [void]
631
- [:rlSetBlendFactorsSeparate, :rlSetBlendFactorsSeparate, [:int, :int, :int, :int, :int, :int], :void],
632
-
633
- # rlglInit : Initialize rlgl (buffers, shaders, textures, states)
634
- # @param width [int]
635
- # @param height [int]
636
- # @return [void]
637
- [:rlglInit, :rlglInit, [:int, :int], :void],
638
-
639
- # rlglClose : De-inititialize rlgl (buffers, shaders, textures)
640
- # @return [void]
641
- [:rlglClose, :rlglClose, [], :void],
642
-
643
- # rlLoadExtensions : Load OpenGL extensions (loader function required)
644
- # @param loader [void *]
645
- # @return [void]
646
- [:rlLoadExtensions, :rlLoadExtensions, [:pointer], :void],
647
-
648
- # rlGetVersion : Get current OpenGL version
649
- # @return [int]
650
- [:rlGetVersion, :rlGetVersion, [], :int],
651
-
652
- # rlSetFramebufferWidth : Set current framebuffer width
653
- # @param width [int]
654
- # @return [void]
655
- [:rlSetFramebufferWidth, :rlSetFramebufferWidth, [:int], :void],
656
-
657
- # rlGetFramebufferWidth : Get default framebuffer width
658
- # @return [int]
659
- [:rlGetFramebufferWidth, :rlGetFramebufferWidth, [], :int],
660
-
661
- # rlSetFramebufferHeight : Set current framebuffer height
662
- # @param height [int]
663
- # @return [void]
664
- [:rlSetFramebufferHeight, :rlSetFramebufferHeight, [:int], :void],
665
-
666
- # rlGetFramebufferHeight : Get default framebuffer height
667
- # @return [int]
668
- [:rlGetFramebufferHeight, :rlGetFramebufferHeight, [], :int],
669
-
670
- # rlGetTextureIdDefault : Get default texture id
671
- # @return [unsigned int]
672
- [:rlGetTextureIdDefault, :rlGetTextureIdDefault, [], :uint],
673
-
674
- # rlGetShaderIdDefault : Get default shader id
675
- # @return [unsigned int]
676
- [:rlGetShaderIdDefault, :rlGetShaderIdDefault, [], :uint],
677
-
678
- # rlGetShaderLocsDefault : Get default shader locations
679
- # @return [int *]
680
- [:rlGetShaderLocsDefault, :rlGetShaderLocsDefault, [], :pointer],
681
-
682
- # rlLoadRenderBatch : Load a render batch system
683
- # @param numBuffers [int]
684
- # @param bufferElements [int]
685
- # @return [rlRenderBatch]
686
- [:rlLoadRenderBatch, :rlLoadRenderBatch, [:int, :int], RlRenderBatch.by_value],
687
-
688
- # rlUnloadRenderBatch : Unload render batch system
689
- # @param batch [rlRenderBatch]
690
- # @return [void]
691
- [:rlUnloadRenderBatch, :rlUnloadRenderBatch, [RlRenderBatch.by_value], :void],
692
-
693
- # rlDrawRenderBatch : Draw render batch data (Update->Draw->Reset)
694
- # @param batch [rlRenderBatch *]
695
- # @return [void]
696
- [:rlDrawRenderBatch, :rlDrawRenderBatch, [:pointer], :void],
697
-
698
- # rlSetRenderBatchActive : Set the active render batch for rlgl (NULL for default internal)
699
- # @param batch [rlRenderBatch *]
700
- # @return [void]
701
- [:rlSetRenderBatchActive, :rlSetRenderBatchActive, [:pointer], :void],
702
-
703
- # rlDrawRenderBatchActive : Update and draw internal render batch
704
- # @return [void]
705
- [:rlDrawRenderBatchActive, :rlDrawRenderBatchActive, [], :void],
706
-
707
- # rlCheckRenderBatchLimit : Check internal buffer overflow for a given number of vertex
708
- # @param vCount [int]
709
- # @return [bool]
710
- [:rlCheckRenderBatchLimit, :rlCheckRenderBatchLimit, [:int], :bool],
711
-
712
- # rlSetTexture : Set current texture for render batch and check buffers limits
713
- # @param id [unsigned int]
714
- # @return [void]
715
- [:rlSetTexture, :rlSetTexture, [:uint], :void],
716
-
717
- # rlLoadVertexArray : Load vertex array (vao) if supported
718
- # @return [unsigned int]
719
- [:rlLoadVertexArray, :rlLoadVertexArray, [], :uint],
720
-
721
- # rlLoadVertexBuffer : Load a vertex buffer attribute
722
- # @param buffer [const void *]
723
- # @param size [int]
724
- # @param dynamic [bool]
725
- # @return [unsigned int]
726
- [:rlLoadVertexBuffer, :rlLoadVertexBuffer, [:pointer, :int, :bool], :uint],
727
-
728
- # rlLoadVertexBufferElement : Load a new attributes element buffer
729
- # @param buffer [const void *]
730
- # @param size [int]
731
- # @param dynamic [bool]
732
- # @return [unsigned int]
733
- [:rlLoadVertexBufferElement, :rlLoadVertexBufferElement, [:pointer, :int, :bool], :uint],
734
-
735
- # rlUpdateVertexBuffer : Update GPU buffer with new data
736
- # @param bufferId [unsigned int]
737
- # @param data [const void *]
738
- # @param dataSize [int]
739
- # @param offset [int]
740
- # @return [void]
741
- [:rlUpdateVertexBuffer, :rlUpdateVertexBuffer, [:uint, :pointer, :int, :int], :void],
742
-
743
- # rlUpdateVertexBufferElements : Update vertex buffer elements with new data
744
- # @param id [unsigned int]
745
- # @param data [const void *]
746
- # @param dataSize [int]
747
- # @param offset [int]
748
- # @return [void]
749
- [:rlUpdateVertexBufferElements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void],
750
-
751
- # rlUnloadVertexArray
752
- # @param vaoId [unsigned int]
753
- # @return [void]
754
- [:rlUnloadVertexArray, :rlUnloadVertexArray, [:uint], :void],
755
-
756
- # rlUnloadVertexBuffer
757
- # @param vboId [unsigned int]
758
- # @return [void]
759
- [:rlUnloadVertexBuffer, :rlUnloadVertexBuffer, [:uint], :void],
760
-
761
- # rlSetVertexAttribute
762
- # @param index [unsigned int]
763
- # @param compSize [int]
764
- # @param type [int]
765
- # @param normalized [bool]
766
- # @param stride [int]
767
- # @param pointer [const void *]
768
- # @return [void]
769
- [:rlSetVertexAttribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void],
770
-
771
- # rlSetVertexAttributeDivisor
772
- # @param index [unsigned int]
773
- # @param divisor [int]
774
- # @return [void]
775
- [:rlSetVertexAttributeDivisor, :rlSetVertexAttributeDivisor, [:uint, :int], :void],
776
-
777
- # rlSetVertexAttributeDefault : Set vertex attribute default value
778
- # @param locIndex [int]
779
- # @param value [const void *]
780
- # @param attribType [int]
781
- # @param count [int]
782
- # @return [void]
783
- [:rlSetVertexAttributeDefault, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void],
784
-
785
- # rlDrawVertexArray
786
- # @param offset [int]
787
- # @param count [int]
788
- # @return [void]
789
- [:rlDrawVertexArray, :rlDrawVertexArray, [:int, :int], :void],
790
-
791
- # rlDrawVertexArrayElements
792
- # @param offset [int]
793
- # @param count [int]
794
- # @param buffer [const void *]
795
- # @return [void]
796
- [:rlDrawVertexArrayElements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void],
797
-
798
- # rlDrawVertexArrayInstanced
799
- # @param offset [int]
800
- # @param count [int]
801
- # @param instances [int]
802
- # @return [void]
803
- [:rlDrawVertexArrayInstanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void],
804
-
805
- # rlDrawVertexArrayElementsInstanced
806
- # @param offset [int]
807
- # @param count [int]
808
- # @param buffer [const void *]
809
- # @param instances [int]
810
- # @return [void]
811
- [:rlDrawVertexArrayElementsInstanced, :rlDrawVertexArrayElementsInstanced, [:int, :int, :pointer, :int], :void],
812
-
813
- # rlLoadTexture : Load texture in GPU
814
- # @param data [const void *]
815
- # @param width [int]
816
- # @param height [int]
817
- # @param format [int]
818
- # @param mipmapCount [int]
819
- # @return [unsigned int]
820
- [:rlLoadTexture, :rlLoadTexture, [:pointer, :int, :int, :int, :int], :uint],
821
-
822
- # rlLoadTextureDepth : Load depth texture/renderbuffer (to be attached to fbo)
823
- # @param width [int]
824
- # @param height [int]
825
- # @param useRenderBuffer [bool]
826
- # @return [unsigned int]
827
- [:rlLoadTextureDepth, :rlLoadTextureDepth, [:int, :int, :bool], :uint],
828
-
829
- # rlLoadTextureCubemap : Load texture cubemap
830
- # @param data [const void *]
831
- # @param size [int]
832
- # @param format [int]
833
- # @return [unsigned int]
834
- [:rlLoadTextureCubemap, :rlLoadTextureCubemap, [:pointer, :int, :int], :uint],
835
-
836
- # rlUpdateTexture : Update GPU texture with new data
837
- # @param id [unsigned int]
838
- # @param offsetX [int]
839
- # @param offsetY [int]
840
- # @param width [int]
841
- # @param height [int]
842
- # @param format [int]
843
- # @param data [const void *]
844
- # @return [void]
845
- [:rlUpdateTexture, :rlUpdateTexture, [:uint, :int, :int, :int, :int, :int, :pointer], :void],
846
-
847
- # rlGetGlTextureFormats : Get OpenGL internal formats
848
- # @param format [int]
849
- # @param glInternalFormat [unsigned int *]
850
- # @param glFormat [unsigned int *]
851
- # @param glType [unsigned int *]
852
- # @return [void]
853
- [:rlGetGlTextureFormats, :rlGetGlTextureFormats, [:int, :pointer, :pointer, :pointer], :void],
854
-
855
- # rlGetPixelFormatName : Get name string for pixel format
856
- # @param format [unsigned int]
857
- # @return [const char *]
858
- [:rlGetPixelFormatName, :rlGetPixelFormatName, [:uint], :pointer],
859
-
860
- # rlUnloadTexture : Unload texture from GPU memory
861
- # @param id [unsigned int]
862
- # @return [void]
863
- [:rlUnloadTexture, :rlUnloadTexture, [:uint], :void],
864
-
865
- # rlGenTextureMipmaps : Generate mipmap data for selected texture
866
- # @param id [unsigned int]
867
- # @param width [int]
868
- # @param height [int]
869
- # @param format [int]
870
- # @param mipmaps [int *]
871
- # @return [void]
872
- [:rlGenTextureMipmaps, :rlGenTextureMipmaps, [:uint, :int, :int, :int, :pointer], :void],
873
-
874
- # rlReadTexturePixels : Read texture pixel data
875
- # @param id [unsigned int]
876
- # @param width [int]
877
- # @param height [int]
878
- # @param format [int]
879
- # @return [void *]
880
- [:rlReadTexturePixels, :rlReadTexturePixels, [:uint, :int, :int, :int], :pointer],
881
-
882
- # rlReadScreenPixels : Read screen pixel data (color buffer)
883
- # @param width [int]
884
- # @param height [int]
885
- # @return [unsigned char *]
886
- [:rlReadScreenPixels, :rlReadScreenPixels, [:int, :int], :pointer],
887
-
888
- # rlLoadFramebuffer : Load an empty framebuffer
889
- # @param width [int]
890
- # @param height [int]
891
- # @return [unsigned int]
892
- [:rlLoadFramebuffer, :rlLoadFramebuffer, [:int, :int], :uint],
893
-
894
- # rlFramebufferAttach : Attach texture/renderbuffer to a framebuffer
895
- # @param fboId [unsigned int]
896
- # @param texId [unsigned int]
897
- # @param attachType [int]
898
- # @param texType [int]
899
- # @param mipLevel [int]
900
- # @return [void]
901
- [:rlFramebufferAttach, :rlFramebufferAttach, [:uint, :uint, :int, :int, :int], :void],
902
-
903
- # rlFramebufferComplete : Verify framebuffer is complete
904
- # @param id [unsigned int]
905
- # @return [bool]
906
- [:rlFramebufferComplete, :rlFramebufferComplete, [:uint], :bool],
907
-
908
- # rlUnloadFramebuffer : Delete framebuffer from GPU
909
- # @param id [unsigned int]
910
- # @return [void]
911
- [:rlUnloadFramebuffer, :rlUnloadFramebuffer, [:uint], :void],
912
-
913
- # rlLoadShaderCode : Load shader from code strings
914
- # @param vsCode [const char *]
915
- # @param fsCode [const char *]
916
- # @return [unsigned int]
917
- [:rlLoadShaderCode, :rlLoadShaderCode, [:pointer, :pointer], :uint],
918
-
919
- # rlCompileShader : Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
920
- # @param shaderCode [const char *]
921
- # @param type [int]
922
- # @return [unsigned int]
923
- [:rlCompileShader, :rlCompileShader, [:pointer, :int], :uint],
924
-
925
- # rlLoadShaderProgram : Load custom shader program
926
- # @param vShaderId [unsigned int]
927
- # @param fShaderId [unsigned int]
928
- # @return [unsigned int]
929
- [:rlLoadShaderProgram, :rlLoadShaderProgram, [:uint, :uint], :uint],
930
-
931
- # rlUnloadShaderProgram : Unload shader program
932
- # @param id [unsigned int]
933
- # @return [void]
934
- [:rlUnloadShaderProgram, :rlUnloadShaderProgram, [:uint], :void],
935
-
936
- # rlGetLocationUniform : Get shader location uniform
937
- # @param shaderId [unsigned int]
938
- # @param uniformName [const char *]
939
- # @return [int]
940
- [:rlGetLocationUniform, :rlGetLocationUniform, [:uint, :pointer], :int],
941
-
942
- # rlGetLocationAttrib : Get shader location attribute
943
- # @param shaderId [unsigned int]
944
- # @param attribName [const char *]
945
- # @return [int]
946
- [:rlGetLocationAttrib, :rlGetLocationAttrib, [:uint, :pointer], :int],
947
-
948
- # rlSetUniform : Set shader value uniform
949
- # @param locIndex [int]
950
- # @param value [const void *]
951
- # @param uniformType [int]
952
- # @param count [int]
953
- # @return [void]
954
- [:rlSetUniform, :rlSetUniform, [:int, :pointer, :int, :int], :void],
955
-
956
- # rlSetUniformMatrix : Set shader value matrix
957
- # @param locIndex [int]
958
- # @param mat [Matrix]
959
- # @return [void]
960
- [:rlSetUniformMatrix, :rlSetUniformMatrix, [:int, Matrix.by_value], :void],
961
-
962
- # rlSetUniformSampler : Set shader value sampler
963
- # @param locIndex [int]
964
- # @param textureId [unsigned int]
965
- # @return [void]
966
- [:rlSetUniformSampler, :rlSetUniformSampler, [:int, :uint], :void],
967
-
968
- # rlSetShader : Set shader currently active (id and locations)
969
- # @param id [unsigned int]
970
- # @param locs [int *]
971
- # @return [void]
972
- [:rlSetShader, :rlSetShader, [:uint, :pointer], :void],
973
-
974
- # rlLoadComputeShaderProgram : Load compute shader program
975
- # @param shaderId [unsigned int]
976
- # @return [unsigned int]
977
- [:rlLoadComputeShaderProgram, :rlLoadComputeShaderProgram, [:uint], :uint],
978
-
979
- # rlComputeShaderDispatch : Dispatch compute shader (equivalent to *draw* for graphics pilepine)
980
- # @param groupX [unsigned int]
981
- # @param groupY [unsigned int]
982
- # @param groupZ [unsigned int]
983
- # @return [void]
984
- [:rlComputeShaderDispatch, :rlComputeShaderDispatch, [:uint, :uint, :uint], :void],
985
-
986
- # rlLoadShaderBuffer : Load shader storage buffer object (SSBO)
987
- # @param size [unsigned int]
988
- # @param data [const void *]
989
- # @param usageHint [int]
990
- # @return [unsigned int]
991
- [:rlLoadShaderBuffer, :rlLoadShaderBuffer, [:uint, :pointer, :int], :uint],
992
-
993
- # rlUnloadShaderBuffer : Unload shader storage buffer object (SSBO)
994
- # @param ssboId [unsigned int]
995
- # @return [void]
996
- [:rlUnloadShaderBuffer, :rlUnloadShaderBuffer, [:uint], :void],
997
-
998
- # rlUpdateShaderBuffer : Update SSBO buffer data
999
- # @param id [unsigned int]
1000
- # @param data [const void *]
1001
- # @param dataSize [unsigned int]
1002
- # @param offset [unsigned int]
1003
- # @return [void]
1004
- [:rlUpdateShaderBuffer, :rlUpdateShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
1005
-
1006
- # rlBindShaderBuffer : Bind SSBO buffer
1007
- # @param id [unsigned int]
1008
- # @param index [unsigned int]
1009
- # @return [void]
1010
- [:rlBindShaderBuffer, :rlBindShaderBuffer, [:uint, :uint], :void],
1011
-
1012
- # rlReadShaderBuffer : Read SSBO buffer data (GPU->CPU)
1013
- # @param id [unsigned int]
1014
- # @param dest [void *]
1015
- # @param count [unsigned int]
1016
- # @param offset [unsigned int]
1017
- # @return [void]
1018
- [:rlReadShaderBuffer, :rlReadShaderBuffer, [:uint, :pointer, :uint, :uint], :void],
1019
-
1020
- # rlCopyShaderBuffer : Copy SSBO data between buffers
1021
- # @param destId [unsigned int]
1022
- # @param srcId [unsigned int]
1023
- # @param destOffset [unsigned int]
1024
- # @param srcOffset [unsigned int]
1025
- # @param count [unsigned int]
1026
- # @return [void]
1027
- [:rlCopyShaderBuffer, :rlCopyShaderBuffer, [:uint, :uint, :uint, :uint, :uint], :void],
1028
-
1029
- # rlGetShaderBufferSize : Get SSBO buffer size
1030
- # @param id [unsigned int]
1031
- # @return [unsigned int]
1032
- [:rlGetShaderBufferSize, :rlGetShaderBufferSize, [:uint], :uint],
1033
-
1034
- # rlBindImageTexture : Bind image texture
1035
- # @param id [unsigned int]
1036
- # @param index [unsigned int]
1037
- # @param format [int]
1038
- # @param readonly [bool]
1039
- # @return [void]
1040
- [:rlBindImageTexture, :rlBindImageTexture, [:uint, :uint, :int, :bool], :void],
1041
-
1042
- # rlGetMatrixModelview : Get internal modelview matrix
1043
- # @return [Matrix]
1044
- [:rlGetMatrixModelview, :rlGetMatrixModelview, [], Matrix.by_value],
1045
-
1046
- # rlGetMatrixProjection : Get internal projection matrix
1047
- # @return [Matrix]
1048
- [:rlGetMatrixProjection, :rlGetMatrixProjection, [], Matrix.by_value],
1049
-
1050
- # rlGetMatrixTransform : Get internal accumulated transform matrix
1051
- # @return [Matrix]
1052
- [:rlGetMatrixTransform, :rlGetMatrixTransform, [], Matrix.by_value],
1053
-
1054
- # rlGetMatrixProjectionStereo : Get internal projection matrix for stereo render (selected eye)
1055
- # @param eye [int]
1056
- # @return [Matrix]
1057
- [:rlGetMatrixProjectionStereo, :rlGetMatrixProjectionStereo, [:int], Matrix.by_value],
1058
-
1059
- # rlGetMatrixViewOffsetStereo : Get internal view offset matrix for stereo render (selected eye)
1060
- # @param eye [int]
1061
- # @return [Matrix]
1062
- [:rlGetMatrixViewOffsetStereo, :rlGetMatrixViewOffsetStereo, [:int], Matrix.by_value],
1063
-
1064
- # rlSetMatrixProjection : Set a custom projection matrix (replaces internal projection matrix)
1065
- # @param proj [Matrix]
1066
- # @return [void]
1067
- [:rlSetMatrixProjection, :rlSetMatrixProjection, [Matrix.by_value], :void],
1068
-
1069
- # rlSetMatrixModelview : Set a custom modelview matrix (replaces internal modelview matrix)
1070
- # @param view [Matrix]
1071
- # @return [void]
1072
- [:rlSetMatrixModelview, :rlSetMatrixModelview, [Matrix.by_value], :void],
1073
-
1074
- # rlSetMatrixProjectionStereo : Set eyes projection matrices for stereo rendering
1075
- # @param right [Matrix]
1076
- # @param left [Matrix]
1077
- # @return [void]
1078
- [:rlSetMatrixProjectionStereo, :rlSetMatrixProjectionStereo, [Matrix.by_value, Matrix.by_value], :void],
1079
-
1080
- # rlSetMatrixViewOffsetStereo : Set eyes view offsets matrices for stereo rendering
1081
- # @param right [Matrix]
1082
- # @param left [Matrix]
1083
- # @return [void]
1084
- [:rlSetMatrixViewOffsetStereo, :rlSetMatrixViewOffsetStereo, [Matrix.by_value, Matrix.by_value], :void],
1085
-
1086
- # rlLoadDrawCube : Load and draw a cube
1087
- # @return [void]
1088
- [:rlLoadDrawCube, :rlLoadDrawCube, [], :void],
1089
-
1090
- # rlLoadDrawQuad : Load and draw a quad
1091
- # @return [void]
1092
- [:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
1093
- ]
1094
- entries.each do |entry|
1095
- attach_function entry[0], entry[1], entry[2], entry[3]
1096
- rescue FFI::NotFoundError => e
1097
- warn "[Warning] Failed to import #{entry[0]} (#{e})."
1098
- end
1099
- end
1100
- end
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