raylib 5.6.0.0.dev1__cp312-cp312-win32.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
raylib/rlgl.h.modified ADDED
@@ -0,0 +1,534 @@
1
+ /**********************************************************************************************
2
+ *
3
+ * rlgl v5.0 - A multi-OpenGL abstraction layer with an immediate-mode style API
4
+ *
5
+ * DESCRIPTION:
6
+ * An abstraction layer for multiple OpenGL versions (1.1, 2.1, 3.3 Core, 4.3 Core, ES 2.0, ES 3.0)
7
+ * that provides a pseudo-OpenGL 1.1 immediate-mode style API (rlVertex, rlTranslate, rlRotate...)
8
+ *
9
+ * ADDITIONAL NOTES:
10
+ * When choosing an OpenGL backend different than OpenGL 1.1, some internal buffer are
11
+ * initialized on rlglInit() to accumulate vertex data
12
+ *
13
+ * When an internal state change is required all the stored vertex data is rendered in batch,
14
+ * additionally, rlDrawRenderBatchActive() could be called to force flushing of the batch
15
+ *
16
+ * Some resources are also loaded for convenience, here the complete list:
17
+ * - Default batch (RLGL.defaultBatch): RenderBatch system to accumulate vertex data
18
+ * - Default texture (RLGL.defaultTextureId): 1x1 white pixel R8G8B8A8
19
+ * - Default shader (RLGL.State.defaultShaderId, RLGL.State.defaultShaderLocs)
20
+ *
21
+ * Internal buffer (and resources) must be manually unloaded calling rlglClose()
22
+ *
23
+ * CONFIGURATION:
24
+ * #define GRAPHICS_API_OPENGL_11_SOFTWARE
25
+ * #define GRAPHICS_API_OPENGL_11
26
+ * #define GRAPHICS_API_OPENGL_21
27
+ * #define GRAPHICS_API_OPENGL_33
28
+ * #define GRAPHICS_API_OPENGL_43
29
+ * #define GRAPHICS_API_OPENGL_ES2
30
+ * #define GRAPHICS_API_OPENGL_ES3
31
+ * Use selected OpenGL graphics backend, should be supported by platform
32
+ * Those preprocessor defines are only used on rlgl module, if OpenGL version is
33
+ * required by any other module, use rlGetVersion() to check it
34
+ *
35
+ * #define RLGL_IMPLEMENTATION
36
+ * Generates the implementation of the library into the included file
37
+ * If not defined, the library is in header only mode and can be included in other headers
38
+ * or source files without problems. But only ONE file should hold the implementation
39
+ *
40
+ * #define RLGL_RENDER_TEXTURES_HINT
41
+ * Enable framebuffer objects (fbo) support (enabled by default)
42
+ * Some GPUs could not support them despite the OpenGL version
43
+ *
44
+ * #define RLGL_SHOW_GL_DETAILS_INFO
45
+ * Show OpenGL extensions and capabilities detailed logs on init
46
+ *
47
+ * #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
48
+ * Enable debug context (only available on OpenGL 4.3)
49
+ *
50
+ * rlgl capabilities could be customized just defining some internal
51
+ * values before library inclusion (default values listed):
52
+ *
53
+ * #define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 8192 // Default internal render batch elements limits
54
+ * #define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
55
+ * #define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
56
+ * #define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
57
+ *
58
+ * #define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
59
+ * #define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
60
+ * #define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance
61
+ * #define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance
62
+ *
63
+ * When loading a shader, the following vertex attributes and uniform
64
+ * location names are tried to be set automatically:
65
+ *
66
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION
67
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD
68
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL
69
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR
70
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT
71
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2
72
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEIDS "vertexBoneIds" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEIDS
73
+ * #define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS
74
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
75
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
76
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
77
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
78
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView)))
79
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (base tint color, multiplied by texture color)
80
+ * #define RL_DEFAULT_SHADER_UNIFORM_NAME_BONE_MATRICES "boneMatrices" // bone matrices
81
+ * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
82
+ * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
83
+ * #define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
84
+ *
85
+ * DEPENDENCIES:
86
+ * - OpenGL libraries (depending on platform and OpenGL version selected)
87
+ * - GLAD OpenGL extensions loading library (only for OpenGL 3.3 Core, 4.3 Core)
88
+ *
89
+ *
90
+ * LICENSE: zlib/libpng
91
+ *
92
+ * Copyright (c) 2014-2025 Ramon Santamaria (@raysan5)
93
+ *
94
+ * This software is provided "as-is", without any express or implied warranty. In no event
95
+ * will the authors be held liable for any damages arising from the use of this software.
96
+ *
97
+ * Permission is granted to anyone to use this software for any purpose, including commercial
98
+ * applications, and to alter it and redistribute it freely, subject to the following restrictions:
99
+ *
100
+ * 1. The origin of this software must not be misrepresented; you must not claim that you
101
+ * wrote the original software. If you use this software in a product, an acknowledgment
102
+ * in the product documentation would be appreciated but is not required.
103
+ *
104
+ * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
105
+ * as being the original software.
106
+ *
107
+ * 3. This notice may not be removed or altered from any source distribution.
108
+ *
109
+ **********************************************************************************************/
110
+ // Function specifiers in case library is build/used as a shared library
111
+ // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
112
+ // NOTE: visibility(default) attribute makes symbols "visible" when compiled with -fvisibility=hidden
113
+ // Function specifiers definition
114
+ // Support TRACELOG macros
115
+ // Allow custom memory allocators
116
+ // Security check in case no GRAPHICS_API_OPENGL_* defined
117
+ // Security check in case multiple GRAPHICS_API_OPENGL_* defined
118
+ // Software implementation uses OpenGL 1.1 functionality
119
+ // OpenGL 2.1 uses most of OpenGL 3.3 Core functionality
120
+ // WARNING: Specific parts are checked with #if defines
121
+ // OpenGL 4.3 uses OpenGL 3.3 Core functionality
122
+ // OpenGL ES 3.0 uses OpenGL ES 2.0 functionality (and more)
123
+ // Support framebuffer objects by default
124
+ // NOTE: Some driver implementation do not support it, despite they should
125
+ //----------------------------------------------------------------------------------
126
+ // Defines and Macros
127
+ //----------------------------------------------------------------------------------
128
+ // Default internal render batch elements limits
129
+ // This is the maximum amount of elements (quads) per batch
130
+ // NOTE: Be careful with text, every letter maps to a quad
131
+ // Internal Matrix stack
132
+ // Shader limits
133
+ // Projection matrix culling
134
+ // Texture parameters (equivalent to OpenGL defines)
135
+ // Matrix modes (equivalent to OpenGL)
136
+ // Primitive assembly draw modes
137
+ // GL equivalent data types
138
+ // GL buffer usage hint
139
+ // GL Shader type
140
+ // GL blending factors
141
+ // GL blending functions/equations
142
+ // Default shader vertex attribute locations
143
+ //----------------------------------------------------------------------------------
144
+ // Types and Structures Definition
145
+ //----------------------------------------------------------------------------------
146
+ // Dynamic vertex buffers (position + texcoords + colors + indices arrays)
147
+ typedef struct rlVertexBuffer {
148
+ int elementCount; // Number of elements in the buffer (QUADS)
149
+ float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
150
+ float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
151
+ float *normals; // Vertex normal (XYZ - 3 components per vertex) (shader-location = 2)
152
+ unsigned char *colors; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
153
+ unsigned int *indices; // Vertex indices (in case vertex data comes indexed) (6 indices per quad)
154
+ unsigned int vaoId; // OpenGL Vertex Array Object id
155
+ unsigned int vboId[5]; // OpenGL Vertex Buffer Objects id (5 types of vertex data)
156
+ } rlVertexBuffer;
157
+ // Draw call type
158
+ // NOTE: Only texture changes register a new draw, other state-change-related elements are not
159
+ // used at this moment (vaoId, shaderId, matrices), raylib just forces a batch draw call if any
160
+ // of those state-change happens (this is done in core module)
161
+ typedef struct rlDrawCall {
162
+ int mode; // Drawing mode: LINES, TRIANGLES, QUADS
163
+ int vertexCount; // Number of vertex of the draw
164
+ int vertexAlignment; // Number of vertex required for index alignment (LINES, TRIANGLES)
165
+ //unsigned int vaoId; // Vertex array id to be used on the draw -> Using RLGL.currentBatch->vertexBuffer.vaoId
166
+ //unsigned int shaderId; // Shader id to be used on the draw -> Using RLGL.currentShaderId
167
+ unsigned int textureId; // Texture id to be used on the draw -> Use to create new draw call if changes
168
+ //Matrix projection; // Projection matrix for this draw -> Using RLGL.projection by default
169
+ //Matrix modelview; // Modelview matrix for this draw -> Using RLGL.modelview by default
170
+ } rlDrawCall;
171
+ // rlRenderBatch type
172
+ typedef struct rlRenderBatch {
173
+ int bufferCount; // Number of vertex buffers (multi-buffering support)
174
+ int currentBuffer; // Current buffer tracking in case of multi-buffering
175
+ rlVertexBuffer *vertexBuffer; // Dynamic buffer(s) for vertex data
176
+ rlDrawCall *draws; // Draw calls array, depends on textureId
177
+ int drawCounter; // Draw calls counter
178
+ float currentDepth; // Current depth value for next draw
179
+ } rlRenderBatch;
180
+ // OpenGL version
181
+ typedef enum {
182
+ RL_OPENGL_11_SOFTWARE = 0, // Software rendering
183
+ RL_OPENGL_11, // OpenGL 1.1
184
+ RL_OPENGL_21, // OpenGL 2.1 (GLSL 120)
185
+ RL_OPENGL_33, // OpenGL 3.3 (GLSL 330)
186
+ RL_OPENGL_43, // OpenGL 4.3 (using GLSL 330)
187
+ RL_OPENGL_ES_20, // OpenGL ES 2.0 (GLSL 100)
188
+ RL_OPENGL_ES_30 // OpenGL ES 3.0 (GLSL 300 es)
189
+ } rlGlVersion;
190
+ // Trace log level
191
+ // NOTE: Organized by priority level
192
+ typedef enum {
193
+ RL_LOG_ALL = 0, // Display all logs
194
+ RL_LOG_TRACE, // Trace logging, intended for internal use only
195
+ RL_LOG_DEBUG, // Debug logging, used for internal debugging, it should be disabled on release builds
196
+ RL_LOG_INFO, // Info logging, used for program execution info
197
+ RL_LOG_WARNING, // Warning logging, used on recoverable failures
198
+ RL_LOG_ERROR, // Error logging, used on unrecoverable failures
199
+ RL_LOG_FATAL, // Fatal logging, used to abort program: exit(EXIT_FAILURE)
200
+ RL_LOG_NONE // Disable logging
201
+ } rlTraceLogLevel;
202
+ // Texture pixel formats
203
+ // NOTE: Support depends on OpenGL version
204
+ typedef enum {
205
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha)
206
+ RL_PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels)
207
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp
208
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp
209
+ RL_PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha)
210
+ RL_PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha)
211
+ RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, // 32 bpp
212
+ RL_PIXELFORMAT_UNCOMPRESSED_R32, // 32 bpp (1 channel - float)
213
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32, // 32*3 bpp (3 channels - float)
214
+ RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32, // 32*4 bpp (4 channels - float)
215
+ RL_PIXELFORMAT_UNCOMPRESSED_R16, // 16 bpp (1 channel - half float)
216
+ RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, // 16*3 bpp (3 channels - half float)
217
+ RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16, // 16*4 bpp (4 channels - half float)
218
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGB, // 4 bpp (no alpha)
219
+ RL_PIXELFORMAT_COMPRESSED_DXT1_RGBA, // 4 bpp (1 bit alpha)
220
+ RL_PIXELFORMAT_COMPRESSED_DXT3_RGBA, // 8 bpp
221
+ RL_PIXELFORMAT_COMPRESSED_DXT5_RGBA, // 8 bpp
222
+ RL_PIXELFORMAT_COMPRESSED_ETC1_RGB, // 4 bpp
223
+ RL_PIXELFORMAT_COMPRESSED_ETC2_RGB, // 4 bpp
224
+ RL_PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA, // 8 bpp
225
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGB, // 4 bpp
226
+ RL_PIXELFORMAT_COMPRESSED_PVRT_RGBA, // 4 bpp
227
+ RL_PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA, // 8 bpp
228
+ RL_PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA // 2 bpp
229
+ } rlPixelFormat;
230
+ // Texture parameters: filter mode
231
+ // NOTE 1: Filtering considers mipmaps if available in the texture
232
+ // NOTE 2: Filter is accordingly set for minification and magnification
233
+ typedef enum {
234
+ RL_TEXTURE_FILTER_POINT = 0, // No filter, just pixel approximation
235
+ RL_TEXTURE_FILTER_BILINEAR, // Linear filtering
236
+ RL_TEXTURE_FILTER_TRILINEAR, // Trilinear filtering (linear with mipmaps)
237
+ RL_TEXTURE_FILTER_ANISOTROPIC_4X, // Anisotropic filtering 4x
238
+ RL_TEXTURE_FILTER_ANISOTROPIC_8X, // Anisotropic filtering 8x
239
+ RL_TEXTURE_FILTER_ANISOTROPIC_16X, // Anisotropic filtering 16x
240
+ } rlTextureFilter;
241
+ // Color blending modes (pre-defined)
242
+ typedef enum {
243
+ RL_BLEND_ALPHA = 0, // Blend textures considering alpha (default)
244
+ RL_BLEND_ADDITIVE, // Blend textures adding colors
245
+ RL_BLEND_MULTIPLIED, // Blend textures multiplying colors
246
+ RL_BLEND_ADD_COLORS, // Blend textures adding colors (alternative)
247
+ RL_BLEND_SUBTRACT_COLORS, // Blend textures subtracting colors (alternative)
248
+ RL_BLEND_ALPHA_PREMULTIPLY, // Blend premultiplied textures considering alpha
249
+ RL_BLEND_CUSTOM, // Blend textures using custom src/dst factors (use rlSetBlendFactors())
250
+ RL_BLEND_CUSTOM_SEPARATE // Blend textures using custom src/dst factors (use rlSetBlendFactorsSeparate())
251
+ } rlBlendMode;
252
+ // Shader location point type
253
+ typedef enum {
254
+ RL_SHADER_LOC_VERTEX_POSITION = 0, // Shader location: vertex attribute: position
255
+ RL_SHADER_LOC_VERTEX_TEXCOORD01, // Shader location: vertex attribute: texcoord01
256
+ RL_SHADER_LOC_VERTEX_TEXCOORD02, // Shader location: vertex attribute: texcoord02
257
+ RL_SHADER_LOC_VERTEX_NORMAL, // Shader location: vertex attribute: normal
258
+ RL_SHADER_LOC_VERTEX_TANGENT, // Shader location: vertex attribute: tangent
259
+ RL_SHADER_LOC_VERTEX_COLOR, // Shader location: vertex attribute: color
260
+ RL_SHADER_LOC_MATRIX_MVP, // Shader location: matrix uniform: model-view-projection
261
+ RL_SHADER_LOC_MATRIX_VIEW, // Shader location: matrix uniform: view (camera transform)
262
+ RL_SHADER_LOC_MATRIX_PROJECTION, // Shader location: matrix uniform: projection
263
+ RL_SHADER_LOC_MATRIX_MODEL, // Shader location: matrix uniform: model (transform)
264
+ RL_SHADER_LOC_MATRIX_NORMAL, // Shader location: matrix uniform: normal
265
+ RL_SHADER_LOC_VECTOR_VIEW, // Shader location: vector uniform: view
266
+ RL_SHADER_LOC_COLOR_DIFFUSE, // Shader location: vector uniform: diffuse color
267
+ RL_SHADER_LOC_COLOR_SPECULAR, // Shader location: vector uniform: specular color
268
+ RL_SHADER_LOC_COLOR_AMBIENT, // Shader location: vector uniform: ambient color
269
+ RL_SHADER_LOC_MAP_ALBEDO, // Shader location: sampler2d texture: albedo (same as: RL_SHADER_LOC_MAP_DIFFUSE)
270
+ RL_SHADER_LOC_MAP_METALNESS, // Shader location: sampler2d texture: metalness (same as: RL_SHADER_LOC_MAP_SPECULAR)
271
+ RL_SHADER_LOC_MAP_NORMAL, // Shader location: sampler2d texture: normal
272
+ RL_SHADER_LOC_MAP_ROUGHNESS, // Shader location: sampler2d texture: roughness
273
+ RL_SHADER_LOC_MAP_OCCLUSION, // Shader location: sampler2d texture: occlusion
274
+ RL_SHADER_LOC_MAP_EMISSION, // Shader location: sampler2d texture: emission
275
+ RL_SHADER_LOC_MAP_HEIGHT, // Shader location: sampler2d texture: height
276
+ RL_SHADER_LOC_MAP_CUBEMAP, // Shader location: samplerCube texture: cubemap
277
+ RL_SHADER_LOC_MAP_IRRADIANCE, // Shader location: samplerCube texture: irradiance
278
+ RL_SHADER_LOC_MAP_PREFILTER, // Shader location: samplerCube texture: prefilter
279
+ RL_SHADER_LOC_MAP_BRDF // Shader location: sampler2d texture: brdf
280
+ } rlShaderLocationIndex;
281
+ // Shader uniform data type
282
+ typedef enum {
283
+ RL_SHADER_UNIFORM_FLOAT = 0, // Shader uniform type: float
284
+ RL_SHADER_UNIFORM_VEC2, // Shader uniform type: vec2 (2 float)
285
+ RL_SHADER_UNIFORM_VEC3, // Shader uniform type: vec3 (3 float)
286
+ RL_SHADER_UNIFORM_VEC4, // Shader uniform type: vec4 (4 float)
287
+ RL_SHADER_UNIFORM_INT, // Shader uniform type: int
288
+ RL_SHADER_UNIFORM_IVEC2, // Shader uniform type: ivec2 (2 int)
289
+ RL_SHADER_UNIFORM_IVEC3, // Shader uniform type: ivec3 (3 int)
290
+ RL_SHADER_UNIFORM_IVEC4, // Shader uniform type: ivec4 (4 int)
291
+ RL_SHADER_UNIFORM_UINT, // Shader uniform type: unsigned int
292
+ RL_SHADER_UNIFORM_UIVEC2, // Shader uniform type: uivec2 (2 unsigned int)
293
+ RL_SHADER_UNIFORM_UIVEC3, // Shader uniform type: uivec3 (3 unsigned int)
294
+ RL_SHADER_UNIFORM_UIVEC4, // Shader uniform type: uivec4 (4 unsigned int)
295
+ RL_SHADER_UNIFORM_SAMPLER2D // Shader uniform type: sampler2d
296
+ } rlShaderUniformDataType;
297
+ // Shader attribute data types
298
+ typedef enum {
299
+ RL_SHADER_ATTRIB_FLOAT = 0, // Shader attribute type: float
300
+ RL_SHADER_ATTRIB_VEC2, // Shader attribute type: vec2 (2 float)
301
+ RL_SHADER_ATTRIB_VEC3, // Shader attribute type: vec3 (3 float)
302
+ RL_SHADER_ATTRIB_VEC4 // Shader attribute type: vec4 (4 float)
303
+ } rlShaderAttributeDataType;
304
+ // Framebuffer attachment type
305
+ // NOTE: By default up to 8 color channels defined, but it can be more
306
+ typedef enum {
307
+ RL_ATTACHMENT_COLOR_CHANNEL0 = 0, // Framebuffer attachment type: color 0
308
+ RL_ATTACHMENT_COLOR_CHANNEL1 = 1, // Framebuffer attachment type: color 1
309
+ RL_ATTACHMENT_COLOR_CHANNEL2 = 2, // Framebuffer attachment type: color 2
310
+ RL_ATTACHMENT_COLOR_CHANNEL3 = 3, // Framebuffer attachment type: color 3
311
+ RL_ATTACHMENT_COLOR_CHANNEL4 = 4, // Framebuffer attachment type: color 4
312
+ RL_ATTACHMENT_COLOR_CHANNEL5 = 5, // Framebuffer attachment type: color 5
313
+ RL_ATTACHMENT_COLOR_CHANNEL6 = 6, // Framebuffer attachment type: color 6
314
+ RL_ATTACHMENT_COLOR_CHANNEL7 = 7, // Framebuffer attachment type: color 7
315
+ RL_ATTACHMENT_DEPTH = 100, // Framebuffer attachment type: depth
316
+ RL_ATTACHMENT_STENCIL = 200, // Framebuffer attachment type: stencil
317
+ } rlFramebufferAttachType;
318
+ // Framebuffer texture attachment type
319
+ typedef enum {
320
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0, // Framebuffer texture attachment type: cubemap, +X side
321
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_X = 1, // Framebuffer texture attachment type: cubemap, -X side
322
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Y = 2, // Framebuffer texture attachment type: cubemap, +Y side
323
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y = 3, // Framebuffer texture attachment type: cubemap, -Y side
324
+ RL_ATTACHMENT_CUBEMAP_POSITIVE_Z = 4, // Framebuffer texture attachment type: cubemap, +Z side
325
+ RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z = 5, // Framebuffer texture attachment type: cubemap, -Z side
326
+ RL_ATTACHMENT_TEXTURE2D = 100, // Framebuffer texture attachment type: texture2d
327
+ RL_ATTACHMENT_RENDERBUFFER = 200, // Framebuffer texture attachment type: renderbuffer
328
+ } rlFramebufferAttachTextureType;
329
+ // Face culling mode
330
+ typedef enum {
331
+ RL_CULL_FACE_FRONT = 0,
332
+ RL_CULL_FACE_BACK
333
+ } rlCullMode;
334
+ //------------------------------------------------------------------------------------
335
+ // Functions Declaration - Matrix operations
336
+ //------------------------------------------------------------------------------------
337
+ void rlMatrixMode(int mode); // Choose the current matrix to be transformed
338
+ void rlPushMatrix(void); // Push the current matrix to stack
339
+ void rlPopMatrix(void); // Pop latest inserted matrix from stack
340
+ void rlLoadIdentity(void); // Reset current matrix to identity matrix
341
+ void rlTranslatef(float x, float y, float z); // Multiply the current matrix by a translation matrix
342
+ void rlRotatef(float angle, float x, float y, float z); // Multiply the current matrix by a rotation matrix
343
+ void rlScalef(float x, float y, float z); // Multiply the current matrix by a scaling matrix
344
+ void rlMultMatrixf(const float *matf); // Multiply the current matrix by another matrix
345
+ void rlFrustum(double left, double right, double bottom, double top, double znear, double zfar);
346
+ void rlOrtho(double left, double right, double bottom, double top, double znear, double zfar);
347
+ void rlViewport(int x, int y, int width, int height); // Set the viewport area
348
+ void rlSetClipPlanes(double nearPlane, double farPlane); // Set clip planes distances
349
+ double rlGetCullDistanceNear(void); // Get cull plane distance near
350
+ double rlGetCullDistanceFar(void); // Get cull plane distance far
351
+ //------------------------------------------------------------------------------------
352
+ // Functions Declaration - Vertex level operations
353
+ //------------------------------------------------------------------------------------
354
+ void rlBegin(int mode); // Initialize drawing mode (how to organize vertex)
355
+ void rlEnd(void); // Finish vertex providing
356
+ void rlVertex2i(int x, int y); // Define one vertex (position) - 2 int
357
+ void rlVertex2f(float x, float y); // Define one vertex (position) - 2 float
358
+ void rlVertex3f(float x, float y, float z); // Define one vertex (position) - 3 float
359
+ void rlTexCoord2f(float x, float y); // Define one vertex (texture coordinate) - 2 float
360
+ void rlNormal3f(float x, float y, float z); // Define one vertex (normal) - 3 float
361
+ void rlColor4ub(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Define one vertex (color) - 4 byte
362
+ void rlColor3f(float x, float y, float z); // Define one vertex (color) - 3 float
363
+ void rlColor4f(float x, float y, float z, float w); // Define one vertex (color) - 4 float
364
+ //------------------------------------------------------------------------------------
365
+ // Functions Declaration - OpenGL style functions (common to 1.1, 3.3+, ES2)
366
+ // NOTE: This functions are used to completely abstract raylib code from OpenGL layer,
367
+ // some of them are direct wrappers over OpenGL calls, some others are custom
368
+ //------------------------------------------------------------------------------------
369
+ // Vertex buffers state
370
+ bool rlEnableVertexArray(unsigned int vaoId); // Enable vertex array (VAO, if supported)
371
+ void rlDisableVertexArray(void); // Disable vertex array (VAO, if supported)
372
+ void rlEnableVertexBuffer(unsigned int id); // Enable vertex buffer (VBO)
373
+ void rlDisableVertexBuffer(void); // Disable vertex buffer (VBO)
374
+ void rlEnableVertexBufferElement(unsigned int id); // Enable vertex buffer element (VBO element)
375
+ void rlDisableVertexBufferElement(void); // Disable vertex buffer element (VBO element)
376
+ void rlEnableVertexAttribute(unsigned int index); // Enable vertex attribute index
377
+ void rlDisableVertexAttribute(unsigned int index); // Disable vertex attribute index
378
+ void rlEnableStatePointer(int vertexAttribType, void *buffer); // Enable attribute state pointer
379
+ void rlDisableStatePointer(int vertexAttribType); // Disable attribute state pointer
380
+ // Textures state
381
+ void rlActiveTextureSlot(int slot); // Select and active a texture slot
382
+ void rlEnableTexture(unsigned int id); // Enable texture
383
+ void rlDisableTexture(void); // Disable texture
384
+ void rlEnableTextureCubemap(unsigned int id); // Enable texture cubemap
385
+ void rlDisableTextureCubemap(void); // Disable texture cubemap
386
+ void rlTextureParameters(unsigned int id, int param, int value); // Set texture parameters (filter, wrap)
387
+ void rlCubemapParameters(unsigned int id, int param, int value); // Set cubemap parameters (filter, wrap)
388
+ // Shader state
389
+ void rlEnableShader(unsigned int id); // Enable shader program
390
+ void rlDisableShader(void); // Disable shader program
391
+ // Framebuffer state
392
+ void rlEnableFramebuffer(unsigned int id); // Enable render texture (fbo)
393
+ void rlDisableFramebuffer(void); // Disable render texture (fbo), return to default framebuffer
394
+ unsigned int rlGetActiveFramebuffer(void); // Get the currently active render texture (fbo), 0 for default framebuffer
395
+ void rlActiveDrawBuffers(int count); // Activate multiple draw color buffers
396
+ void rlBlitFramebuffer(int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight, int bufferMask); // Blit active framebuffer to main framebuffer
397
+ void rlBindFramebuffer(unsigned int target, unsigned int framebuffer); // Bind framebuffer (FBO)
398
+ // General render state
399
+ void rlEnableColorBlend(void); // Enable color blending
400
+ void rlDisableColorBlend(void); // Disable color blending
401
+ void rlEnableDepthTest(void); // Enable depth test
402
+ void rlDisableDepthTest(void); // Disable depth test
403
+ void rlEnableDepthMask(void); // Enable depth write
404
+ void rlDisableDepthMask(void); // Disable depth write
405
+ void rlEnableBackfaceCulling(void); // Enable backface culling
406
+ void rlDisableBackfaceCulling(void); // Disable backface culling
407
+ void rlColorMask(bool r, bool g, bool b, bool a); // Color mask control
408
+ void rlSetCullFace(int mode); // Set face culling mode
409
+ void rlEnableScissorTest(void); // Enable scissor test
410
+ void rlDisableScissorTest(void); // Disable scissor test
411
+ void rlScissor(int x, int y, int width, int height); // Scissor test
412
+ void rlEnablePointMode(void); // Enable point mode
413
+ void rlDisablePointMode(void); // Disable point mode
414
+ void rlSetPointSize(float size); // Set the point drawing size
415
+ float rlGetPointSize(void); // Get the point drawing size
416
+ void rlEnableWireMode(void); // Enable wire mode
417
+ void rlDisableWireMode(void); // Disable wire mode
418
+ void rlSetLineWidth(float width); // Set the line drawing width
419
+ float rlGetLineWidth(void); // Get the line drawing width
420
+ void rlEnableSmoothLines(void); // Enable line aliasing
421
+ void rlDisableSmoothLines(void); // Disable line aliasing
422
+ void rlEnableStereoRender(void); // Enable stereo rendering
423
+ void rlDisableStereoRender(void); // Disable stereo rendering
424
+ bool rlIsStereoRenderEnabled(void); // Check if stereo render is enabled
425
+ void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned char a); // Clear color buffer with color
426
+ void rlClearScreenBuffers(void); // Clear used screen buffers (color and depth)
427
+ void rlCheckErrors(void); // Check and log OpenGL error codes
428
+ void rlSetBlendMode(int mode); // Set blending mode
429
+ void rlSetBlendFactors(int glSrcFactor, int glDstFactor, int glEquation); // Set blending mode factor and equation (using OpenGL factors)
430
+ void rlSetBlendFactorsSeparate(int glSrcRGB, int glDstRGB, int glSrcAlpha, int glDstAlpha, int glEqRGB, int glEqAlpha); // Set blending mode factors and equations separately (using OpenGL factors)
431
+ //------------------------------------------------------------------------------------
432
+ // Functions Declaration - rlgl functionality
433
+ //------------------------------------------------------------------------------------
434
+ // rlgl initialization functions
435
+ void rlglInit(int width, int height); // Initialize rlgl (buffers, shaders, textures, states)
436
+ void rlglClose(void); // De-initialize rlgl (buffers, shaders, textures)
437
+ void rlLoadExtensions(void *loader); // Load OpenGL extensions (loader function required)
438
+ void *rlGetProcAddress(const char *procName); // Get OpenGL procedure address
439
+ int rlGetVersion(void); // Get current OpenGL version
440
+ void rlSetFramebufferWidth(int width); // Set current framebuffer width
441
+ int rlGetFramebufferWidth(void); // Get default framebuffer width
442
+ void rlSetFramebufferHeight(int height); // Set current framebuffer height
443
+ int rlGetFramebufferHeight(void); // Get default framebuffer height
444
+ unsigned int rlGetTextureIdDefault(void); // Get default texture id
445
+ unsigned int rlGetShaderIdDefault(void); // Get default shader id
446
+ int *rlGetShaderLocsDefault(void); // Get default shader locations
447
+ // Render batch management
448
+ // NOTE: rlgl provides a default render batch to behave like OpenGL 1.1 immediate mode
449
+ // but this render batch API is exposed in case of custom batches are required
450
+ rlRenderBatch rlLoadRenderBatch(int numBuffers, int bufferElements); // Load a render batch system
451
+ void rlUnloadRenderBatch(rlRenderBatch batch); // Unload render batch system
452
+ void rlDrawRenderBatch(rlRenderBatch *batch); // Draw render batch data (Update->Draw->Reset)
453
+ void rlSetRenderBatchActive(rlRenderBatch *batch); // Set the active render batch for rlgl (NULL for default internal)
454
+ void rlDrawRenderBatchActive(void); // Update and draw internal render batch
455
+ bool rlCheckRenderBatchLimit(int vCount); // Check internal buffer overflow for a given number of vertex
456
+ void rlSetTexture(unsigned int id); // Set current texture for render batch and check buffers limits
457
+ //------------------------------------------------------------------------------------------------------------------------
458
+ // Vertex buffers management
459
+ unsigned int rlLoadVertexArray(void); // Load vertex array (vao) if supported
460
+ unsigned int rlLoadVertexBuffer(const void *buffer, int size, bool dynamic); // Load a vertex buffer object
461
+ unsigned int rlLoadVertexBufferElement(const void *buffer, int size, bool dynamic); // Load vertex buffer elements object
462
+ void rlUpdateVertexBuffer(unsigned int bufferId, const void *data, int dataSize, int offset); // Update vertex buffer object data on GPU buffer
463
+ void rlUpdateVertexBufferElements(unsigned int id, const void *data, int dataSize, int offset); // Update vertex buffer elements data on GPU buffer
464
+ void rlUnloadVertexArray(unsigned int vaoId); // Unload vertex array (vao)
465
+ void rlUnloadVertexBuffer(unsigned int vboId); // Unload vertex buffer object
466
+ void rlSetVertexAttribute(unsigned int index, int compSize, int type, bool normalized, int stride, int offset); // Set vertex attribute data configuration
467
+ void rlSetVertexAttributeDivisor(unsigned int index, int divisor); // Set vertex attribute data divisor
468
+ void rlSetVertexAttributeDefault(int locIndex, const void *value, int attribType, int count); // Set vertex attribute default value, when attribute to provided
469
+ void rlDrawVertexArray(int offset, int count); // Draw vertex array (currently active vao)
470
+ void rlDrawVertexArrayElements(int offset, int count, const void *buffer); // Draw vertex array elements
471
+ void rlDrawVertexArrayInstanced(int offset, int count, int instances); // Draw vertex array (currently active vao) with instancing
472
+ void rlDrawVertexArrayElementsInstanced(int offset, int count, const void *buffer, int instances); // Draw vertex array elements with instancing
473
+ // Textures management
474
+ unsigned int rlLoadTexture(const void *data, int width, int height, int format, int mipmapCount); // Load texture data
475
+ unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer); // Load depth texture/renderbuffer (to be attached to fbo)
476
+ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mipmapCount); // Load texture cubemap data
477
+ void rlUpdateTexture(unsigned int id, int offsetX, int offsetY, int width, int height, int format, const void *data); // Update texture with new data on GPU
478
+ void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned int *glFormat, unsigned int *glType); // Get OpenGL internal formats
479
+ const char *rlGetPixelFormatName(unsigned int format); // Get name string for pixel format
480
+ void rlUnloadTexture(unsigned int id); // Unload texture from GPU memory
481
+ void rlGenTextureMipmaps(unsigned int id, int width, int height, int format, int *mipmaps); // Generate mipmap data for selected texture
482
+ void *rlReadTexturePixels(unsigned int id, int width, int height, int format); // Read texture pixel data
483
+ unsigned char *rlReadScreenPixels(int width, int height); // Read screen pixel data (color buffer)
484
+ // Framebuffer management (fbo)
485
+ unsigned int rlLoadFramebuffer(void); // Load an empty framebuffer
486
+ void rlFramebufferAttach(unsigned int fboId, unsigned int texId, int attachType, int texType, int mipLevel); // Attach texture/renderbuffer to a framebuffer
487
+ bool rlFramebufferComplete(unsigned int id); // Verify framebuffer is complete
488
+ void rlUnloadFramebuffer(unsigned int id); // Delete framebuffer from GPU
489
+ // WARNING: Copy and resize framebuffer functionality only defined for software backend
490
+ void rlCopyFramebuffer(int x, int y, int width, int height, int format, void *pixels); // Copy framebuffer pixel data to internal buffer
491
+ void rlResizeFramebuffer(int width, int height); // Resize internal framebuffer
492
+ // Shaders management
493
+ unsigned int rlLoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings
494
+ unsigned int rlCompileShader(const char *shaderCode, int type); // Compile custom shader and return shader id (type: RL_VERTEX_SHADER, RL_FRAGMENT_SHADER, RL_COMPUTE_SHADER)
495
+ unsigned int rlLoadShaderProgram(unsigned int vShaderId, unsigned int fShaderId); // Load custom shader program
496
+ void rlUnloadShaderProgram(unsigned int id); // Unload shader program
497
+ int rlGetLocationUniform(unsigned int shaderId, const char *uniformName); // Get shader location uniform, requires shader program id
498
+ int rlGetLocationAttrib(unsigned int shaderId, const char *attribName); // Get shader location attribute, requires shader program id
499
+ void rlSetUniform(int locIndex, const void *value, int uniformType, int count); // Set shader value uniform
500
+ void rlSetUniformMatrix(int locIndex, Matrix mat); // Set shader value matrix
501
+ void rlSetUniformMatrices(int locIndex, const Matrix *mat, int count); // Set shader value matrices
502
+ void rlSetUniformSampler(int locIndex, unsigned int textureId); // Set shader value sampler
503
+ void rlSetShader(unsigned int id, int *locs); // Set shader currently active (id and locations)
504
+ // Compute shader management
505
+ unsigned int rlLoadComputeShaderProgram(unsigned int shaderId); // Load compute shader program
506
+ void rlComputeShaderDispatch(unsigned int groupX, unsigned int groupY, unsigned int groupZ); // Dispatch compute shader (equivalent to *draw* for graphics pipeline)
507
+ // Shader buffer storage object management (ssbo)
508
+ unsigned int rlLoadShaderBuffer(unsigned int size, const void *data, int usageHint); // Load shader storage buffer object (SSBO)
509
+ void rlUnloadShaderBuffer(unsigned int ssboId); // Unload shader storage buffer object (SSBO)
510
+ void rlUpdateShaderBuffer(unsigned int id, const void *data, unsigned int dataSize, unsigned int offset); // Update SSBO buffer data
511
+ void rlBindShaderBuffer(unsigned int id, unsigned int index); // Bind SSBO buffer
512
+ void rlReadShaderBuffer(unsigned int id, void *dest, unsigned int count, unsigned int offset); // Read SSBO buffer data (GPU->CPU)
513
+ void rlCopyShaderBuffer(unsigned int destId, unsigned int srcId, unsigned int destOffset, unsigned int srcOffset, unsigned int count); // Copy SSBO data between buffers
514
+ unsigned int rlGetShaderBufferSize(unsigned int id); // Get SSBO buffer size
515
+ // Buffer management
516
+ void rlBindImageTexture(unsigned int id, unsigned int index, int format, bool readonly); // Bind image texture
517
+ // Matrix state management
518
+ Matrix rlGetMatrixModelview(void); // Get internal modelview matrix
519
+ Matrix rlGetMatrixProjection(void); // Get internal projection matrix
520
+ Matrix rlGetMatrixTransform(void); // Get internal accumulated transform matrix
521
+ Matrix rlGetMatrixProjectionStereo(int eye); // Get internal projection matrix for stereo render (selected eye)
522
+ Matrix rlGetMatrixViewOffsetStereo(int eye); // Get internal view offset matrix for stereo render (selected eye)
523
+ void rlSetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
524
+ void rlSetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
525
+ void rlSetMatrixProjectionStereo(Matrix right, Matrix left); // Set eyes projection matrices for stereo rendering
526
+ void rlSetMatrixViewOffsetStereo(Matrix right, Matrix left); // Set eyes view offsets matrices for stereo rendering
527
+ // Quick and dirty cube/quad buffers load->draw->unload
528
+ void rlLoadDrawCube(void); // Load and draw a cube
529
+ void rlLoadDrawQuad(void); // Load and draw a quad
530
+ /***********************************************************************************
531
+ *
532
+ * RLGL IMPLEMENTATION
533
+ *
534
+ ************************************************************************************/
raylib/version.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "5.6.0.0-dev1"