-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrenderer.h
More file actions
44 lines (40 loc) · 1.15 KB
/
renderer.h
File metadata and controls
44 lines (40 loc) · 1.15 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef RENDERER_H
#define RENDERER_H
#include "constants.h"
#include "SDL2-2.0.10/include/SDL_events.h"
#include "SDL2-2.0.10/include/SDL_render.h"
#include "SDL2-2.0.10/include/SDL_surface.h"
#include "SDL2-2.0.10/include/SDL_timer.h"
#include <cstddef>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
extern "C" {
#include"./SDL2-2.0.10/include/SDL.h"
#include"./SDL2-2.0.10/include/SDL_main.h"
}
class Renderer{
public:
SDL_Surface *screen, *charset;
SDL_Texture *scrtex;
SDL_Window *window;
SDL_Renderer *renderer;
char hudtext[128];
int rc,czarny,bialy,zielony,czerwony,niebieski;
int screen_width, screen_height;
void InitRenderer(int widht,int height);
void DrawPixel(int x, int y, Uint32 color);
void DrawString(int x, int y, const char *text);
void DrawLine(int x, int y, int l, int dx, int dy, Uint32 color);
void DrawRectangle(int x, int y, int l, int k,
Uint32 outlineColor, Uint32 fillColor);
SDL_Surface* load_charset();
void DrawHUD(double worldTime,double fps,int points);
void DrawProgressBar(double progress);
void UpdateScreen();
void FreeMemory();
};
#endif