diff --git a/examples/examples_template.c b/examples/examples_template.c index 39a19351d..211749e82 100644 --- a/examples/examples_template.c +++ b/examples/examples_template.c @@ -36,7 +36,7 @@ 10. Have fun! - The following files must be updated when adding a new example, + The following files must be updated when adding a new example, but it can be automatically done using the raylib provided tool: rexm So, no worries if just the .c/.png are provided when adding the example. diff --git a/examples/shaders/shaders_normalmap_rendering.c b/examples/shaders/shaders_normalmap_rendering.c index 4859ec813..07399a78e 100644 --- a/examples/shaders/shaders_normalmap_rendering.c +++ b/examples/shaders/shaders_normalmap_rendering.c @@ -49,7 +49,7 @@ int main(void) camera.projection = CAMERA_PERSPECTIVE; // Load basic normal map lighting shader - Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/normalmap.vs", GLSL_VERSION), + Shader shader = LoadShader(TextFormat("resources/shaders/glsl%i/normalmap.vs", GLSL_VERSION), TextFormat("resources/shaders/glsl%i/normalmap.fs", GLSL_VERSION)); // Get some required shader locations diff --git a/examples/shapes/shapes_bullet_hell.c b/examples/shapes/shapes_bullet_hell.c index 235df4d16..95abc4dc9 100644 --- a/examples/shapes/shapes_bullet_hell.c +++ b/examples/shapes/shapes_bullet_hell.c @@ -197,7 +197,7 @@ int main(void) bullets[i].color); } } - } + } else { // Draw bullets using DrawCircle(), less performant diff --git a/examples/shapes/shapes_starfield_effect.c b/examples/shapes/shapes_starfield_effect.c index 8dd90fe0b..ca409c926 100644 --- a/examples/shapes/shapes_starfield_effect.c +++ b/examples/shapes/shapes_starfield_effect.c @@ -32,18 +32,18 @@ int main(void) const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib [shapes] example - starfield effect"); - + Color bgColor = ColorLerp(DARKBLUE, BLACK, 0.69f); - + // Speed at which we fly forward float speed = 10.0f/9.0f; - + // We're either drawing lines or circles bool drawLines = true; - + Vector3 stars[STAR_COUNT] = { 0 }; Vector2 starsScreenPos[STAR_COUNT] = { 0 }; - + // Setup the stars with a random position for (int i = 0; i < STAR_COUNT; i++) { @@ -65,22 +65,22 @@ int main(void) if ((int)mouseMove != 0) speed += 2.0f*mouseMove/9.0f; if (speed < 0.0f) speed = 0.1f; else if (speed > 2.0f) speed = 2.0f; - + // Toggle lines / points with space bar if (IsKeyPressed(KEY_SPACE)) drawLines = !drawLines; - + float dt = GetFrameTime(); - for (int i = 0; i < STAR_COUNT; i++) + for (int i = 0; i < STAR_COUNT; i++) { // Update star's timer stars[i].z -= dt*speed; - + // Calculate the screen position starsScreenPos[i] = (Vector2){ screenWidth*0.5f + stars[i].x/stars[i].z, screenHeight*0.5f + stars[i].y/stars[i].z, }; - + // If the star is too old, or offscreen, it dies and we make a new random one if ((stars[i].z < 0.0f) || (starsScreenPos[i].x < 0) || (starsScreenPos[i].y < 0.0f) || (starsScreenPos[i].x > screenWidth) || (starsScreenPos[i].y > screenHeight)) @@ -97,14 +97,14 @@ int main(void) BeginDrawing(); ClearBackground(bgColor); - + for (int i = 0; i < STAR_COUNT; i++) { if (drawLines) { // Get the time a little while ago for this star, but clamp it float t = Clamp(stars[i].z + 1.0f/32.0f, 0.0f, 1.0f); - + // If it's different enough from the current time, we proceed if ((t - stars[i].z) > 1e-3) { @@ -113,26 +113,26 @@ int main(void) screenWidth*0.5f + stars[i].x/t, screenHeight*0.5f + stars[i].y/t, }; - + // Draw a line connecting the old point to the current point DrawLineV(startPos, starsScreenPos[i], RAYWHITE); } } - else + else { // Make the radius grow as the star ages float radius = Lerp(stars[i].z, 1.0f, 5.0f); - + // Draw the circle DrawCircleV(starsScreenPos[i], radius, RAYWHITE); } } - + DrawText(TextFormat("[MOUSE WHEEL] Current Speed: %.0f", 9.0f*speed/2.0f), 10, 40, 20, RAYWHITE); DrawText(TextFormat("[SPACE] Current draw mode: %s", drawLines ? "Lines" : "Circles"), 10, 70, 20, RAYWHITE); - + DrawFPS(10, 10); - + EndDrawing(); //---------------------------------------------------------------------------------- } diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index e135cd848..03bad80f9 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1243,7 +1243,7 @@ void EnableCursor(void) SDL_SetRelativeMouseMode(SDL_FALSE); #if defined(USING_VERSION_SDL3) - // NOTE: SDL_ShowCursor() has been split into three functions: + // NOTE: SDL_ShowCursor() has been split into three functions: // SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible() SDL_ShowCursor(); #else diff --git a/src/platforms/rcore_desktop_win32.c b/src/platforms/rcore_desktop_win32.c index 5b67c72b0..1dadd5586 100644 --- a/src/platforms/rcore_desktop_win32.c +++ b/src/platforms/rcore_desktop_win32.c @@ -1139,7 +1139,7 @@ void ShowCursor(void) // Hides mouse cursor void HideCursor(void) { - // NOTE: We use SetCursor() instead of ShowCursor() because + // NOTE: We use SetCursor() instead of ShowCursor() because // it makes it easy to only hide the cursor while it's inside the client area SetCursor(NULL); CORE.Input.Mouse.cursorHidden = true; diff --git a/src/rcore.c b/src/rcore.c index e4628e77c..d06e3089b 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -709,7 +709,7 @@ void InitWindow(int width, int height, const char *title) //-------------------------------------------------------------- // Initialize rlgl default data (buffers and shaders) - // NOTE: CORE.Window.currentFbo.width and CORE.Window.currentFbo.height not used, just stored as globals in rlgl + // NOTE: Current fbo size stored as globals in rlgl for convenience rlglInit(CORE.Window.currentFbo.width, CORE.Window.currentFbo.height); isGpuReady = true; // Flag to note GPU has been initialized successfully