Code - Lazy Graphics

為了方便繪圖測試,把sdl 3給加一層包裝,懶人專用… 使用例…

#include <stdlib.h>
#define LAZY_GRAPHIC_IMPLEMENTATION
#include "lazygraphic.h"
#include <math.h>
#include <time.h>

int main(int argc, char* argv[])
{
    RGBA bkgColor = { .color = 0xFF181818 };
    RGBA cirColor = { .color = 0xFF18D818 };
    lazyGr.Init(800, 600, "LAZY !!");
    srand(time(NULL));
    while (!lazyGr.Done()) {
        lazyGr.Clear(bkgColor);
        for (int i = 0; i < 50; i++) {
            int rx = rand() % 400;
            int ry = rand() % 300;
            int rr = rand() % 200;
            cirColor.color = rand() | 0xFF000000;
            lazyGr.Disk(400 - rr/2 + rx/2, 300 - rr/2 + ry/2 , rr, cirColor);
        }
        lazyGr.Update();
        lazyGr.Delay(16);
    }
    lazyGr.Fini();
    return 0;
}
[Read More]
c  program  sdl3