Crafter.Graphics/examples/HelloDrawing/main.cpp
2025-11-23 04:04:53 +01:00

22 lines
549 B
C++

import Crafter.Graphics;
import std;
using namespace Crafter;
int main() {
constexpr std::uint_fast32_t width = 1280;
constexpr std::uint_fast32_t height = 720;
WindowWayland window(width, height, "Hello Drawing!");
for(std::uint_fast32_t x = 0; x < width; x++) {
for(std::uint_fast32_t y = 0; y < height; y++) {
window.framebuffer[x*height+y].r = 255;
window.framebuffer[x*height+y].g = 0;
window.framebuffer[x*height+y].b = 0;
window.framebuffer[x*height+y].a = 255;
}
}
window.Render();
window.StartSync();
}