diff --git a/CONVENTIONS.md b/CONVENTIONS.md index b7ace0275..17c02e216 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -28,6 +28,10 @@ Some other conventions to follow: - **ALWAYS** initialize all defined variables. - **Do not use TABS**, use 4 spaces instead. - Avoid trailing spaces, please, avoid them + - Comments always start with space + capital letter and never end with a '.', place them **before** the line(s) they refer to +```c +// This is a comment in raylib or raylib examples +``` - Control flow statements always are followed **by a space**: ```c if (condition) value = 0; diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index fb36830ce..84c8963e3 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -108,8 +108,6 @@ int main(void) { // Update //---------------------------------------------------------------------------------- - - // Sample mouse input. mousePosition = GetMousePosition(); if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) @@ -125,7 +123,7 @@ int main(void) // Compute two cycles to allow the buffer padding, simplifying any modulation, resampling, etc. if (frequency != oldFrequency) { - // Compute wavelength. Limit size in both directions. + // Compute wavelength. Limit size in both directions //int oldWavelength = waveLength; waveLength = (int)(22050/frequency); if (waveLength > MAX_SAMPLES/2) waveLength = MAX_SAMPLES/2; diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index ed08f8e87..40af52f41 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -12,7 +12,7 @@ * 4. PollInputEvents() * * To avoid steps 2, 3 and 4, flag SUPPORT_CUSTOM_FRAME_CONTROL can be enabled in -* config.h (it requires recompiling raylib). This way those steps are up to the user. +* config.h (it requires recompiling raylib). This way those steps are up to the user * * Note that enabling this flag invalidates some functions: * - GetFrameTime() diff --git a/examples/core/core_smooth_pixelperfect.c b/examples/core/core_smooth_pixelperfect.c index 0bd82db43..697b2ff09 100644 --- a/examples/core/core_smooth_pixelperfect.c +++ b/examples/core/core_smooth_pixelperfect.c @@ -43,7 +43,8 @@ int main(void) Camera2D screenSpaceCamera = { 0 }; // Smoothing camera screenSpaceCamera.zoom = 1.0f; - RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight); // This is where we'll draw all our objects. + // Load render texture to draw all our objects + RenderTexture2D target = LoadRenderTexture(virtualScreenWidth, virtualScreenHeight); Rectangle rec01 = { 70.0f, 35.0f, 20.0f, 20.0f }; Rectangle rec02 = { 90.0f, 55.0f, 30.0f, 10.0f }; diff --git a/examples/examples_template.c b/examples/examples_template.c index 433fe57bd..2bb223a9c 100644 --- a/examples/examples_template.c +++ b/examples/examples_template.c @@ -6,30 +6,30 @@ 1. File naming: _ - Lower case filename, words separated by underscore, no more than 3-4 words in total to describe the example. referes to the primary - raylib module the example is more related with (code, shapes, textures, models, shaders, raudio). + raylib module the example is more related with (code, shapes, textures, models, shaders, raudio) i.e: core_input_multitouch, shapes_lines_bezier, shaders_palette_switch 2. Follow below template structure, example info should list the module, the short description - and the author of the example, twitter or github info could be also provided for the author. - Short description should also be used on the title of the window. + and the author of the example, twitter or github info could be also provided for the author + Short description should also be used on the title of the window 3. Code should be organized by sections:[Initialization]- [Update] - [Draw] - [De-Initialization] Place your code between the dotted lines for every section, please don't mix update logic with drawing - and remember to unload all loaded resources. + and remember to unload all loaded resources 4. Code should follow raylib conventions: https://github.com/raysan5/raylib/wiki/raylib-coding-conventions - Try to be very organized, using line-breaks appropiately. + Try to be very organized, using line-breaks appropiately - 5. Add comments to the specific parts of code the example is focus on. - Don't abuse with comments, try to be clear and impersonal on the comments. + 5. Add comments to the specific parts of code the example is focus on + Don't abuse with comments, try to be clear and impersonal on the comments - 6. Try to keep the example simple, under 300 code lines if possible. Try to avoid external dependencies. - Try to avoid defining functions outside the main(). Example should be as self-contained as possible. + 6. Try to keep the example simple, under 300 code lines if possible. Try to avoid external dependencies + Try to avoid defining functions outside the main(). Example should be as self-contained as possible 7. About external resources, they should be placed in a [resources] folder and those resources - should be open and free for use and distribution. Avoid propietary content. + should be open and free for use and distribution. Avoid propietary content - 8. Try to keep the example simple but with a creative touch. + 8. Try to keep the example simple but with a creative touch Simple but beautiful examples are more appealing to users! 9. In case of additional information is required, just come to raylib Discord channel: example-contributions @@ -37,7 +37,7 @@ 10. Have fun! The following files should be updated when adding a new example, it's planned to create some - script to automatize this process but not available yet. + script to automatize this process but not available yet - raylib/examples//_example_name.c - raylib/examples//_example_name.png diff --git a/examples/models/models_animation.c b/examples/models/models_animation.c index a0f514ad2..2d98cb5ed 100644 --- a/examples/models/models_animation.c +++ b/examples/models/models_animation.c @@ -17,7 +17,7 @@ * * NOTE: To export a model from blender, make sure it is not posed, the vertices need to be * in the same position as they would be in edit mode and the scale of your models is -* set to 0. Scaling can be done from the export menu. +* set to 0. Scaling can be done from the export menu * ********************************************************************************************/ diff --git a/examples/models/models_billboard.c b/examples/models/models_billboard.c index 84c02ea23..82610a4df 100644 --- a/examples/models/models_billboard.c +++ b/examples/models/models_billboard.c @@ -40,7 +40,7 @@ int main(void) Vector3 billPositionStatic = { 0.0f, 2.0f, 0.0f }; // Position of static billboard Vector3 billPositionRotating = { 1.0f, 2.0f, 1.0f }; // Position of rotating billboard - // Entire billboard texture, source is used to take a segment from a larger texture. + // Entire billboard texture, source is used to take a segment from a larger texture Rectangle source = { 0.0f, 0.0f, (float)bill.width, (float)bill.height }; // NOTE: Billboard locked on axis-Y @@ -54,7 +54,7 @@ int main(void) Vector2 origin = Vector2Scale(size, 0.5f); // Distance is needed for the correct billboard draw order - // Larger distance (further away from the camera) should be drawn prior to smaller distance. + // Larger distance (further away from the camera) should be drawn prior to smaller distance float distanceStatic; float distanceRotating; float rotation = 0.0f; diff --git a/examples/models/models_loading.c b/examples/models/models_loading.c index 2a674eeaa..82ae40dc4 100644 --- a/examples/models/models_loading.c +++ b/examples/models/models_loading.c @@ -7,11 +7,11 @@ * NOTE: raylib supports multiple models file formats: * * - OBJ > Text file format. Must include vertex position-texcoords-normals information, -* if files references some .mtl materials file, it will be loaded (or try to). +* if files references some .mtl materials file, it will be loaded (or try to) * - GLTF > Text/binary file format. Includes lot of information and it could -* also reference external files, raylib will try loading mesh and materials data. +* also reference external files, raylib will try loading mesh and materials data * - IQM > Binary file format. Includes mesh vertex data but also animation data, -* raylib can load .iqm animations. +* raylib can load .iqm animations * - VOX > Binary file format. MagikaVoxel mesh format: * https://github.com/ephtracy/voxel-model/blob/master/MagicaVoxel-file-format-vox.txt * - M3D > Binary file format. Model 3D format: diff --git a/examples/models/models_loading_m3d.c b/examples/models/models_loading_m3d.c index 38dfbd51e..871bb54dd 100644 --- a/examples/models/models_loading_m3d.c +++ b/examples/models/models_loading_m3d.c @@ -119,7 +119,7 @@ int main(void) // without a -1, we would always draw a cube at the origin for (int i = 0; i < model.boneCount - 1; i++) { - // By default the model is loaded in bind-pose by LoadModel(). + // By default the model is loaded in bind-pose by LoadModel() // But if UpdateModelAnimation() has been called at least once // then the model is already in animation pose, so we need the animated skeleton if (!animPlaying || !animsCount) diff --git a/examples/others/easings_testbed.c b/examples/others/easings_testbed.c index e3fa0e84b..31daeecee 100644 --- a/examples/others/easings_testbed.c +++ b/examples/others/easings_testbed.c @@ -221,10 +221,12 @@ int main(void) } -// NoEase function, used when "no easing" is selected for any axis. It just ignores all parameters besides b. +// NoEase function, used when "no easing" is selected for any axis +// It just ignores all parameters besides b static float NoEase(float t, float b, float c, float d) { - float burn = t + b + c + d; // Hack to avoid compiler warning (about unused variables) + // Hack to avoid compiler warning (about unused variables) + float burn = t + b + c + d; d += burn; return b; diff --git a/examples/others/raylib_opengl_interop.c b/examples/others/raylib_opengl_interop.c index 53fc744db..4dc534d12 100644 --- a/examples/others/raylib_opengl_interop.c +++ b/examples/others/raylib_opengl_interop.c @@ -16,13 +16,13 @@ ******************************************************************************************** * * Mixes raylib and plain OpenGL code to draw a GL_POINTS based particle system. The -* primary point is to demonstrate raylib and OpenGL interop. +* primary point is to demonstrate raylib and OpenGL interop * * rlgl batched draw operations internally so we have to flush the current batch before -* doing our own OpenGL work (rlDrawRenderBatchActive()). +* doing our own OpenGL work (rlDrawRenderBatchActive()) * * The example also demonstrates how to get the current model view projection matrix of -* raylib. That way raylib cameras and so on work as expected. +* raylib. That way raylib cameras and so on work as expected * ********************************************************************************************/ @@ -87,13 +87,13 @@ int main(void) particles[i].x = (float)GetRandomValue(20, screenWidth - 20); particles[i].y = (float)GetRandomValue(50, screenHeight - 20); - // Give each particle a slightly different period. But don't spread it to much. - // This way the particles line up every so often and you get a glimps of what is going on. + // Give each particle a slightly different period. But don't spread it to much + // This way the particles line up every so often and you get a glimps of what is going on particles[i].period = (float)GetRandomValue(10, 30)/10.0f; } // Create a plain OpenGL vertex buffer with the data and an vertex array object - // that feeds the data from the buffer into the vertexPosition shader attribute. + // that feeds the data from the buffer into the vertexPosition shader attribute GLuint vao = 0; GLuint vbo = 0; glGenVertexArrays(1, &vao); diff --git a/examples/others/rlgl_compute_shader.c b/examples/others/rlgl_compute_shader.c index 74a776d29..07a10b1d5 100644 --- a/examples/others/rlgl_compute_shader.c +++ b/examples/others/rlgl_compute_shader.c @@ -23,11 +23,11 @@ #include -// IMPORTANT: This must match gol*.glsl GOL_WIDTH constant. -// This must be a multiple of 16 (check golLogic compute dispatch). +// IMPORTANT: This must match gol*.glsl GOL_WIDTH constant +// This must be a multiple of 16 (check golLogic compute dispatch) #define GOL_WIDTH 768 -// Maximum amount of queued draw commands (squares draw from mouse down events). +// Maximum amount of queued draw commands (squares draw from mouse down events) #define MAX_BUFFERED_TRANSFERTS 48 // Game Of Life Update Command @@ -160,7 +160,7 @@ int main(void) // De-Initialization //-------------------------------------------------------------------------------------- - // Unload shader buffers objects. + // Unload shader buffers objects rlUnloadShaderBuffer(ssboA); rlUnloadShaderBuffer(ssboB); rlUnloadShaderBuffer(ssboTransfert); diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index e74ca0f6c..631699a5d 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -9,7 +9,7 @@ * * Example originally created with raylib 1.6, last time updated with raylib 4.0 * -* WARNING: This example is intended only for PLATFORM_DESKTOP and OpenGL 3.3 Core profile. +* WARNING: This example is intended only for PLATFORM_DESKTOP and OpenGL 3.3 Core profile * It could work on other platforms if redesigned for those platforms (out-of-scope) * * DEPENDENCIES: @@ -48,7 +48,7 @@ * 2. Altered source versions must be plainly marked as such, and must not be misrepresented * as being the original software. * -* 3. This notice may not be removed or altered from any source distribution. +* 3. This notice may not be removed or altered from any source distribution * ********************************************************************************************/ diff --git a/examples/shaders/shaders_basic_lighting.c b/examples/shaders/shaders_basic_lighting.c index 913e4aeeb..a2a392126 100644 --- a/examples/shaders/shaders_basic_lighting.c +++ b/examples/shaders/shaders_basic_lighting.c @@ -5,9 +5,9 @@ * Example complexity rating: [★★★★] 4/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * -* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). +* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3) * * Example originally created with raylib 3.0, last time updated with raylib 4.2 * diff --git a/examples/shaders/shaders_custom_uniform.c b/examples/shaders/shaders_custom_uniform.c index 951759079..d6738cf57 100644 --- a/examples/shaders/shaders_custom_uniform.c +++ b/examples/shaders/shaders_custom_uniform.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_deferred_render.c b/examples/shaders/shaders_deferred_render.c index 1fe6d3a0c..96c118c61 100644 --- a/examples/shaders/shaders_deferred_render.c +++ b/examples/shaders/shaders_deferred_render.c @@ -99,44 +99,44 @@ int main(void) // NOTE: Vertex positions are stored in a texture for simplicity. A better approach would use a depth texture // (instead of a detph renderbuffer) to reconstruct world positions in the final render shader via clip-space position, - // depth, and the inverse view/projection matrices. + // depth, and the inverse view/projection matrices - // 16-bit precision ensures OpenGL ES 3 compatibility, though it may lack precision for real scenarios. + // 16-bit precision ensures OpenGL ES 3 compatibility, though it may lack precision for real scenarios // But as mentioned above, the positions could be reconstructed instead of stored. If not targeting OpenGL ES - // and you wish to maintain this approach, consider using `RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32`. + // and you wish to maintain this approach, consider using `RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32` gBuffer.positionTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, 1); - // Similarly, 16-bit precision is used for normals ensures OpenGL ES 3 compatibility. - // This is generally sufficient, but a 16-bit fixed-point format offer a better uniform precision in all orientations. + // Similarly, 16-bit precision is used for normals ensures OpenGL ES 3 compatibility + // This is generally sufficient, but a 16-bit fixed-point format offer a better uniform precision in all orientations gBuffer.normalTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16, 1); - // Albedo (diffuse color) and specular strength can be combined into one texture. - // The color in RGB, and the specular strength in the alpha channel. + // Albedo (diffuse color) and specular strength can be combined into one texture + // The color in RGB, and the specular strength in the alpha channel gBuffer.albedoSpecTexture = rlLoadTexture(NULL, screenWidth, screenHeight, RL_PIXELFORMAT_UNCOMPRESSED_R8G8B8A8, 1); // Activate the draw buffers for our framebuffer rlActiveDrawBuffers(3); - // Now we attach our textures to the framebuffer. + // Now we attach our textures to the framebuffer rlFramebufferAttach(gBuffer.framebuffer, gBuffer.positionTexture, RL_ATTACHMENT_COLOR_CHANNEL0, RL_ATTACHMENT_TEXTURE2D, 0); rlFramebufferAttach(gBuffer.framebuffer, gBuffer.normalTexture, RL_ATTACHMENT_COLOR_CHANNEL1, RL_ATTACHMENT_TEXTURE2D, 0); rlFramebufferAttach(gBuffer.framebuffer, gBuffer.albedoSpecTexture, RL_ATTACHMENT_COLOR_CHANNEL2, RL_ATTACHMENT_TEXTURE2D, 0); - // Finally we attach the depth buffer. + // Finally we attach the depth buffer gBuffer.depthRenderbuffer = rlLoadTextureDepth(screenWidth, screenHeight, true); rlFramebufferAttach(gBuffer.framebuffer, gBuffer.depthRenderbuffer, RL_ATTACHMENT_DEPTH, RL_ATTACHMENT_RENDERBUFFER, 0); - // Make sure our framebuffer is complete. + // Make sure our framebuffer is complete // NOTE: rlFramebufferComplete() automatically unbinds the framebuffer, so we don't have - // to rlDisableFramebuffer() here. + // to rlDisableFramebuffer() here if (!rlFramebufferComplete(gBuffer.framebuffer)) { TraceLog(LOG_WARNING, "Framebuffer is not complete"); } - // Now we initialize the sampler2D uniform's in the deferred shader. + // Now we initialize the sampler2D uniform's in the deferred shader // We do this by setting the uniform's values to the texture units that - // we later bind our g-buffer textures to. + // we later bind our g-buffer textures to rlEnableShader(deferredShader.id); int texUnitPosition = 0; int texUnitNormal = 1; @@ -219,7 +219,7 @@ int main(void) rlDisableColorBlend(); BeginMode3D(camera); // NOTE: We have to use rlEnableShader here. `BeginShaderMode` or thus `rlSetShader` - // will not work, as they won't immediately load the shader program. + // will not work, as they won't immediately load the shader program rlEnableShader(gbufferShader.id); // When drawing a model here, make sure that the material's shaders // are set to the gbuffer shader! @@ -236,7 +236,7 @@ int main(void) EndMode3D(); rlEnableColorBlend(); - // Go back to the default framebuffer (0) and draw our deferred shading. + // Go back to the default framebuffer (0) and draw our deferred shading rlDisableFramebuffer(); rlClearScreenBuffers(); // Clear color & depth buffer @@ -264,10 +264,10 @@ int main(void) rlEnableColorBlend(); EndMode3D(); - // As a last step, we now copy over the depth buffer from our g-buffer to the default framebuffer. + // As a last step, we now copy over the depth buffer from our g-buffer to the default framebuffer rlBindFramebuffer(RL_READ_FRAMEBUFFER, gBuffer.framebuffer); rlBindFramebuffer(RL_DRAW_FRAMEBUFFER, 0); - rlBlitFramebuffer(0, 0, screenWidth, screenHeight, 0, 0, screenWidth, screenHeight, 0x00000100); // GL_DEPTH_BUFFER_BIT + rlBlitFramebuffer(0, 0, screenWidth, screenHeight, 0, 0, screenWidth, screenHeight, 0x00000100); // GL_DEPTH_BUFFER_BIT rlDisableFramebuffer(); // Since our shader is now done and disabled, we can draw spheres diff --git a/examples/shaders/shaders_eratosthenes.c b/examples/shaders/shaders_eratosthenes.c index 03dfc2125..4a974c9c8 100644 --- a/examples/shaders/shaders_eratosthenes.c +++ b/examples/shaders/shaders_eratosthenes.c @@ -4,7 +4,7 @@ * * Example complexity rating: [★★★☆] 3/4 * -* NOTE: Sieve of Eratosthenes, the earliest known (ancient Greek) prime number sieve. +* NOTE: Sieve of Eratosthenes, the earliest known (ancient Greek) prime number sieve * * "Sift the twos and sift the threes, * The Sieve of Eratosthenes. @@ -12,9 +12,9 @@ * the numbers that are left are prime." * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * -* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). +* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3) * * Example originally created with raylib 2.5, last time updated with raylib 4.0 * diff --git a/examples/shaders/shaders_fog.c b/examples/shaders/shaders_fog.c index 2e589eec4..3307f88f4 100644 --- a/examples/shaders/shaders_fog.c +++ b/examples/shaders/shaders_fog.c @@ -5,9 +5,9 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * -* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). +* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3) * * Example originally created with raylib 2.5, last time updated with raylib 3.7 * diff --git a/examples/shaders/shaders_hot_reloading.c b/examples/shaders/shaders_hot_reloading.c index b11245dcc..ef46e9ecf 100644 --- a/examples/shaders/shaders_hot_reloading.c +++ b/examples/shaders/shaders_hot_reloading.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 for shaders support and only #version 330 -* is currently supported. OpenGL ES 2.0 platforms are not supported at the moment. +* is currently supported. OpenGL ES 2.0 platforms are not supported at the moment * * Example originally created with raylib 3.0, last time updated with raylib 3.5 * diff --git a/examples/shaders/shaders_hybrid_render.c b/examples/shaders/shaders_hybrid_render.c index 0c7e789fd..5d4f8aba1 100644 --- a/examples/shaders/shaders_hybrid_render.c +++ b/examples/shaders/shaders_hybrid_render.c @@ -61,15 +61,15 @@ int main(void) // You are required to write depth for all shaders if one shader does it Shader shdrRaster = LoadShader(0, TextFormat("resources/shaders/glsl%i/hybrid_raster.fs", GLSL_VERSION)); - // Declare Struct used to store camera locs. + // Declare Struct used to store camera locs RayLocs marchLocs = {0}; - // Fill the struct with shader locs. + // Fill the struct with shader locs marchLocs.camPos = GetShaderLocation(shdrRaymarch, "camPos"); marchLocs.camDir = GetShaderLocation(shdrRaymarch, "camDir"); marchLocs.screenCenter = GetShaderLocation(shdrRaymarch, "screenCenter"); - // Transfer screenCenter position to shader. Which is used to calculate ray direction. + // Transfer screenCenter position to shader. Which is used to calculate ray direction Vector2 screenCenter = {.x = screenWidth/2.0f, .y = screenHeight/2.0f}; SetShaderValue(shdrRaymarch, marchLocs.screenCenter , &screenCenter , SHADER_UNIFORM_VEC2); @@ -85,7 +85,7 @@ int main(void) .projection = CAMERA_PERSPECTIVE // Camera projection type }; - // Camera FOV is pre-calculated in the camera Distance. + // Camera FOV is pre-calculated in the camera distance float camDist = 1.0f/(tanf(camera.fovy*0.5f*DEG2RAD)); SetTargetFPS(60); // Set our game to run at 60 frames-per-second @@ -98,10 +98,10 @@ int main(void) //---------------------------------------------------------------------------------- UpdateCamera(&camera, CAMERA_ORBITAL); - // Update Camera Postion in the ray march shader. + // Update Camera Postion in the ray march shader SetShaderValue(shdrRaymarch, marchLocs.camPos, &(camera.position), RL_SHADER_UNIFORM_VEC3); - // Update Camera Looking Vector. Vector length determines FOV. + // Update Camera Looking Vector. Vector length determines FOV Vector3 camDir = Vector3Scale( Vector3Normalize( Vector3Subtract(camera.target, camera.position)) , camDist); SetShaderValue(shdrRaymarch, marchLocs.camDir, &(camDir), RL_SHADER_UNIFORM_VEC3); //---------------------------------------------------------------------------------- @@ -113,7 +113,7 @@ int main(void) ClearBackground(WHITE); // Raymarch Scene - rlEnableDepthTest(); //Manually enable Depth Test to handle multiple rendering methods. + rlEnableDepthTest(); // Manually enable Depth Test to handle multiple rendering methods BeginShaderMode(shdrRaymarch); DrawRectangleRec((Rectangle){0,0, (float)screenWidth, (float)screenHeight},WHITE); EndShaderMode(); diff --git a/examples/shaders/shaders_julia_set.c b/examples/shaders/shaders_julia_set.c index 72ff31ad7..da5564321 100644 --- a/examples/shaders/shaders_julia_set.c +++ b/examples/shaders/shaders_julia_set.c @@ -5,9 +5,9 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * -* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). +* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3) * * Example originally created with raylib 2.5, last time updated with raylib 4.0 * @@ -109,7 +109,7 @@ int main(void) SetShaderValue(shader, cLoc, c, SHADER_UNIFORM_VEC2); } - // If "R" is pressed, reset zoom and offset. + // If "R" is pressed, reset zoom and offset if (IsKeyPressed(KEY_R)) { zoom = startingZoom; @@ -125,17 +125,16 @@ int main(void) if (IsKeyPressed(KEY_RIGHT)) incrementSpeed++; else if (IsKeyPressed(KEY_LEFT)) incrementSpeed--; - // If either left or right button is pressed, zoom in/out. + // If either left or right button is pressed, zoom in/out if (IsMouseButtonDown(MOUSE_BUTTON_LEFT) || IsMouseButtonDown(MOUSE_BUTTON_RIGHT)) { - // Change zoom. If Mouse left -> zoom in. Mouse right -> zoom out. + // Change zoom. If Mouse left -> zoom in. Mouse right -> zoom out zoom *= IsMouseButtonDown(MOUSE_BUTTON_LEFT)? zoomSpeed : 1.0f/zoomSpeed; const Vector2 mousePos = GetMousePosition(); Vector2 offsetVelocity; // Find the velocity at which to change the camera. Take the distance of the mouse - // from the center of the screen as the direction, and adjust magnitude based on - // the current zoom. + // from the center of the screen as the direction, and adjust magnitude based on the current zoom offsetVelocity.x = (mousePos.x/(float)screenWidth - 0.5f)*offsetSpeedMul/zoom; offsetVelocity.y = (mousePos.y/(float)screenHeight - 0.5f)*offsetSpeedMul/zoom; diff --git a/examples/shaders/shaders_lightmap.c b/examples/shaders/shaders_lightmap.c index a393c1afe..3da900921 100644 --- a/examples/shaders/shaders_lightmap.c +++ b/examples/shaders/shaders_lightmap.c @@ -5,9 +5,9 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * -* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3). +* NOTE: Shaders used in this example are #version 330 (OpenGL 3.3) * * Example originally created with raylib 4.5, last time updated with raylib 4.5 * diff --git a/examples/shaders/shaders_model_shader.c b/examples/shaders/shaders_model_shader.c index b448bece0..42cfff4aa 100644 --- a/examples/shaders/shaders_model_shader.c +++ b/examples/shaders/shaders_model_shader.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_multi_sample2d.c b/examples/shaders/shaders_multi_sample2d.c index 67cfb2058..4e732ce1a 100644 --- a/examples/shaders/shaders_multi_sample2d.c +++ b/examples/shaders/shaders_multi_sample2d.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_normalmap.c b/examples/shaders/shaders_normalmap.c index fcbf6135d..656c8597e 100644 --- a/examples/shaders/shaders_normalmap.c +++ b/examples/shaders/shaders_normalmap.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★★] 4/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, - * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. + * OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * Example originally created with raylib 5.6, last time updated with raylib 5.6 * @@ -79,7 +79,7 @@ int main(void) SetTextureFilter(plane.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture, TEXTURE_FILTER_TRILINEAR); SetTextureFilter(plane.materials[0].maps[MATERIAL_MAP_NORMAL].texture, TEXTURE_FILTER_TRILINEAR); - // Specular exponent AKA shininess of the material. + // Specular exponent AKA shininess of the material float specularExponent = 8.0f; int specularExponentLoc = GetShaderLocation(shader, "specularExponent"); diff --git a/examples/shaders/shaders_palette_switch.c b/examples/shaders/shaders_palette_switch.c index 50f80b8f0..df35db447 100644 --- a/examples/shaders/shaders_palette_switch.c +++ b/examples/shaders/shaders_palette_switch.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_postprocessing.c b/examples/shaders/shaders_postprocessing.c index 156474e60..fade145ff 100644 --- a/examples/shaders/shaders_postprocessing.c +++ b/examples/shaders/shaders_postprocessing.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_raymarching.c b/examples/shaders/shaders_raymarching.c index ab69fe69a..cc1badb9f 100644 --- a/examples/shaders/shaders_raymarching.c +++ b/examples/shaders/shaders_raymarching.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★★] 4/4 * * NOTE: This example requires raylib OpenGL 3.3 for shaders support and only #version 330 -* is currently supported. OpenGL ES 2.0 platforms are not supported at the moment. +* is currently supported. OpenGL ES 2.0 platforms are not supported at the moment * * Example originally created with raylib 2.0, last time updated with raylib 4.2 * diff --git a/examples/shaders/shaders_shadowmap.c b/examples/shaders/shaders_shadowmap.c index 7f98a25fe..9c7111a8b 100644 --- a/examples/shaders/shaders_shadowmap.c +++ b/examples/shaders/shaders_shadowmap.c @@ -44,7 +44,7 @@ int main(void) SetConfigFlags(FLAG_MSAA_4X_HINT); // Shadows are a HUGE topic, and this example shows an extremely simple implementation of the shadowmapping algorithm, // which is the industry standard for shadows. This algorithm can be extended in a ridiculous number of ways to improve - // realism and also adapt it for different scenes. This is pretty much the simplest possible implementation. + // realism and also adapt it for different scenes. This is pretty much the simplest possible implementation InitWindow(screenWidth, screenHeight, "raylib [shaders] example - shadowmap"); Camera3D cam = (Camera3D){ 0 }; diff --git a/examples/shaders/shaders_shapes_textures.c b/examples/shaders/shaders_shapes_textures.c index 107b09c03..b0f7752ac 100644 --- a/examples/shaders/shaders_shapes_textures.c +++ b/examples/shaders/shaders_shapes_textures.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shaders/shaders_spotlight.c b/examples/shaders/shaders_spotlight.c index 288292cb6..a0ee7a421 100644 --- a/examples/shaders/shaders_spotlight.c +++ b/examples/shaders/shaders_spotlight.c @@ -20,13 +20,13 @@ * * The right hand side of the screen there is just enough light to see whats * going on without the spot light, great for a stealth type game where you -* have to avoid the spotlights. +* have to avoid the spotlights * -* The left hand side of the screen is in pitch dark except for where the spotlights are. +* The left hand side of the screen is in pitch dark except for where the spotlights are * * Although this example doesn't scale like the letterbox example, you could integrate * the two techniques, but by scaling the actual colour of the render texture rather -* than using alpha as a mask. +* than using alpha as a mask * ********************************************************************************************/ @@ -115,7 +115,7 @@ int main(void) } // Tell the shader how wide the screen is so we can have - // a pitch black half and a dimly lit half. + // a pitch black half and a dimly lit half unsigned int wLoc = GetShaderLocation(shdrSpot, "screenWidth"); float sw = (float)GetScreenWidth(); SetShaderValue(shdrSpot, wLoc, &sw, SHADER_UNIFORM_FLOAT); diff --git a/examples/shaders/shaders_texture_outline.c b/examples/shaders/shaders_texture_outline.c index 68db65188..d7a3a1a07 100644 --- a/examples/shaders/shaders_texture_outline.c +++ b/examples/shaders/shaders_texture_outline.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * Example originally created with raylib 4.0, last time updated with raylib 4.0 * diff --git a/examples/shaders/shaders_texture_tiling.c b/examples/shaders/shaders_texture_tiling.c index 9752b871f..14e15b8b2 100644 --- a/examples/shaders/shaders_texture_tiling.c +++ b/examples/shaders/shaders_texture_tiling.c @@ -4,7 +4,7 @@ * * Example complexity rating: [★★☆☆] 2/4 * -* Example demonstrates how to tile a texture on a 3D model using raylib. +* Example demonstrates how to tile a texture on a 3D model using raylib * * Example originally created with raylib 4.5, last time updated with raylib 4.5 * diff --git a/examples/shaders/shaders_texture_waves.c b/examples/shaders/shaders_texture_waves.c index 73ba738c6..c957635c4 100644 --- a/examples/shaders/shaders_texture_waves.c +++ b/examples/shaders/shaders_texture_waves.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★☆☆] 2/4 * * NOTE: This example requires raylib OpenGL 3.3 or ES2 versions for shaders support, -* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version. +* OpenGL 1.1 does not support shaders, recompile raylib to OpenGL 3.3 version * * NOTE: Shaders used in this example are #version 330 (OpenGL 3.3), to test this example * on OpenGL ES 2.0 platforms (Android, Raspberry Pi, HTML5), use #version 100 shaders diff --git a/examples/shapes/shapes_easings_rectangle_array.c b/examples/shapes/shapes_easings_rectangle_array.c index 912926ea4..c55c07979 100644 --- a/examples/shapes/shapes_easings_rectangle_array.c +++ b/examples/shapes/shapes_easings_rectangle_array.c @@ -5,7 +5,7 @@ * Example complexity rating: [★★★☆] 3/4 * * NOTE: This example requires 'easings.h' library, provided on raylib/src. Just copy -* the library to same directory as example or make sure it's available on include path. +* the library to same directory as example or make sure it's available on include path * * Example originally created with raylib 2.0, last time updated with raylib 2.5 * diff --git a/examples/shapes/shapes_rectangle_advanced.c b/examples/shapes/shapes_rectangle_advanced.c index d0366f616..a3f8adf84 100644 --- a/examples/shapes/shapes_rectangle_advanced.c +++ b/examples/shapes/shapes_rectangle_advanced.c @@ -265,10 +265,10 @@ static void DrawRectangleRoundedGradientH(Rectangle rec, float roundnessLeft, fl rlSetTexture(0); #else - // Here we use the 'Diagram' to guide ourselves to which point receives what color. + // Here we use the 'Diagram' to guide ourselves to which point receives what color // By choosing the color correctly associated with a pointe the gradient effect - // will naturally come from OpenGL interpolation. - // But this time instead of Quad, we think in triangles. + // will naturally come from OpenGL interpolation + // But this time instead of Quad, we think in triangles rlBegin(RL_TRIANGLES); // Draw all of the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner diff --git a/examples/text/text_codepoints_loading.c b/examples/text/text_codepoints_loading.c index 1cbd80ac9..28d15c33f 100644 --- a/examples/text/text_codepoints_loading.c +++ b/examples/text/text_codepoints_loading.c @@ -39,7 +39,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [text] example - codepoints loading"); // Convert each utf-8 character into its - // corresponding codepoint in the font file. + // corresponding codepoint in the font file int codepointCount = 0; int *codepoints = LoadCodepoints(text, &codepointCount); diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index 734d9d744..d87fb2b86 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -6,12 +6,12 @@ * * NOTE: Draw a 2D text in 3D space, each letter is drawn in a quad (or 2 quads if backface is set) * where the texture coodinates of each quad map to the texture coordinates of the glyphs -* inside the font texture. +* inside the font texture * * A more efficient approach, i believe, would be to render the text in a render texture and * map that texture to a plane and render that, or maybe a shader but my method allows more * flexibility...for example to change position of each letter individually to make somethink -* like a wavy text effect. +* like a wavy text effect * * Special thanks to: * @Nighten for the DrawTextStyle() code https://github.com/NightenDushi/Raylib_DrawTextStyle @@ -71,7 +71,7 @@ static void DrawText3D(Font font, const char *text, Vector3 position, float font // Draw a 2D text in 3D space and wave the parts that start with '~~' and end with '~~' // This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle static void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig *config, float time, Color tint); -// Measure a text in 3D ignoring the `~~` chars. +// Measure a text in 3D ignoring the `~~` chars static Vector3 MeasureTextWave3D(Font font, const char *text, float fontSize, float fontSpacing, float lineSpacing); // Generates a nice color with a random hue static Color GenerateRandomColor(float s, float v); @@ -562,7 +562,7 @@ static void DrawText3D(Font font, const char *text, Vector3 position, float font } } -// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~`. +// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~` // This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle static void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig* config, float time, Color tint) { @@ -625,7 +625,7 @@ static void DrawTextWave3D(Font font, const char *text, Vector3 position, float } } -// Measure a text in 3D ignoring the `~~` chars. +// Measure a text in 3D ignoring the `~~` chars static Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, float fontSpacing, float lineSpacing) { int len = TextLength(text); diff --git a/examples/text/text_font_spritefont.c b/examples/text/text_font_spritefont.c index d3200a9ae..8c1a3b102 100644 --- a/examples/text/text_font_spritefont.c +++ b/examples/text/text_font_spritefont.c @@ -12,7 +12,7 @@ * - Rectangles must be defined by a MAGENTA color background * * Following those constraints, a font can be provided just by an image, -* this is quite handy to avoid additional font descriptor files (like BMFonts use). +* this is quite handy to avoid additional font descriptor files (like BMFonts use) * * Example originally created with raylib 1.0, last time updated with raylib 1.0 * diff --git a/examples/text/text_input_box.c b/examples/text/text_input_box.c index 2e55e8b74..77c04d55a 100644 --- a/examples/text/text_input_box.c +++ b/examples/text/text_input_box.c @@ -63,7 +63,7 @@ int main(void) if ((key >= 32) && (key <= 125) && (letterCount < MAX_INPUT_CHARS)) { name[letterCount] = (char)key; - name[letterCount+1] = '\0'; // Add null terminator at the end of the string. + name[letterCount+1] = '\0'; // Add null terminator at the end of the string letterCount++; } diff --git a/examples/text/text_rectangle_bounds.c b/examples/text/text_rectangle_bounds.c index a05dfbd17..75ac65b49 100644 --- a/examples/text/text_rectangle_bounds.c +++ b/examples/text/text_rectangle_bounds.c @@ -179,9 +179,9 @@ static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, // NOTE: When wordWrap is ON we first measure how much of the text we can draw before going outside of the rec container // We store this info in startLine and endLine, then we change states, draw the text between those two variables - // and change states again and again recursively until the end of the text (or until we get outside of the container). + // and change states again and again recursively until the end of the text (or until we get outside of the container) // When wordWrap is OFF we don't need the measure state so we go to the drawing state immediately - // and begin drawing on the next line before we can get outside the container. + // and begin drawing on the next line before we can get outside the container if (state == MEASURE_STATE) { // TODO: There are multiple types of spaces in UNICODE, maybe it's a good idea to add support for more diff --git a/examples/text/text_unicode.c b/examples/text/text_unicode.c index c3ca39d69..fbf579772 100644 --- a/examples/text/text_unicode.c +++ b/examples/text/text_unicode.c @@ -378,9 +378,9 @@ static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, // NOTE: When wordWrap is ON we first measure how much of the text we can draw before going outside of the rec container // We store this info in startLine and endLine, then we change states, draw the text between those two variables - // and change states again and again recursively until the end of the text (or until we get outside of the container). + // and change states again and again recursively until the end of the text (or until we get outside of the container) // When wordWrap is OFF we don't need the measure state so we go to the drawing state immediately - // and begin drawing on the next line before we can get outside the container. + // and begin drawing on the next line before we can get outside the container if (state == MEASURE_STATE) { // TODO: There are multiple types of spaces in UNICODE, maybe it's a good idea to add support for more diff --git a/examples/textures/textures_draw_tiled.c b/examples/textures/textures_draw_tiled.c index 3c5cb7199..c6bf3f835 100644 --- a/examples/textures/textures_draw_tiled.c +++ b/examples/textures/textures_draw_tiled.c @@ -22,7 +22,7 @@ #define MARGIN_SIZE 8 // Size for the margins #define COLOR_SIZE 16 // Size of the color select buttons -// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint); //------------------------------------------------------------------------------------ @@ -173,7 +173,7 @@ int main(void) return 0; } -// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest. +// Draw part of a texture (defined by a rectangle) with rotation and scale tiled into dest void DrawTextureTiled(Texture2D texture, Rectangle source, Rectangle dest, Vector2 origin, float rotation, float scale, Color tint) { if ((texture.id <= 0) || (scale <= 0.0f)) return; // Wanna see a infinite loop?!...just delete this line! diff --git a/examples/textures/textures_image_channel.c b/examples/textures/textures_image_channel.c index 35ef0c7f5..b11fb5cd6 100644 --- a/examples/textures/textures_image_channel.c +++ b/examples/textures/textures_image_channel.c @@ -75,9 +75,9 @@ int main(void) // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { - // Draw + // Update //---------------------------------------------------------------------------------- - // TODO... + // Nothing to update... //---------------------------------------------------------------------------------- // Draw diff --git a/examples/textures/textures_particles_blending.c b/examples/textures/textures_particles_blending.c index 65a55f30a..537d7f312 100644 --- a/examples/textures/textures_particles_blending.c +++ b/examples/textures/textures_particles_blending.c @@ -71,7 +71,7 @@ int main(void) // Activate one particle every frame and Update active particles // NOTE: Particles initial position should be mouse position when activated // NOTE: Particles fall down with gravity and rotation... and disappear after 2 seconds (alpha = 0) - // NOTE: When a particle disappears, active = false and it can be reused. + // NOTE: When a particle disappears, active = false and it can be reused for (int i = 0; i < MAX_PARTICLES; i++) { if (!mouseTail[i].active) diff --git a/src/external/rl_gputex.h b/src/external/rl_gputex.h index 906a863b1..9773268f5 100644 --- a/src/external/rl_gputex.h +++ b/src/external/rl_gputex.h @@ -5,10 +5,10 @@ * DESCRIPTION: * * Load GPU compressed image data from image files provided as memory data arrays, -* data is loaded compressed, ready to be loaded into GPU. +* data is loaded compressed, ready to be loaded into GPU * * Note that some file formats (DDS, PVR, KTX) also support uncompressed data storage. -* In those cases data is loaded uncompressed and format is returned. +* In those cases data is loaded uncompressed and format is returned * * FIXME: This library still depends on Raylib due to the following reasons: * - rl_save_ktx_to_memory() requires rlGetGlTextureFormats() from rlgl.h @@ -436,7 +436,7 @@ void *rl_load_pkm_from_memory(const unsigned char *file_data, unsigned int file_ // version 10: format: 0=ETC1_RGB, [1=ETC1_RGBA, 2=ETC1_RGB_MIP, 3=ETC1_RGBA_MIP] (not used) // version 20: format: 0=ETC1_RGB, 1=ETC2_RGB, 2=ETC2_RGBA_OLD, 3=ETC2_RGBA, 4=ETC2_RGBA1, 5=ETC2_R, 6=ETC2_RG, 7=ETC2_SIGNED_R, 8=ETC2_SIGNED_R - // NOTE: The extended width and height are the widths rounded up to a multiple of 4. + // NOTE: The extended width and height are the widths rounded up to a multiple of 4 // NOTE: ETC is always 4bit per pixel (64 bit for each 4x4 block of pixels) if (file_data_ptr != RL_GPUTEX_NULL) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index d701691a1..c23b570d3 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -724,7 +724,7 @@ void *GetWindowHandle(void) return glfwGetWin32Window(platform.handle); #endif #if defined(__linux__) - // Store the window handle localy and return a pointer to the variable instead. + // Store the window handle localy and return a pointer to the variable instead // Reasoning detailed in the declaration of X11WindowHandle X11WindowHandle = glfwGetX11Window(platform.handle); return &X11WindowHandle; @@ -1066,9 +1066,9 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given. -// A user could craft a malicious string performing another action. -// Only call this function yourself not with user input or make sure to check the string yourself. +// NOTE: This function is only safe to use if you control the URL given +// A user could craft a malicious string performing another action +// Only call this function yourself not with user input or make sure to check the string yourself // Ref: https://github.com/raysan5/raylib/issues/686 void OpenURL(const char *url) { @@ -1130,7 +1130,7 @@ void SetMouseCursor(int cursor) } } -// Get physical key name. +// Get physical key name const char *GetKeyName(int key) { return glfwGetKeyName(key, glfwGetKeyScancode(key)); @@ -1306,8 +1306,8 @@ static void SetDimensionsFromMonitor(GLFWmonitor *monitor) } // Function wrappers around RL_*alloc macros, used by glfwInitAllocator() inside of InitPlatform() -// We need to provide these because GLFWallocator expects function pointers with specific signatures. -// Similar wrappers exist in utils.c but we cannot reuse them here due to declaration mismatch. +// We need to provide these because GLFWallocator expects function pointers with specific signatures +// Similar wrappers exist in utils.c but we cannot reuse them here due to declaration mismatch // https://www.glfw.org/docs/latest/intro_guide.html#init_allocator static void *AllocateWrapper(size_t size, void *user) { @@ -1394,15 +1394,15 @@ int InitPlatform(void) // HACK: Most of this was written before GLFW_SCALE_FRAMEBUFFER existed and // was enabled by default. Disabling it gets back the old behavior. A // complete fix will require removing a lot of CORE.Window.render - // manipulation code. + // manipulation code glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_FALSE); if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { - // Resize window content area based on the monitor content scale. - // NOTE: This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. - // On platforms like macOS the resolution of the framebuffer is changed independently of the window size. - glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); // Scale content area based on the monitor content scale where window is placed on + // Resize window content area based on the monitor content scale + // NOTE: This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11 + // On platforms like macOS the resolution of the framebuffer is changed independently of the window size + glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE); // Scale content area based on the monitor content scale where window is placed on #if defined(__APPLE__) glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE); #endif @@ -1421,8 +1421,8 @@ int InitPlatform(void) } // NOTE: When asking for an OpenGL context version, most drivers provide the highest supported version - // with backward compatibility to older OpenGL versions. - // For example, if using OpenGL 1.1, driver can provide a 4.3 backwards compatible context. + // with backward compatibility to older OpenGL versions + // For example, if using OpenGL 1.1, driver can provide a 4.3 backwards compatible context // Check selection OpenGL version if (rlGetVersion() == RL_OPENGL_21) @@ -1468,9 +1468,9 @@ int InitPlatform(void) glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API); } - // NOTE: GLFW 3.4+ defers initialization of the Joystick subsystem on the first call to any Joystick related functions. - // Forcing this initialization here avoids doing it on PollInputEvents() called by EndDrawing() after first frame has been just drawn. - // The initialization will still happen and possible delays still occur, but before the window is shown, which is a nicer experience. + // NOTE: GLFW 3.4+ defers initialization of the Joystick subsystem on the first call to any Joystick related functions + // Forcing this initialization here avoids doing it on PollInputEvents() called by EndDrawing() after first frame has been just drawn + // The initialization will still happen and possible delays still occur, but before the window is shown, which is a nicer experience // REF: https://github.com/raysan5/raylib/issues/1554 glfwSetJoystickCallback(NULL); @@ -1478,7 +1478,7 @@ int InitPlatform(void) if (CORE.Window.fullscreen) { // According to glfwCreateWindow(), if the user does not have a choice, fullscreen applications - // should default to the primary monitor. + // should default to the primary monitor monitor = glfwGetPrimaryMonitor(); if (!monitor) @@ -1492,8 +1492,8 @@ int InitPlatform(void) // Remember center for switching from fullscreen to window if ((CORE.Window.screen.height == CORE.Window.display.height) && (CORE.Window.screen.width == CORE.Window.display.width)) { - // If screen width/height equal to the display, we can't calculate the window pos for toggling full-screened/windowed. - // Toggling full-screened/windowed with pos(0, 0) can cause problems in some platforms, such as X11. + // If screen width/height equal to the display, we can't calculate the window pos for toggling full-screened/windowed + // Toggling full-screened/windowed with pos(0, 0) can cause problems in some platforms, such as X11 CORE.Window.position.x = CORE.Window.display.width/4; CORE.Window.position.y = CORE.Window.display.height/4; } @@ -1554,7 +1554,7 @@ int InitPlatform(void) // No-fullscreen window creation bool requestWindowedFullscreen = (CORE.Window.screen.height == 0) && (CORE.Window.screen.width == 0); - // Default to at least one pixel in size, as creation with a zero dimension is not allowed. + // Default to at least one pixel in size, as creation with a zero dimension is not allowed int creationWidth = CORE.Window.screen.width != 0 ? CORE.Window.screen.width : 1; int creationHeight = CORE.Window.screen.height != 0 ? CORE.Window.screen.height : 1; @@ -1566,8 +1566,8 @@ int InitPlatform(void) return -1; } - // After the window was created, determine the monitor that the window manager assigned. - // Derive display sizes, and, if possible, window size in case it was zero at beginning. + // After the window was created, determine the monitor that the window manager assigned + // Derive display sizes, and, if possible, window size in case it was zero at beginning int monitorCount = 0; int monitorIndex = GetCurrentMonitor(); @@ -1582,7 +1582,7 @@ int InitPlatform(void) } else { - // The monitor for the window-manager-created window can not be determined, so it can not be centered. + // The monitor for the window-manager-created window can not be determined, so it can not be centered glfwTerminate(); TRACELOG(LOG_WARNING, "GLFW: Failed to determine Monitor to center Window"); return -1; @@ -1604,7 +1604,7 @@ int InitPlatform(void) // Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS) // NOTE: V-Sync can be enabled by graphic driver configuration, it doesn't need - // to be activated on web platforms since VSync is enforced there. + // to be activated on web platforms since VSync is enforced there if (CORE.Window.flags & FLAG_VSYNC_HINT) { // WARNING: It seems to hit a critical render path in Intel HD Graphics @@ -1617,7 +1617,7 @@ int InitPlatform(void) if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0) { - // NOTE: On APPLE platforms system should manage window/input scaling and also framebuffer scaling. + // NOTE: On APPLE platforms system should manage window/input scaling and also framebuffer scaling // Framebuffer scaling should be activated with: glfwWindowHint(GLFW_SCALE_FRAMEBUFFER, GLFW_TRUE); #if !defined(__APPLE__) glfwGetFramebufferSize(platform.handle, &fbWidth, &fbHeight); @@ -1660,7 +1660,8 @@ int InitPlatform(void) int monitorHeight = 0; glfwGetMonitorWorkarea(monitor, &monitorX, &monitorY, &monitorWidth, &monitorHeight); - // Here CORE.Window.render.width/height should be used instead of CORE.Window.screen.width/height to center the window correctly when the high dpi flag is enabled. + // Here CORE.Window.render.width/height should be used instead of + // CORE.Window.screen.width/height to center the window correctly when the high dpi flag is enabled int posX = monitorX + (monitorWidth - (int)CORE.Window.render.width)/2; int posY = monitorY + (monitorHeight - (int)CORE.Window.render.height)/2; if (posX < monitorX) posX = monitorX; diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index bc7889140..5a62fa629 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -252,7 +252,7 @@ static const int CursorsLUT[] = { //SDL_SYSTEM_CURSOR_WAITARROW, // No equivalent implemented on MouseCursor enum on raylib.h }; -// SDL3 Migration Layer made to avoid 'ifdefs' inside functions when we can. +// SDL3 Migration Layer made to avoid 'ifdefs' inside functions when we can #if defined(PLATFORM_DESKTOP_SDL3) // SDL3 Migration: @@ -269,7 +269,7 @@ static const int CursorsLUT[] = { // SDL3 Migration: SDL_INIT_TIMER - no longer needed before calling SDL_AddTimer() #define SDL_INIT_TIMER 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) -// SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag. +// SDL3 Migration: The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag #define SDL_WINDOW_SHOWN 0x0 // It's a flag, so no problem in setting it to zero if we use in a bitor (|) // SDL3 Migration: Renamed @@ -344,7 +344,7 @@ SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth // SDL3 Migration: // SDL_GetDisplayDPI() - // not reliable across platforms, approximately replaced by multiplying -// SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms. +// SDL_GetWindowDisplayScale() times 160 on iPhone and Android, and 96 on other platforms // returns 0 on success or a negative error code on failure int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi) { @@ -382,7 +382,7 @@ int SDL_NumJoysticks(void) // SDL_SetRelativeMouseMode // returns 0 on success or a negative error code on failure -// If relative mode is not supported, this returns -1. +// If relative mode is not supported, this returns -1 int SDL_SetRelativeMouseMode_Adapter(SDL_bool enabled) { // SDL_SetWindowRelativeMouseMode(SDL_Window *window, bool enabled) @@ -841,7 +841,7 @@ void SetWindowMonitor(int monitor) // NOTE: // 1. SDL started supporting moving exclusive fullscreen windows between displays on SDL3, // see commit https://github.com/libsdl-org/SDL/commit/3f5ef7dd422057edbcf3e736107e34be4b75d9ba - // 2. A workaround for SDL2 is leaving fullscreen, moving the window, then entering full screen again. + // 2. A workaround for SDL2 is leaving fullscreen, moving the window, then entering full screen again const bool wasFullscreen = ((CORE.Window.flags & FLAG_FULLSCREEN_MODE) > 0)? true : false; const int screenWidth = CORE.Window.screen.width; @@ -854,7 +854,7 @@ void SetWindowMonitor(int monitor) if (SDL_GetDisplayUsableBounds(monitor, &usableBounds) == 0) #endif { - if (wasFullscreen == 1) ToggleFullscreen(); // Leave fullscreen. + if (wasFullscreen == 1) ToggleFullscreen(); // Leave fullscreen // If the screen size is larger than the monitor usable area, anchor it on the top left corner, otherwise, center it if ((screenWidth >= usableBounds.w) || (screenHeight >= usableBounds.h)) @@ -862,11 +862,11 @@ void SetWindowMonitor(int monitor) // NOTE: // 1. There's a known issue where if the window larger than the target display bounds, // when moving the windows to that display, the window could be clipped back - // ending up positioned partly outside the target display. + // ending up positioned partly outside the target display // 2. The workaround for that is, previously to moving the window, - // setting the window size to the target display size, so they match. + // setting the window size to the target display size, so they match // 3. It wasn't done here because we can't assume changing the window size automatically - // is acceptable behavior by the user. + // is acceptable behavior by the user SDL_SetWindowPosition(platform.window, usableBounds.x, usableBounds.y); CORE.Window.position.x = usableBounds.x; CORE.Window.position.y = usableBounds.y; @@ -1099,7 +1099,7 @@ Vector2 GetWindowScaleDPI(void) #ifndef PLATFORM_DESKTOP_SDL3 // NOTE: SDL_GetWindowDisplayScale was only added on SDL3 // see https://wiki.libsdl.org/SDL3/SDL_GetWindowDisplayScale - // TODO: Implement the window scale factor calculation manually. + // TODO: Implement the window scale factor calculation manually TRACELOG(LOG_WARNING, "GetWindowScaleDPI() not implemented on target platform"); #else scale.x = SDL_GetWindowDisplayScale(platform.window); @@ -1245,9 +1245,9 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given. -// A user could craft a malicious string performing another action. -// Only call this function yourself not with user input or make sure to check the string yourself. +// NOTE: This function is only safe to use if you control the URL given +// A user could craft a malicious string performing another action +// Only call this function yourself not with user input or make sure to check the string yourself // Ref: https://github.com/raysan5/raylib/issues/686 void OpenURL(const char *url) { @@ -1299,7 +1299,7 @@ void SetMouseCursor(int cursor) CORE.Input.Mouse.cursor = cursor; } -// Get physical key name. +// Get physical key name const char *GetKeyName(int key) { return SDL_GetKeyName(key); @@ -1466,10 +1466,9 @@ void PollInputEvents(void) #ifndef PLATFORM_DESKTOP_SDL3 // SDL3 states: - // The SDL_WINDOWEVENT_* events have been moved to top level events, - // and SDL_WINDOWEVENT has been removed. - // In general, handling this change just means checking for the individual events instead of first checking for SDL_WINDOWEVENT - // and then checking for window events. You can compare the event >= SDL_EVENT_WINDOW_FIRST and <= SDL_EVENT_WINDOW_LAST if you need to see whether it's a window event. + // The SDL_WINDOWEVENT_* events have been moved to top level events, and SDL_WINDOWEVENT has been removed + // In general, handling this change just means checking for the individual events instead of first checking for SDL_WINDOWEVENT + // and then checking for window events. You can compare the event >= SDL_EVENT_WINDOW_FIRST and <= SDL_EVENT_WINDOW_LAST if you need to see whether it's a window event. case SDL_WINDOWEVENT: { switch (event.window.event) diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index a3051f485..79769eee7 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -18,9 +18,9 @@ * * CONFIGURATION: * #define SUPPORT_SSH_KEYBOARD_RPI (Raspberry Pi only) -* Reconfigure standard input to receive key inputs, works with SSH connection. +* Reconfigure standard input to receive key inputs, works with SSH connection * WARNING: Reconfiguring standard input could lead to undesired effects, like breaking other -* running processes orblocking the device if not restored properly. Use with care. +* running processes orblocking the device if not restored properly. Use with care * * DEPENDENCIES: * - DRM and GLM: System libraries for display initialization and configuration @@ -744,11 +744,11 @@ void SwapScreenBuffer() } // Attempt page flip - // NOTE: rmModePageFlip() schedules a buffer-flip for the next vblank and then notifies us about it. - // It takes a CRTC-id, fb-id and an arbitrary data-pointer and then schedules the page-flip. - // This is fully asynchronous and when the page-flip happens, the DRM-fd will become readable and we can call drmHandleEvent(). - // This will read all vblank/page-flip events and call our modeset_page_flip_event() callback with the data-pointer that we passed to drmModePageFlip(). - // We simply call modeset_draw_dev() then so the next frame is rendered... returns immediately. + // NOTE: rmModePageFlip() schedules a buffer-flip for the next vblank and then notifies us about it + // It takes a CRTC-id, fb-id and an arbitrary data-pointer and then schedules the page-flip + // This is fully asynchronous and when the page-flip happens, the DRM-fd will become readable and we can call drmHandleEvent() + // This will read all vblank/page-flip events and call our modeset_page_flip_event() callback with the data-pointer that we passed to drmModePageFlip() + // We simply call modeset_draw_dev() then so the next frame is rendered... returns immediately if (drmModePageFlip(platform.fd, platform.crtc->crtc_id, fbId, DRM_MODE_PAGE_FLIP_EVENT, platform.prevBO)) { if (errno == EBUSY) errCnt[3]++; // Display busy - skip flip @@ -824,9 +824,9 @@ double GetTime(void) } // Open URL with default system browser (if available) -// NOTE: This function is only safe to use if you control the URL given. -// A user could craft a malicious string performing another action. -// Only call this function yourself not with user input or make sure to check the string yourself. +// NOTE: This function is only safe to use if you control the URL given +// A user could craft a malicious string performing another action +// Only call this function yourself not with user input or make sure to check the string yourself // Ref: https://github.com/raysan5/raylib/issues/686 void OpenURL(const char *url) { @@ -863,7 +863,7 @@ void SetMouseCursor(int cursor) TRACELOG(LOG_WARNING, "SetMouseCursor() not implemented on target platform"); } -// Get physical key name. +// Get physical key name const char *GetKeyName(int key) { TRACELOG(LOG_WARNING, "GetKeyName() not implemented on target platform"); @@ -897,7 +897,7 @@ void PollInputEvents(void) PollKeyboardEvents(); #if defined(SUPPORT_SSH_KEYBOARD_RPI) - // NOTE: Keyboard reading could be done using input_event(s) or just read from stdin, both methods are used here. + // NOTE: Keyboard reading could be done using input_event(s) or just read from stdin, both methods are used here // stdin reading is still used for legacy purposes, it allows keyboard input trough SSH console if (!platform.eventKeyboardMode) ProcessKeyboard(); #endif @@ -1003,8 +1003,8 @@ int InitPlatform(void) drmModeConnector *con = drmModeGetConnector(platform.fd, res->connectors[i]); TRACELOG(LOG_TRACE, "DISPLAY: Connector modes detected: %i", con->count_modes); - // In certain cases the status of the conneciton is reported as UKNOWN, but it is still connected. - // This might be a hardware or software limitation like on Raspberry Pi Zero with composite output. + // In certain cases the status of the conneciton is reported as UKNOWN, but it is still connected + // This might be a hardware or software limitation like on Raspberry Pi Zero with composite output if (((con->connection == DRM_MODE_CONNECTED) || (con->connection == DRM_MODE_UNKNOWNCONNECTION)) && (con->encoder_id)) { TRACELOG(LOG_TRACE, "DISPLAY: DRM mode connected"); @@ -1160,7 +1160,7 @@ int InitPlatform(void) // Initialize the EGL device connection if (eglInitialize(platform.device, NULL, NULL) == EGL_FALSE) { - // If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred. + // If all of the calls to eglInitialize returned EGL_FALSE then an error has occurred TRACELOG(LOG_WARNING, "DISPLAY: Failed to initialize EGL device"); return -1; } @@ -1644,7 +1644,7 @@ static void ConfigureEvdevDevice(char *device) return; } - // At this point we have a connection to the device, but we don't yet know what the device is. + // At this point we have a connection to the device, but we don't yet know what the device is // It could be many things, even as simple as a power button... //------------------------------------------------------------------------------------------------------- diff --git a/src/raudio.c b/src/raudio.c index 93024722f..76fee2333 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -15,8 +15,8 @@ * raudio module is included in the build * * #define RAUDIO_STANDALONE -* Define to use the module as standalone library (independently of raylib). -* Required types and functions are defined in the same module. +* Define to use the module as standalone library (independently of raylib) +* Required types and functions are defined in the same module * * #define SUPPORT_FILEFORMAT_WAV * #define SUPPORT_FILEFORMAT_OGG @@ -89,7 +89,7 @@ // by user at some point and won't be included... //------------------------------------------------------------------------------------- -// If defined, the following flags inhibit definition of the indicated items. +// If defined, the following flags inhibit definition of the indicated items #define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_ #define NOVIRTUALKEYCODES // VK_* #define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_* @@ -124,9 +124,9 @@ #define NOWH // SetWindowsHook and WH_* #define NOWINOFFSETS // GWL_*, GCL_*, associated routines #define NOCOMM // COMM driver routines -#define NOKANJI // Kanji support stuff. -#define NOHELP // Help engine interface. -#define NOPROFILER // Profiler interface. +#define NOKANJI // Kanji support stuff +#define NOHELP // Help engine interface +#define NOPROFILER // Profiler interface #define NODEFERWINDOWPOS // DeferWindowPos routines #define NOMCX // Modem Configuration Extensions @@ -1118,7 +1118,7 @@ bool ExportWaveAsCode(Wave wave, const char *fileName) // NOTE: Text data buffer size is estimated considering wave data size in bytes // and requiring 12 char bytes for every byte; the actual size varies, but - // the longest possible char being appended is "%.4ff,\n ", which is 12 bytes. + // the longest possible char being appended is "%.4ff,\n ", which is 12 bytes char *txtData = (char *)RL_CALLOC(waveDataSize*12 + 2000, sizeof(char)); int byteCount = 0; diff --git a/src/raylib.h b/src/raylib.h index 4517cbcac..0851905c1 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -5,7 +5,7 @@ * FEATURES: * - NO external dependencies, all required libraries included with raylib * - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, -* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5. +* MacOS, Haiku, Android, Raspberry Pi, DRM native, HTML5 * - Written in plain C code (C99) in PascalCase/camelCase notation * - Hardware accelerated with OpenGL (1.1, 2.1, 3.3, 4.3, ES2, ES3 - choose at compile) * - Unique OpenGL abstraction layer (usable as standalone module): [rlgl] diff --git a/src/rmodels.c b/src/rmodels.c index 1a181c843..c1a32058a 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -12,7 +12,7 @@ * #define SUPPORT_FILEFORMAT_GLTF * #define SUPPORT_FILEFORMAT_VOX * #define SUPPORT_FILEFORMAT_M3D -* Selected desired fileformats to be supported for model data loading. +* Selected desired fileformats to be supported for model data loading * * #define SUPPORT_MESH_GENERATION * Support procedural mesh generation functions, uses external par_shapes.h library @@ -2298,7 +2298,7 @@ void UpdateModelAnimationBones(Model model, ModelAnimation anim, int frame) if (firstMeshWithBones != -1) { - // Update all bones and boneMatrices of first mesh with bones. + // Update all bones and boneMatrices of first mesh with bones for (int boneId = 0; boneId < anim.boneCount; boneId++) { Transform *bindTransform = &model.bindPose[boneId]; @@ -5291,8 +5291,7 @@ static Model LoadGLTF(const char *fileName) > Texcoords: vec2: float > Colors: vec4: u8, u16, f32 (normalized) > Indices: u16, u32 (truncated to u16) - - Scenes defined in the glTF file are ignored. All nodes in the file - are used. + - Scenes defined in the glTF file are ignored. All nodes in the file are used ***********************************************************************************************/ @@ -5347,8 +5346,8 @@ static Model LoadGLTF(const char *fileName) int primitivesCount = 0; - // NOTE: We will load every primitive in the glTF as a separate raylib Mesh. - // Determine total number of meshes needed from the node hierarchy. + // NOTE: We will load every primitive in the glTF as a separate raylib Mesh + // Determine total number of meshes needed from the node hierarchy for (unsigned int i = 0; i < data->nodes_count; i++) { cgltf_node *node = &(data->nodes[i]); @@ -5490,14 +5489,13 @@ static Model LoadGLTF(const char *fileName) // has_clearcoat, has_transmission, has_volume, has_ior, has specular, has_sheen } - // Visit each node in the hierarchy and process any mesh linked from it. - // Each primitive within a glTF node becomes a Raylib Mesh. + // Visit each node in the hierarchy and process any mesh linked from it + // Each primitive within a glTF node becomes a Raylib Mesh // The local-to-world transform of each node is used to transform the - // points/normals/tangents of the created Mesh(es). + // points/normals/tangents of the created Mesh(es) // Any glTF mesh linked from more than one Node (i.e. instancing) - // is turned into multiple Mesh's, as each Node will have its own - // transform applied. - // NOTE: The code below disregards the scenes defined in the file, all nodes are used. + // is turned into multiple Mesh's, as each Node will have its own transform applied + // NOTE: The code below disregards the scenes defined in the file, all nodes are used //---------------------------------------------------------------------------------------------------- int meshIndex = 0; for (unsigned int i = 0; i < data->nodes_count; i++) diff --git a/src/rshapes.c b/src/rshapes.c index be28e6cad..38ad75c7d 100644 --- a/src/rshapes.c +++ b/src/rshapes.c @@ -3,17 +3,17 @@ * rshapes - Basic functions to draw 2d shapes and check collisions * * ADDITIONAL NOTES: -* Shapes can be draw using 3 types of primitives: LINES, TRIANGLES and QUADS. +* Shapes can be draw using 3 types of primitives: LINES, TRIANGLES and QUADS * Some functions implement two drawing options: TRIANGLES and QUADS, by default TRIANGLES * are used but QUADS implementation can be selected with SUPPORT_QUADS_DRAW_MODE define * * Some functions define texture coordinates (rlTexCoord2f()) for the shapes and use a * user-provided texture with SetShapesTexture(), the pourpouse of this implementation -* is allowing to reduce draw calls when combined with a texture-atlas. +* is allowing to reduce draw calls when combined with a texture-atlas * * By default, raylib sets the default texture and rectangle at InitWindow()[rcore] to one * white character of default font [rtext], this way, raylib text and shapes can be draw with -* a single draw call and it also allows users to configure it the same way with their own fonts. +* a single draw call and it also allows users to configure it the same way with their own fonts * * CONFIGURATION: * #define SUPPORT_MODULE_RSHAPES diff --git a/src/rtext.c b/src/rtext.c index 1330c5906..50ea6c883 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -7,8 +7,8 @@ * rtext module is included in the build * * #define SUPPORT_DEFAULT_FONT -* Load default raylib font on initialization to be used by DrawText() and MeasureText(). -* If no default font loaded, DrawTextEx() and MeasureTextEx() are required. +* Load default raylib font on initialization to be used by DrawText() and MeasureText() +* If no default font loaded, DrawTextEx() and MeasureTextEx() are required * * #define SUPPORT_FILEFORMAT_FNT * #define SUPPORT_FILEFORMAT_TTF @@ -19,7 +19,7 @@ * #define SUPPORT_FONT_ATLAS_WHITE_REC * On font atlas image generation [GenImageFontAtlas()], add a 3x3 pixels white rectangle * at the bottom-right corner of the atlas. It can be useful to for shapes drawing, to allow -* drawing text and shapes with a single draw call [SetShapesTexture()]. +* drawing text and shapes with a single draw call [SetShapesTexture()] * * #define TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH * TextSplit() function static buffer max size diff --git a/src/rtextures.c b/src/rtextures.c index b798caed6..81d615c38 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -36,7 +36,7 @@ * * DEPENDENCIES: * stb_image - Multiple image formats loading (JPEG, PNG, BMP, TGA, PSD, GIF, PIC) -* NOTE: stb_image has been slightly modified to support Android platform. +* NOTE: stb_image has been slightly modified to support Android platform * stb_image_resize - Multiple image resize algorithms * *