Advertisement
Guest User

Untitled

a guest
Apr 24th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.69 KB | None | 0 0
  1. #include "raylib.h"
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4.  
  5. int main(int argc, char** argv) {
  6.     srand(time(NULL));
  7.     InitWindow(1366, 768, "Window");
  8.     Color clr = (Color){0x000000FF};
  9.     int64_t clickCount = 0;
  10.     SetTargetFPS(3);
  11.     while (!WindowShouldClose())
  12.     {
  13.         if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
  14.             clickCount++;
  15.             printf("LMB clicked %ld times\n", clickCount);
  16.         }
  17.         clr.r =  rand() % UINT8_MAX / 16;
  18.         clr.g =  rand() % UINT8_MAX / 16;
  19.         clr.b =  rand() % UINT8_MAX / 16;
  20.         clr.a = 0xFF;
  21.  
  22.         BeginDrawing();
  23.         ClearBackground(clr);
  24.         EndDrawing();
  25.     }
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement