Untitled

 avatar
unknown
c_cpp
a year ago
688 B
7
Indexable
#include "raylib.h"


int main(void)
{
    
    const int screenWidth = 800;
    const int screenHeight = 450;

    InitWindow(screenWidth, screenHeight, "raylib [textures] example - texture loading and drawing");

    Texture2D texture = LoadTexture("resources/image.png");

   
    while (!WindowShouldClose())
    {
        BeginDrawing();

            ClearBackground(RAYWHITE);

            DrawTexture(texture, screenWidth/2 - texture.width/2, screenHeight/2 - texture.height/2, WHITE);

            DrawText("Texture test", 360, 370, 10, GRAY);

        EndDrawing();
        
    }

    UnloadTexture(texture);

    CloseWindow();

    return 0;
}
Editor is loading...
Leave a Comment