Crafter.Graphics/example/HelloDrawing
2025-06-14 01:51:35 +02:00
..
main.cpp documentation 2025-06-13 23:59:36 +02:00
project.json documentation 2025-06-13 23:59:36 +02:00
README.md md 2025-06-14 01:51:35 +02: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(uint32_t x = 0; x < 1280; x++) {
	for(uint32_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 -c example -r

Relevant documentation