-
Notifications
You must be signed in to change notification settings - Fork 0
/
renderer.h
31 lines (26 loc) · 1011 Bytes
/
renderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* renderer.h
*
* Created on: Oct. 27, 2018
* Author: Levi
*/
#ifndef RENDERER_H_
#define RENDERER_H_
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include "Ball.h"
#include "Paddle.h"
#include "Menu.h"
#define WINDOW_WIDTH (640)
#define WINDOW_HEIGHT (480)
int Init(SDL_Window** window, SDL_Renderer** renderer, TTF_Font** font);
int Window_Init(SDL_Window** window);
int Renderer_Init(SDL_Renderer** renderer, SDL_Window* window);
int Font_Init(TTF_Font** font, SDL_Renderer* renderer, SDL_Window* window);
void quit(SDL_Renderer* renderer, SDL_Window* window, TTF_Font* font);
void renderScore(SDL_Renderer *renderer, const char *score_str, TTF_Font *font, SDL_Rect *rect, SDL_Color *color);
void redraw(SDL_Renderer* renderer);
void drawGame(SDL_Renderer *renderer, Paddle player, Paddle cpu, Ball ball);
void drawMenu(SDL_Renderer *renderer, TTF_Font* font, int players);
void drawPaused(SDL_Renderer *renderer, TTF_Font* font);
#endif /* RENDERER_H_ */