raylib_config.d 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. module raylib_config;
  2. /**********************************************************************************************
  3. *
  4. * raylib configuration flags
  5. *
  6. * This file defines all the configuration flags for the different raylib modules
  7. *
  8. * LICENSE: zlib/libpng
  9. *
  10. * Copyright (c) 2018-2021 Ahmad Fatoum & Ramon Santamaria (@raysan5)
  11. *
  12. * This software is provided "as-is", without any express or implied warranty. In no event
  13. * will the authors be held liable for any damages arising from the use of this software.
  14. *
  15. * Permission is granted to anyone to use this software for any purpose, including commercial
  16. * applications, and to alter it and redistribute it freely, subject to the following restrictions:
  17. *
  18. * 1. The origin of this software must not be misrepresented; you must not claim that you
  19. * wrote the original software. If you use this software in a product, an acknowledgment
  20. * in the product documentation would be appreciated but is not required.
  21. *
  22. * 2. Altered source versions must be plainly marked as such, and must not be misrepresented
  23. * as being the original software.
  24. *
  25. * 3. This notice may not be removed or altered from any source distribution.
  26. *
  27. **********************************************************************************************/
  28. extern (C) @nogc nothrow:
  29. //------------------------------------------------------------------------------------
  30. // Module: core - Configuration Flags
  31. //------------------------------------------------------------------------------------
  32. // Camera module is included (rcamera.h) and multiple predefined cameras are available: free, 1st/3rd person, orbital
  33. enum SUPPORT_CAMERA_SYSTEM = 1;
  34. // Gestures module is included (rgestures.h) to support gestures detection: tap, hold, swipe, drag
  35. enum SUPPORT_GESTURES_SYSTEM = 1;
  36. // Mouse gestures are directly mapped like touches and processed by gestures system
  37. enum SUPPORT_MOUSE_GESTURES = 1;
  38. // Reconfigure standard input to receive key inputs, works with SSH connection.
  39. enum SUPPORT_SSH_KEYBOARD_RPI = 1;
  40. // Draw a mouse pointer on screen
  41. //#define SUPPORT_MOUSE_CURSOR_POINT 1
  42. // Setting a higher resolution can improve the accuracy of time-out intervals in wait functions.
  43. // However, it can also reduce overall system performance, because the thread scheduler switches tasks more often.
  44. enum SUPPORT_WINMM_HIGHRES_TIMER = 1;
  45. // Use busy wait loop for timing sync, if not defined, a high-resolution timer is setup and used
  46. //#define SUPPORT_BUSY_WAIT_LOOP 1
  47. // Use a partial-busy wait loop, in this case frame sleeps for most of the time, but then runs a busy loop at the end for accuracy
  48. // Wait for events passively (sleeping while no events) instead of polling them actively every frame
  49. //#define SUPPORT_EVENTS_WAITING 1
  50. // Allow automatic screen capture of current screen pressing F12, defined in KeyCallback()
  51. enum SUPPORT_SCREEN_CAPTURE = 1;
  52. // Allow automatic gif recording of current screen pressing CTRL+F12, defined in KeyCallback()
  53. enum SUPPORT_GIF_RECORDING = 1;
  54. // Support CompressData() and DecompressData() functions
  55. enum SUPPORT_COMPRESSION_API = 1;
  56. // Support saving binary data automatically to a generated storage.data file. This file is managed internally.
  57. enum SUPPORT_DATA_STORAGE = 1;
  58. // Support automatic generated events, loading and recording of those events when required
  59. //#define SUPPORT_EVENTS_AUTOMATION 1
  60. // Support custom frame control, only for advance users
  61. // By default EndDrawing() does this job: draws everything + SwapScreenBuffer() + manage frame timming + PollInputEvents()
  62. // Enabling this flag allows manual control of the frame processes, use at your own risk
  63. //#define SUPPORT_CUSTOM_FRAME_CONTROL 1
  64. // core: Configuration values
  65. //------------------------------------------------------------------------------------
  66. enum MAX_FILEPATH_LENGTH = 4096; // Maximum length for filepaths (Linux PATH_MAX default value)
  67. // Maximum length supported for filepaths
  68. enum MAX_GAMEPADS = 4; // Max number of gamepads supported
  69. enum MAX_GAMEPAD_AXIS = 8; // Max number of axis supported (per gamepad)
  70. enum MAX_GAMEPAD_BUTTONS = 32; // Max bumber of buttons supported (per gamepad)
  71. enum MAX_TOUCH_POINTS = 8; // Maximum number of touch points supported
  72. enum MAX_KEY_PRESSED_QUEUE = 16; // Max number of characters in the key input queue
  73. enum STORAGE_DATA_FILE = "storage.data"; // Automatic storage filename
  74. enum MAX_DECOMPRESSION_SIZE = 64; // Max size allocated for decompression in MB
  75. //------------------------------------------------------------------------------------
  76. // Module: rlgl - Configuration values
  77. //------------------------------------------------------------------------------------
  78. // Enable OpenGL Debug Context (only available on OpenGL 4.3)
  79. //#define RLGL_ENABLE_OPENGL_DEBUG_CONTEXT 1
  80. // Show OpenGL extensions and capabilities detailed logs on init
  81. //#define RLGL_SHOW_GL_DETAILS_INFO 1
  82. //#define RL_DEFAULT_BATCH_BUFFER_ELEMENTS 4096 // Default internal render batch elements limits
  83. enum RL_DEFAULT_BATCH_BUFFERS = 1; // Default number of batch buffers (multi-buffering)
  84. enum RL_DEFAULT_BATCH_DRAWCALLS = 256; // Default number of batch draw calls (by state changes: mode, texture)
  85. enum RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS = 4; // Maximum number of textures units that can be activated on batch drawing (SetShaderValueTexture())
  86. enum RL_MAX_MATRIX_STACK_SIZE = 32; // Maximum size of internal Matrix stack
  87. enum RL_MAX_SHADER_LOCATIONS = 32; // Maximum number of shader locations supported
  88. enum RL_CULL_DISTANCE_NEAR = 0.01; // Default projection matrix near cull distance
  89. enum RL_CULL_DISTANCE_FAR = 1000.0; // Default projection matrix far cull distance
  90. // Default shader vertex attribute names to set location points
  91. // NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
  92. enum RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION = "vertexPosition"; // Binded by default to shader location: 0
  93. enum RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD = "vertexTexCoord"; // Binded by default to shader location: 1
  94. enum RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL = "vertexNormal"; // Binded by default to shader location: 2
  95. enum RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR = "vertexColor"; // Binded by default to shader location: 3
  96. enum RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT = "vertexTangent"; // Binded by default to shader location: 4
  97. enum RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 = "vertexTexCoord2"; // Binded by default to shader location: 5
  98. enum RL_DEFAULT_SHADER_UNIFORM_NAME_MVP = "mvp"; // model-view-projection matrix
  99. enum RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW = "matView"; // view matrix
  100. enum RL_DEFAULT_SHADER_UNIFORM_NAME_PROJECTION = "matProjection"; // projection matrix
  101. enum RL_DEFAULT_SHADER_UNIFORM_NAME_MODEL = "matModel"; // model matrix
  102. enum RL_DEFAULT_SHADER_UNIFORM_NAME_NORMAL = "matNormal"; // normal matrix (transpose(inverse(matModelView))
  103. enum RL_DEFAULT_SHADER_UNIFORM_NAME_COLOR = "colDiffuse"; // color diffuse (base tint color, multiplied by texture color)
  104. enum RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE0 = "texture0"; // texture0 (texture slot active 0)
  105. enum RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE1 = "texture1"; // texture1 (texture slot active 1)
  106. enum RL_DEFAULT_SHADER_SAMPLER2D_NAME_TEXTURE2 = "texture2"; // texture2 (texture slot active 2)
  107. //------------------------------------------------------------------------------------
  108. // Module: shapes - Configuration Flags
  109. //------------------------------------------------------------------------------------
  110. // Use QUADS instead of TRIANGLES for drawing when possible
  111. // Some lines-based shapes could still use lines
  112. enum SUPPORT_QUADS_DRAW_MODE = 1;
  113. //------------------------------------------------------------------------------------
  114. // Module: textures - Configuration Flags
  115. //------------------------------------------------------------------------------------
  116. // Selecte desired fileformats to be supported for image data loading
  117. enum SUPPORT_FILEFORMAT_PNG = 1;
  118. //#define SUPPORT_FILEFORMAT_BMP 1
  119. //#define SUPPORT_FILEFORMAT_TGA 1
  120. //#define SUPPORT_FILEFORMAT_JPG 1
  121. enum SUPPORT_FILEFORMAT_GIF = 1;
  122. //#define SUPPORT_FILEFORMAT_PSD 1
  123. enum SUPPORT_FILEFORMAT_DDS = 1;
  124. enum SUPPORT_FILEFORMAT_HDR = 1;
  125. //#define SUPPORT_FILEFORMAT_KTX 1
  126. //#define SUPPORT_FILEFORMAT_ASTC 1
  127. //#define SUPPORT_FILEFORMAT_PKM 1
  128. //#define SUPPORT_FILEFORMAT_PVR 1
  129. // Support image export functionality (.png, .bmp, .tga, .jpg)
  130. enum SUPPORT_IMAGE_EXPORT = 1;
  131. // Support procedural image generation functionality (gradient, spot, perlin-noise, cellular)
  132. enum SUPPORT_IMAGE_GENERATION = 1;
  133. // Support multiple image editing functions to scale, adjust colors, flip, draw on images, crop...
  134. // If not defined, still some functions are supported: ImageFormat(), ImageCrop(), ImageToPOT()
  135. enum SUPPORT_IMAGE_MANIPULATION = 1;
  136. //------------------------------------------------------------------------------------
  137. // Module: text - Configuration Flags
  138. //------------------------------------------------------------------------------------
  139. // Default font is loaded on window initialization to be available for the user to render simple text
  140. // NOTE: If enabled, uses external module functions to load default raylib font
  141. enum SUPPORT_DEFAULT_FONT = 1;
  142. // Selected desired font fileformats to be supported for loading
  143. enum SUPPORT_FILEFORMAT_FNT = 1;
  144. enum SUPPORT_FILEFORMAT_TTF = 1;
  145. // Support text management functions
  146. // If not defined, still some functions are supported: TextLength(), TextFormat()
  147. enum SUPPORT_TEXT_MANIPULATION = 1;
  148. // text: Configuration values
  149. //------------------------------------------------------------------------------------
  150. enum MAX_TEXT_BUFFER_LENGTH = 1024; // Size of internal static buffers used on some functions:
  151. // TextFormat(), TextSubtext(), TextToUpper(), TextToLower(), TextToPascal(), TextSplit()
  152. enum MAX_TEXTSPLIT_COUNT = 128; // Maximum number of substrings to split: TextSplit()
  153. //------------------------------------------------------------------------------------
  154. // Module: models - Configuration Flags
  155. //------------------------------------------------------------------------------------
  156. // Selected desired model fileformats to be supported for loading
  157. enum SUPPORT_FILEFORMAT_OBJ = 1;
  158. enum SUPPORT_FILEFORMAT_MTL = 1;
  159. enum SUPPORT_FILEFORMAT_IQM = 1;
  160. enum SUPPORT_FILEFORMAT_GLTF = 1;
  161. enum SUPPORT_FILEFORMAT_VOX = 1;
  162. // Support procedural mesh generation functions, uses external par_shapes.h library
  163. // NOTE: Some generated meshes DO NOT include generated texture coordinates
  164. enum SUPPORT_MESH_GENERATION = 1;
  165. // models: Configuration values
  166. //------------------------------------------------------------------------------------
  167. enum MAX_MATERIAL_MAPS = 12; // Maximum number of shader maps supported
  168. enum MAX_MESH_VERTEX_BUFFERS = 7; // Maximum vertex buffers (VBO) per mesh
  169. //------------------------------------------------------------------------------------
  170. // Module: audio - Configuration Flags
  171. //------------------------------------------------------------------------------------
  172. // Desired audio fileformats to be supported for loading
  173. enum SUPPORT_FILEFORMAT_WAV = 1;
  174. enum SUPPORT_FILEFORMAT_OGG = 1;
  175. enum SUPPORT_FILEFORMAT_XM = 1;
  176. enum SUPPORT_FILEFORMAT_MOD = 1;
  177. enum SUPPORT_FILEFORMAT_MP3 = 1;
  178. //#define SUPPORT_FILEFORMAT_FLAC 1
  179. // audio: Configuration values
  180. //------------------------------------------------------------------------------------
  181. //enum AUDIO_DEVICE_FORMAT = ma_format_f32; // Device output format (miniaudio: float-32bit)
  182. enum AUDIO_DEVICE_CHANNELS = 2; // Device output channels: stereo
  183. enum AUDIO_DEVICE_SAMPLE_RATE = 0; // Device sample rate (device default)
  184. enum MAX_AUDIO_BUFFER_POOL_CHANNELS = 16; // Maximum number of audio pool channels
  185. //------------------------------------------------------------------------------------
  186. // Module: utils - Configuration Flags
  187. //------------------------------------------------------------------------------------
  188. // Standard file io library (stdio.h) included
  189. // Show TRACELOG() output messages
  190. // NOTE: By default LOG_DEBUG traces not shown
  191. enum SUPPORT_TRACELOG = 1;
  192. //#define SUPPORT_TRACELOG_DEBUG 1
  193. // utils: Configuration values
  194. //------------------------------------------------------------------------------------
  195. enum MAX_TRACELOG_MSG_LENGTH = 128; // Max length of one trace-log message