Crafter.Graphics/examples/HelloDrawing
2025-11-17 00:44:45 +01:00
..
main.cpp semi working wayland 2025-11-17 00:44:45 +01:00
project.json new structure complete 2025-11-16 18:52:52 +01:00
README.md commit 2025-11-16 20:42:48 +01:00

HelloWindow Example

Description

This example demonstrates how to draw pixels to a window.

Expected Result

A window with a red colored square.

Highlighted Code Snippet

for(std::uint_fast32_t x = 0; x < 1280; x++) {
	for(std::uint_fast32_t y = 0; y < 720; y++) {
		window.framebuffer[x*720+y].r = 255;
		window.framebuffer[x*720+y].g = 0;
		window.framebuffer[x*720+y].b = 0;
		window.framebuffer[x*720+y].a = 255;
	}
}

How to Run

crafter-build build executable -r