Debian Codegraph @

src/config.h

raw symbols SCIP
1 /**********************************************************************************************
2 *
3 * raylib configuration flags
4 *
5 * This file defines the configuration flags for different raylib features per-module
6 *
7 * NOTE: Additional values are configured per-module and can be set on compile time
8 *
9 * LICENSE: zlib/libpng
10 *
11 * Copyright (c) 2018-2026 Ahmad Fatoum and Ramon Santamaria (@raysan5)
12 *
13 * This software is provided "as-is", without any express or implied warranty. In no event
14 * will the authors be held liable for any damages arising from the use of this software.
15 *
16 * Permission is granted to anyone to use this software for any purpose, including commercial
17 * applications, and to alter it and redistribute it freely, subject to the following restrictions:
18 *
19 * 1. The origin of this software must not be misrepresented; you must not claim that you
20 * wrote the original software. If you use this software in a product, an acknowledgment
21 * in the product documentation would be appreciated but is not required.
22 *
23 * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
24 * as being the original software.
25 *
26 * 3. This notice may not be removed or altered from any source distribution.
27 *
28 **********************************************************************************************/
29
30 #ifndef CONFIG_H
31 #define CONFIG_H
32
33 #if !defined(EXTERNAL_CONFIG_FLAGS)
34
35 //------------------------------------------------------------------------------------
36 // Module selection - Some modules could be avoided
37 // Mandatory modules: rcore, rlgl
38 //------------------------------------------------------------------------------------
39 #ifndef SUPPORT_MODULE_RSHAPES
40 #define SUPPORT_MODULE_RSHAPES 1
41 #endif
42 #ifndef SUPPORT_MODULE_RTEXTURES
43 #define SUPPORT_MODULE_RTEXTURES 1
44 #endif
45 #ifndef SUPPORT_MODULE_RTEXT
46 #define SUPPORT_MODULE_RTEXT 1 // WARNING: It requires SUPPORT_MODULE_RTEXTURES to load sprite font textures
47 #endif
48 #ifndef SUPPORT_MODULE_RMODELS
49 #define SUPPORT_MODULE_RMODELS 1
50 #endif
51 #ifndef SUPPORT_MODULE_RAUDIO
52 #define SUPPORT_MODULE_RAUDIO 1
53 #endif
54
55 //------------------------------------------------------------------------------------
56 // Module: rcore - Configuration Flags
57 //------------------------------------------------------------------------------------
58 #ifndef SUPPORT_TRACELOG
59 // Show TRACELOG() output messages
60 #define SUPPORT_TRACELOG 1
61 #endif
62 #ifndef SUPPORT_CAMERA_SYSTEM
63 // Camera module is included (rcamera.h) and multiple predefined
64 // cameras are available: free, 1st/3rd person, orbital
65 #define SUPPORT_CAMERA_SYSTEM 1
66 #endif
67 #ifndef SUPPORT_GESTURES_SYSTEM
68 // Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag
69 #define SUPPORT_GESTURES_SYSTEM 1
70 #endif
71 #ifndef SUPPORT_RPRAND_GENERATOR
72 // Include pseudo-random numbers generator (rprand.h), based on Xoshiro128** and SplitMix64
73 #define SUPPORT_RPRAND_GENERATOR 1
74 #endif
75 #ifndef SUPPORT_MOUSE_GESTURES
76 // Mouse gestures are directly mapped like touches and processed by the gestures system
77 #define SUPPORT_MOUSE_GESTURES 1
78 #endif
79 #ifndef SUPPORT_SSH_KEYBOARD_RPI
80 // Reconfigure standard input to receive key inputs, works with SSH connection
81 #define SUPPORT_SSH_KEYBOARD_RPI 1
82 #endif
83 #ifndef SUPPORT_WINMM_HIGHRES_TIMER
84 // Setting a higher resolution can improve the accuracy of time-out intervals in wait functions
85 // However, it can also reduce overall system performance, because the thread scheduler switches tasks more often
86 #define SUPPORT_WINMM_HIGHRES_TIMER 1
87 #endif
88 #if !SUPPORT_BUSY_WAIT_LOOP && !SUPPORT_PARTIALBUSY_WAIT_LOOP
89 // Use busy wait loop for timing sync, if not defined, a high-resolution timer is set up and used
90 #define SUPPORT_BUSY_WAIT_LOOP 0 // Disabled by default
91 #endif
92 #if !SUPPORT_PARTIALBUSY_WAIT_LOOP && !SUPPORT_BUSY_WAIT_LOOP
93 // Use a partial-busy wait loop, in this case frame sleeps for most of the time,
94 // but then runs a busy loop at the end for accuracy
95 #define SUPPORT_PARTIALBUSY_WAIT_LOOP 1
96 #endif
97 #ifndef SUPPORT_SCREEN_CAPTURE
98 // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()
99 // WARNING: It requires SUPPORT_FILEFORMAT_PNG flag
100 #define SUPPORT_SCREEN_CAPTURE 1
101 #endif
102 #ifndef SUPPORT_COMPRESSION_API
103 // Support CompressData() and DecompressData() functions
104 #define SUPPORT_COMPRESSION_API 1
105 #endif
106 #ifndef SUPPORT_AUTOMATION_EVENTS
107 // Support automatic generated events, loading and recording of those events when required
108 #define SUPPORT_AUTOMATION_EVENTS 1
109 #endif
110 #ifndef SUPPORT_CUSTOM_FRAME_CONTROL
111 // Support custom frame control, only for advanced users
112 // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timing + PollInputEvents()
113 // Enabling this flag allows manual control of the frame processes, use at your own risk
114 #define SUPPORT_CUSTOM_FRAME_CONTROL 0 // Disabled by default
115 #endif
116 #ifndef SUPPORT_CLIPBOARD_IMAGE
117 // Support for clipboard image loading
118 // NOTE: Only working on SDL3, GLFW (Windows) and RGFW (Windows)
119 // WARNING: It requires support for some additional flags:
120 // - SUPPORT_MODULE_RTEXTURES
121 // - SUPPORT_FILEFORMAT_BMP (Windows clipboard)
122 // - SUPPORT_FILEFORMAT_PNG (Wayland clipboard)
123 // - SUPPORT_FILEFORMAT_JPG
124 #define SUPPORT_CLIPBOARD_IMAGE 1
125 #endif
126
127 // rcore: Configuration values
128 // NOTE: Below values are already defined inside [rcore.c] so there is no need to be
129 // redefined here, in case it must be done, uncomment the required line and update
130 // the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
131 //------------------------------------------------------------------------------------
132 //#define MAX_TRACELOG_MSG_LENGTH 256 // Max length of one trace-log message
133 //#define MAX_FILEPATH_CAPACITY 8192 // Maximum file paths capacity
134 //#define MAX_FILEPATH_LENGTH 4096 // Maximum length for filepaths (Linux PATH_MAX default value)
135 //#define MAX_KEYBOARD_KEYS 512 // Maximum number of keyboard keys supported
136 //#define MAX_MOUSE_BUTTONS 8 // Maximum number of mouse buttons supported
137 //#define MAX_GAMEPADS 4 // Maximum number of gamepads supported
138 //#define MAX_GAMEPAD_AXES 8 // Maximum number of axes supported (per gamepad)
139 //#define MAX_GAMEPAD_BUTTONS 32 // Maximum number of buttons supported (per gamepad)
140 //#define MAX_GAMEPAD_VIBRATION_TIME 2.0f // Maximum vibration time in seconds
141 //#define MAX_TOUCH_POINTS 10 // Maximum number of touch points supported
142 //#define MAX_KEY_PRESSED_QUEUE 16 // Maximum number of keys in the key input queue
143 //#define MAX_CHAR_PRESSED_QUEUE 16 // Maximum number of characters in the char input queue
144 //#define MAX_DECOMPRESSION_SIZE 64 // Max size allocated for decompression in MB
145 //#define MAX_AUTOMATION_EVENTS 16384 // Maximum number of automation events to record
146 //------------------------------------------------------------------------------------
147
148 //------------------------------------------------------------------------------------
149 // Module: rlgl - Configuration values
150 //------------------------------------------------------------------------------------
151 #ifndef RLGL_ENABLE_OPENGL_DEBUG_CONTEXT
152 // Request OpenGL debug context (only available on OpenGL 4.3)
153 #define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT 0
154 #endif
155 #ifndef RLGL_SHOW_GL_DETAILS_INFO
156 // Show OpenGL detailed info on initialization,
157 // supported GL extensions and GL capabilities
158 #define RLGL_SHOW_GL_DETAILS_INFO 0
159 #endif
160
161 // rlgl: Configuration values
162 // NOTE: Below values are already defined inside [rlgl.h] so there is no need to be
163 // redefined here, in case it must be done, uncomment the required line and update
164 // the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
165 //------------------------------------------------------------------------------------
166 //#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096 // Default internal render batch elements limits
167 //#define RL_DEFAULT_BATCH_BUFFERS 1 // Default number of batch buffers (multi-buffering)
168 //#define RL_DEFAULT_BATCH_DRAWCALLS 256 // Default number of batch draw calls (by state changes: mode, texture)
169 //#define RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS 4 // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
170 //#define RL_MAX_MATRIX_STACK_SIZE 32 // Maximum size of internal Matrix stack
171 //#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
172 //#define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance
173 //#define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance
174
175 // Default shader vertex attribute locations
176 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0
177 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1
178 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2
179 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3
180 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4
181 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5
182 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INDICES 6
183 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES 7
184 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS 8
185 //#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM 9
186
187 // Default shader vertex attribute/uniform names to set location points
188 // NOTE: When a new shader is loaded, locations are tried to be set for convenience, looking for the names defined here
189 // In case custom shader names are used, it's up to the user to set locations with GetShaderLocation*() functions
190 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION
191 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD
192 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL
193 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR
194 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT
195 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2
196 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEINDICES "vertexBoneIndices" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEINDICES
197 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_BONEWEIGHTS "vertexBoneWeights" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_BONEWEIGHTS
198 //#define RL_DEFAULT_SHADER_ATTRIB_NAME_INSTANCETRANSFORM "instanceTransform" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_INSTANCETRANSFORM
199 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
200 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix
201 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION "matProjection" // projection matrix
202 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL "matModel" // model matrix
203 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL "matNormal" // normal matrix (transpose(inverse(matModelView))
204 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR "colDiffuse" // color diffuse (tint color, multiplied by texture color)
205 //#define RL_DEFAULT_SHADER_UNIFORM_NAME_BONEMATRICES "boneMatrices" // bone matrices
206 //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 "texture0" // texture0 (texture slot active 0)
207 //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 "texture1" // texture1 (texture slot active 1)
208 //#define RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 "texture2" // texture2 (texture slot active 2)
209 //------------------------------------------------------------------------------------
210
211 //------------------------------------------------------------------------------------
212 // Module: rshapes - Configuration Flags
213 //------------------------------------------------------------------------------------
214 #ifndef SUPPORT_QUADS_DRAW_MODE
215 // Use QUADS instead of TRIANGLES for drawing when possible
216 // Some lines-based shapes could still use lines
217 #define SUPPORT_QUADS_DRAW_MODE 1
218 #endif
219
220 //------------------------------------------------------------------------------------
221 // Module: rtextures - Configuration Flags
222 //------------------------------------------------------------------------------------
223 // Selected desired fileformats to be supported for image data loading
224 #ifndef SUPPORT_FILEFORMAT_PNG
225 #define SUPPORT_FILEFORMAT_PNG 1
226 #endif
227 #ifndef SUPPORT_FILEFORMAT_BMP
228 // NOTE: BMP support required for clipboard images on Windows
229 #define SUPPORT_FILEFORMAT_BMP 1
230 #endif
231 #ifndef SUPPORT_FILEFORMAT_TGA
232 #define SUPPORT_FILEFORMAT_TGA 0 // Disabled by default
233 #endif
234 #ifndef SUPPORT_FILEFORMAT_JPG
235 #define SUPPORT_FILEFORMAT_JPG 0 // Disabled by default
236 #endif
237 #ifndef SUPPORT_FILEFORMAT_GIF
238 #define SUPPORT_FILEFORMAT_GIF 1
239 #endif
240 #ifndef SUPPORT_FILEFORMAT_QOI
241 #define SUPPORT_FILEFORMAT_QOI 1
242 #endif
243 #ifndef SUPPORT_FILEFORMAT_PSD
244 #define SUPPORT_FILEFORMAT_PSD 0 // Disabled by default
245 #endif
246 #ifndef SUPPORT_FILEFORMAT_DDS
247 #define SUPPORT_FILEFORMAT_DDS 1
248 #endif
249 #ifndef SUPPORT_FILEFORMAT_HDR
250 #define SUPPORT_FILEFORMAT_HDR 0 // Disabled by default
251 #endif
252 #ifndef SUPPORT_FILEFORMAT_PIC
253 #define SUPPORT_FILEFORMAT_PIC 0 // Disabled by default
254 #endif
255 #ifndef SUPPORT_FILEFORMAT_PNM
256 #define SUPPORT_FILEFORMAT_PNM 0 // Disabled by default
257 #endif
258 #ifndef SUPPORT_FILEFORMAT_KTX
259 #define SUPPORT_FILEFORMAT_KTX 0 // Disabled by default
260 #endif
261 #ifndef SUPPORT_FILEFORMAT_ASTC
262 #define SUPPORT_FILEFORMAT_ASTC 0 // Disabled by default
263 #endif
264 #ifndef SUPPORT_FILEFORMAT_PKM
265 #define SUPPORT_FILEFORMAT_PKM 0 // Disabled by default
266 #endif
267 #ifndef SUPPORT_FILEFORMAT_PVR
268 #define SUPPORT_FILEFORMAT_PVR 0 // Disabled by default
269 #endif
270
271 #ifndef SUPPORT_IMAGE_EXPORT
272 // Support image export functionality (.png, .bmp, .tga, .jpg, .qoi)
273 // NOTE: Image export requires stb_image_write.h library
274 #define SUPPORT_IMAGE_EXPORT 1
275 #endif
276 #ifndef SUPPORT_IMAGE_GENERATION
277 // Support procedural image generation functionality: gradient, spot, perlin-noise, cellular...
278 // NOTE: Perlin noise requires stb_perlin.h library
279 #define SUPPORT_IMAGE_GENERATION 1
280 #endif
281
282 //------------------------------------------------------------------------------------
283 // Module: rtext - Configuration Flags
284 //------------------------------------------------------------------------------------
285 // Selected desired font fileformats to be supported for loading
286 #ifndef SUPPORT_FILEFORMAT_TTF
287 #define SUPPORT_FILEFORMAT_TTF 1
288 #endif
289 #ifndef SUPPORT_FILEFORMAT_FNT
290 #define SUPPORT_FILEFORMAT_FNT 1
291 #endif
292 #ifndef SUPPORT_FILEFORMAT_BDF
293 #define SUPPORT_FILEFORMAT_BDF 0 // Disabled by default
294 #endif
295
296 //------------------------------------------------------------------------------------
297 // Module: rmodels - Configuration Flags
298 //------------------------------------------------------------------------------------
299 // Selected desired model fileformats to be supported for loading
300 #ifndef SUPPORT_FILEFORMAT_OBJ
301 #define SUPPORT_FILEFORMAT_OBJ 1
302 #endif
303 #ifndef SUPPORT_FILEFORMAT_MTL
304 #define SUPPORT_FILEFORMAT_MTL 1
305 #endif
306 #ifndef SUPPORT_FILEFORMAT_IQM
307 #define SUPPORT_FILEFORMAT_IQM 1
308 #endif
309 #ifndef SUPPORT_FILEFORMAT_GLTF
310 #define SUPPORT_FILEFORMAT_GLTF 1
311 #endif
312 #ifndef SUPPORT_FILEFORMAT_VOX
313 #define SUPPORT_FILEFORMAT_VOX 1
314 #endif
315 #ifndef SUPPORT_FILEFORMAT_M3D
316 #define SUPPORT_FILEFORMAT_M3D 1
317 #endif
318 #ifndef SUPPORT_MESH_GENERATION
319 // Support procedural mesh generation functions, uses external par_shapes.h library
320 // NOTE: Some generated meshes DO NOT include generated texture coordinates
321 #define SUPPORT_MESH_GENERATION 1
322 #endif
323 #ifndef SUPPORT_GPU_SKINNING
324 // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs
325 #define SUPPORT_GPU_SKINNING 0
326 #endif
327
328 //------------------------------------------------------------------------------------
329 // Module: raudio - Configuration Flags
330 //------------------------------------------------------------------------------------
331 // Desired audio fileformats to be supported for loading
332 #ifndef SUPPORT_FILEFORMAT_WAV
333 #define SUPPORT_FILEFORMAT_WAV 1
334 #endif
335 #ifndef SUPPORT_FILEFORMAT_OGG
336 #define SUPPORT_FILEFORMAT_OGG 1
337 #endif
338 #ifndef SUPPORT_FILEFORMAT_MP3
339 #define SUPPORT_FILEFORMAT_MP3 1
340 #endif
341 #ifndef SUPPORT_FILEFORMAT_QOA
342 #define SUPPORT_FILEFORMAT_QOA 1
343 #endif
344 #ifndef SUPPORT_FILEFORMAT_FLAC
345 #define SUPPORT_FILEFORMAT_FLAC 0 // Disabled by default
346 #endif
347 #ifndef SUPPORT_FILEFORMAT_XM
348 #define SUPPORT_FILEFORMAT_XM 1
349 #endif
350 #ifndef SUPPORT_FILEFORMAT_MOD
351 #define SUPPORT_FILEFORMAT_MOD 1
352 #endif
353
354 // raudio: Configuration values
355 // NOTE: Below values are already defined inside [rlgl.h] so there is no need to be
356 // redefined here, in case it must be done, uncomment the required line and update
357 // the value; it can also be done on compilation with -DVALUE_TO_REDEFINE=128
358 //------------------------------------------------------------------------------------
359 //#define AUDIO_DEVICE_FORMAT ma_format_f32 // Device output format (miniaudio: float-32bit)
360 //#define AUDIO_DEVICE_CHANNELS 2 // Device output channels: stereo
361 //#define AUDIO_DEVICE_SAMPLE_RATE 0 // Device sample rate (device default)
362 //#define AUDIO_DEVICE_PERIOD_SIZE_IN_FRAMES 0 // Device period size (controls latency, 0 defaults to 10ms)
363 //#define MAX_AUDIO_BUFFER_POOL_CHANNELS 16 // Maximum number of audio pool channels
364 //------------------------------------------------------------------------------------
365 #endif // !EXTERNAL_CONFIG_FLAGS
366
367 // NOTE: Following macro depends on config flag that can
368 // be externally defined, so, it needs to be outside EXTERNAL_CONFIG_FLAGS
369 #if SUPPORT_TRACELOG
370 #define TRACELOG(level, ...) TraceLog(level, __VA_ARGS__)
371 #else
372 #define TRACELOG(level, ...) (void)0
373 #endif
374
375 #endif // CONFIG_H