@ -13,7 +13,7 @@
# include "raylib.h"
# include "raylib.h"
# define NUM_TEXTURES 7 / / Currently we have 7 generation algorithms
# define NUM_TEXTURES 9 / / Currently we have 8 generation algorithms but some are have multiple purposes (Linear and Square Gradients)
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/ / Program main entry point
/ / Program main entry point
@ -31,8 +31,10 @@ int main(void)
Image horizontalGradient = GenImageGradientLinear ( screenWidth , screenHeight , 90 , RED , BLUE ) ;
Image horizontalGradient = GenImageGradientLinear ( screenWidth , screenHeight , 90 , RED , BLUE ) ;
Image diagonalGradient = GenImageGradientLinear ( screenWidth , screenHeight , 45 , RED , BLUE ) ;
Image diagonalGradient = GenImageGradientLinear ( screenWidth , screenHeight , 45 , RED , BLUE ) ;
Image radialGradient = GenImageGradientRadial ( screenWidth , screenHeight , 0.0f , WHITE , BLACK ) ;
Image radialGradient = GenImageGradientRadial ( screenWidth , screenHeight , 0.0f , WHITE , BLACK ) ;
Image squareGradient = GenImageGradientSquare ( screenWidth , screenHeight , 0.0f , WHITE , BLACK ) ;
Image checked = GenImageChecked ( screenWidth , screenHeight , 32 , 32 , RED , BLUE ) ;
Image checked = GenImageChecked ( screenWidth , screenHeight , 32 , 32 , RED , BLUE ) ;
Image whiteNoise = GenImageWhiteNoise ( screenWidth , screenHeight , 0.5f ) ;
Image whiteNoise = GenImageWhiteNoise ( screenWidth , screenHeight , 0.5f ) ;
Image perlinNoise = GenImagePerlinNoise ( screenWidth , screenHeight , 50 , 50 , 4.0f ) ;
Image cellular = GenImageCellular ( screenWidth , screenHeight , 32 ) ;
Image cellular = GenImageCellular ( screenWidth , screenHeight , 32 ) ;
Texture2D textures [ NUM_TEXTURES ] = { 0 } ;
Texture2D textures [ NUM_TEXTURES ] = { 0 } ;
@ -41,16 +43,21 @@ int main(void)
textures [ 1 ] = LoadTextureFromImage ( horizontalGradient ) ;
textures [ 1 ] = LoadTextureFromImage ( horizontalGradient ) ;
textures [ 2 ] = LoadTextureFromImage ( diagonalGradient ) ;
textures [ 2 ] = LoadTextureFromImage ( diagonalGradient ) ;
textures [ 3 ] = LoadTextureFromImage ( radialGradient ) ;
textures [ 3 ] = LoadTextureFromImage ( radialGradient ) ;
textures [ 4 ] = LoadTextureFromImage ( checked ) ;
textures [ 5 ] = LoadTextureFromImage ( whiteNoise ) ;
textures [ 6 ] = LoadTextureFromImage ( cellular ) ;
textures [ 4 ] = LoadTextureFromImage ( squareGradient ) ;
textures [ 5 ] = LoadTextureFromImage ( checked ) ;
textures [ 6 ] = LoadTextureFromImage ( whiteNoise ) ;
textures [ 7 ] = LoadTextureFromImage ( perlinNoise ) ;
textures [ 8 ] = LoadTextureFromImage ( cellular ) ;
/ / Unload image data ( CPU RAM )
/ / Unload image data ( CPU RAM )
UnloadImage ( verticalGradient ) ;
UnloadImage ( verticalGradient ) ;
UnloadImage ( horizontalGradient ) ;
UnloadImage ( horizontalGradient ) ;
UnloadImage ( diagonalGradient ) ;
UnloadImage ( radialGradient ) ;
UnloadImage ( radialGradient ) ;
UnloadImage ( squareGradient ) ;
UnloadImage ( checked ) ;
UnloadImage ( checked ) ;
UnloadImage ( whiteNoise ) ;
UnloadImage ( whiteNoise ) ;
UnloadImage ( perlinNoise ) ;
UnloadImage ( cellular ) ;
UnloadImage ( cellular ) ;
int currentTexture = 0 ;
int currentTexture = 0 ;
@ -87,9 +94,11 @@ int main(void)
case 1 : DrawText ( " HORIZONTAL GRADIENT " , 540 , 10 , 20 , RAYWHITE ) ; break ;
case 1 : DrawText ( " HORIZONTAL GRADIENT " , 540 , 10 , 20 , RAYWHITE ) ; break ;
case 2 : DrawText ( " DIAGONAL GRADIENT " , 540 , 10 , 20 , RAYWHITE ) ; break ;
case 2 : DrawText ( " DIAGONAL GRADIENT " , 540 , 10 , 20 , RAYWHITE ) ; break ;
case 3 : DrawText ( " RADIAL GRADIENT " , 580 , 10 , 20 , LIGHTGRAY ) ; break ;
case 3 : DrawText ( " RADIAL GRADIENT " , 580 , 10 , 20 , LIGHTGRAY ) ; break ;
case 4 : DrawText ( " CHECKED " , 680 , 10 , 20 , RAYWHITE ) ; break ;
case 5 : DrawText ( " WHITE NOISE " , 640 , 10 , 20 , RED ) ; break ;
case 6 : DrawText ( " CELLULAR " , 670 , 10 , 20 , RAYWHITE ) ; break ;
case 4 : DrawText ( " SQUARE GRADIENT " , 580 , 10 , 20 , LIGHTGRAY ) ; break ;
case 5 : DrawText ( " CHECKED " , 680 , 10 , 20 , RAYWHITE ) ; break ;
case 6 : DrawText ( " WHITE NOISE " , 640 , 10 , 20 , RED ) ; break ;
case 7 : DrawText ( " PERLIN NOISE " , 640 , 10 , 20 , RED ) ; break ;
case 8 : DrawText ( " CELLULAR " , 670 , 10 , 20 , RAYWHITE ) ; break ;
default : break ;
default : break ;
}
}