#include "raylib.h" void drawpillar01(int x, int y, int w, int h, int thick, Color col); // Raylibs built in Clamp seems not to work? static float Clamp(float value, float min, float max); int main(void) { // Initialization //-------------------------------------------------------------------------------------- const int screenWidth = 800; const int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib example."); SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- int time=0; Color col=(Color){GetRandomValue(0,255),GetRandomValue(0,255),GetRandomValue(0,255),255}; // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- time++; if(time>60){ time=0; col=(Color){GetRandomValue(0,255),GetRandomValue(0,255),GetRandomValue(0,255),255}; } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); Color mycol = (Color){ Clamp((col.r/100)*110,0,255), Clamp((col.g/100)*110,0,255), Clamp((col.b/100)*110,0,255),255}; ClearBackground(mycol); for(int x=0;x max ? max : res; }