muszaki_informatika:raylib
                This is an old revision of the document!
Telepítés és konfiguráció
- Töltsük le az include és lib fájlokat tartalmazó raylib.zip-et.
 - Hozzunk létre egy konzol alkalmazást a codeblocks-ban
 - A létrejött main.c fájl könyvtárába tömörítsük ki a letöltött zip-et
 
#include <raylib.h>
int main() {
    // Window creation
    const int screenWidth = 640;
    const int screenHeight = 480;
    InitWindow(screenWidth, screenHeight, "raylib example");
    // Initialization
    SetTargetFPS(60); // Set our game to run at 60 frames-per-second
    // Main game loop
    while (!WindowShouldClose()) { // Detect window close button or ESC key
        // Update
        // Draw
        BeginDrawing();
            ClearBackground(LIGHTGRAY); // Clear the background with a color
            int MaxX = GetScreenWidth();
            int MaxY = GetScreenHeight();
            for (int i = 1; i <= 10; i++) {
                Color lineColor = GetColor(i + 5); // Choose color
                DrawLine(0, 0, (MaxX / 10) * i, MaxY, lineColor); // Draw line
                int R = (MaxY - 10) / (2 * i); // Circle radius
                DrawCircle(MaxX - R, MaxY / 2, R, lineColor); // Draw circle
                // Draw ellipse
                DrawEllipse(MaxX / 2, MaxY / 8, MaxX / (4 * i), MaxY / 8, lineColor);
            }
        EndDrawing();
    }
    // De-Initialization
    CloseWindow(); // Close window and OpenGL context
    return 0;
}
muszaki_informatika/raylib.1706459735.txt.gz · Last modified: 2024/01/28 16:35 by knehez
                
                


