// // Circle screen transition effect using Bresenham circle. // // #include "raylib.h" // // Our function for transitioning the screen. void circletransition(int radius, int screenWidth, int screenHeight, Color col); // Helper functions for curcletransition.... void circleBres(int xc, int yc, int r,int screenWidth, int screenHeight, Color col); void putpixelBres(int xc, int yc, int x, int y,int screenWidth, int screenHeight, Color col); int main(void) { // Initialization //-------------------------------------------------------------------------------------- int screenWidth = 800; int screenHeight = 450; InitWindow(screenWidth, screenHeight, "raylib example."); SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // transition setup(start with nothing to grow) int radius=0; int state=0; // Main game loop while (!WindowShouldClose()) // Detect window close button or ESC key { // Update //---------------------------------------------------------------------------------- // // Here our transition effects is done. // // Draw our transition circletransition(radius,screenWidth,screenHeight,BLACK); // Grow our circle if(state==0 && radius0){ radius-=6; }else{ state=0; } //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- BeginDrawing(); ClearBackground(RAYWHITE); for(int y=0;y0) { x=x+1; y=y-1; p=p+(x*2)-(y*2)+5; } } } // // Here we draw from the circle outwards to the edges of the screen,. void putpixelBres(int xc, int yc, int x, int y, int screenWidth, int screenHeight, Color col) { DrawLine(screenWidth,yc+y,xc+x, yc+y, col); DrawLine(0,yc+y,xc-x, yc+y, col); DrawLine(screenWidth,yc-y,xc+x, yc-y, col); DrawLine(0,yc-y,xc-x, yc-y, col); DrawLine(0,yc-x,xc-y, yc-x, col); DrawLine(screenWidth,yc-x,xc+y, yc-x, col); DrawLine(0,yc+x,xc-y, yc+x, col); DrawLine(screenWidth,yc+x,xc+y, yc+x, col); }