Skip to content

Draw text in Texture mode cause flickering #4702

Closed
@sent44

Description

@sent44

Please, before submitting a new issue verify and check:

  • I tested it on latest raylib version from master branch
    I don't know. I use raysan5/raylib-game-template for test on minimal reproduction.
  • I checked there is no similar issue already reported
  • I checked the documentation on the wiki
  • My code has no errors or misuse of raylib
    I don't think this is misuse.

Issue description

Flickering when draw long string or draw string multiple time in texture mode.

Environment

Linux/Siduction Wayland KDE Plasma OpenGL 4.6.0 NVIDIA GTX 2070 driver 550.142

Issue Screenshot

No screenshot but here is video.

Screencast_20250118_071151.webm

Code Example

#include "raylib.h"

int main(){
    InitWindow(800, 450, "");
    RenderTexture2D unusedtexture = LoadRenderTexture(200, 200);

    while(!WindowShouldClose()){
        BeginTextureMode(unusedtexture);
        DrawText("number: 10", 10, 10, 20, BLACK);
        // Comment below draw text to unflickering
        // Comment other but change text to long string will still flickering
        DrawText("number: 10", 10, 40, 20, RED);
        DrawText("number: 10", 10, 70, 20, GREEN);
        DrawText("number: 10", 10, 100, 20, BLUE);
        EndTextureMode();

        BeginDrawing();
        ClearBackground(RAYWHITE);
        DrawText("This and FPS counter are flickering.", 20, 200, 20, BLACK);
        DrawFPS(10, 10);
        EndDrawing();
    }
    UnloadRenderTexture(unusedtexture);
    CloseWindow();
    return 0;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions