Add utility functions

This commit is contained in:
Amine B. Hassouna
2018-11-20 18:03:04 +01:00
parent 9a9d4df97a
commit f67a1dfab4
3 changed files with 137 additions and 8 deletions

View File

@@ -33,9 +33,7 @@
#include <SDL2/SDL.h>
// Define MAX and MIN macros
#define MAX(X, Y) (((X) > (Y)) ? (X) : (Y))
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
#include "utils.h"
// Define screen dimensions
#define SCREEN_WIDTH 800
@@ -102,11 +100,8 @@ int main(int argc, char* argv[])
quit = true;
}
// Initialize renderer color white for the background
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
// Clear screen
SDL_RenderClear(renderer);
// Set backgroud color
Utils_setBackgroundColor(renderer, COLOR_WHITE);
// Set renderer color red to draw the square
SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0x00, 0xFF);