This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void draw_rounded_rectangle_filled_simple(image_view_t *img, i32 x1, i32 y1, i32 x2, i32 y2, i32 radius, color4_t color) | |
| { | |
| if (x1 > x2) { SWAP(x1, x2, i32); } | |
| if (y1 > y2) { SWAP(y1, y2, i32); } | |
| i32 w = x2 - x1 + 1; | |
| i32 h = y2 - y1 + 1; | |
| // Clamp radius to valid range | |
| radius = Clamp(0, radius, MIN(w,h) / 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <time.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <assert.h> | |
| #ifdef _WIN32 | |
| #include <windows.h> | |
| #else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int a; // a evaluates to int -> a is an int | |
| int *a; // *a (dereferencing) evaluates to int -> a is a pointer to int | |
| int a(); // a() evaluates to int -> a is a function that returns int | |
| int *a(); // () has higher precedence ≃ int *(a()) -> deref a() evaluates to int -> a is a function that returns pointer to int | |
| int (*a)(); // (*a)() evaluates to int -> a is a pointer to function that returns int | |
| int a[10]; // a[i] evaluates to int -> a is an array of 10 integers | |
| int *a[10]; // [] has higher precedence ≃ int *(a[10]) -> deref a[i] evaluates to int -> a is an array of 10 pointers to int | |
| int (*a)[10]; // (*a)[i] evaluates to int -> a is a pointer to an array of 10 integers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC=g++ | |
| EXT=cpp | |
| OPT= | |
| DBG= | |
| WARNINGS=-Wall -Wextra -Wsign-conversion -Wconversion | |
| STD=-std=c++17 | |
| DEPFLAGS=-MP -MD | |
| DEF= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define ENUM_GEN(ENUM) ENUM, | |
| #define STRING_GEN(STRING) #STRING, | |
| // Add all your enums here | |
| #define LIST_RET_T(RET_T) \ | |
| RET_T(RET_SUCCESS) \ | |
| RET_T(RET_FULL) \ | |
| RET_T(RET_EMPTY) \ |