This commit is contained in:
Jorijn van der Graaf 2025-11-16 20:42:48 +01:00
commit e795ab880c
6 changed files with 89 additions and 24 deletions

View file

@ -11,8 +11,8 @@ A window with a red colored square.
## Highlighted Code Snippet
```cpp
for(uint32_t x = 0; x < 1280; x++) {
for(uint32_t y = 0; y < 720; y++) {
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;

View file

@ -5,8 +5,8 @@ using namespace Crafter;
int main() {
WindowWaylandWayland window("HelloWindow", 1280, 720);
for(uint32_t x = 0; x < 1280; x++) {
for(uint32_t y = 0; y < 720; y++) {
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;
@ -15,8 +15,8 @@ int main() {
}
//Semi transparant version:
// for(uint32_t x = 0; x < 1280; x++) {
// for(uint32_t y = 0; y < 720; y++) {
// for(std::uint_fast32_t x = 0; x < 1280; x++) {
// for(std::uint_fast32_t = 0; y < 720; y++) {
// window.framebuffer[x*720+y].r = 128;//alpha channel must be premultiplied
// window.framebuffer[x*720+y].g = 0;
// window.framebuffer[x*720+y].b = 0;