You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
831 B
C
40 lines
831 B
C
#include <raylib.h>
|
|
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
static pid_t pid;
|
|
|
|
int main(void) {
|
|
unsigned int read_value = 1;
|
|
InitWindow(640, 480, "Test Window");
|
|
SetTargetFPS(60);
|
|
char pid_buf[20];
|
|
char adr_buf[20];
|
|
|
|
Color primary = WHITE;
|
|
Color secondary = BLACK;
|
|
pid = getpid();
|
|
sprintf(pid_buf, "%d", pid);
|
|
sprintf(adr_buf, "%p", &read_value);
|
|
|
|
while (!WindowShouldClose()) {
|
|
if (IsKeyPressed(KEY_SPACE)) {
|
|
read_value ^= 1;
|
|
}
|
|
|
|
BeginDrawing();
|
|
|
|
primary = read_value ? WHITE : BLACK;
|
|
secondary = !read_value ? WHITE : BLACK;
|
|
ClearBackground(primary);
|
|
|
|
DrawText(pid_buf, 0, 0, 50, secondary);
|
|
DrawText(adr_buf, 0, 50 + 1, 50, secondary);
|
|
|
|
EndDrawing();
|
|
}
|
|
|
|
CloseWindow();
|
|
return 0;
|
|
}
|