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
|
#ifndef EVERYTHING_ALWAYS_H_
#define EVERYTHING_ALWAYS_H_
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <raylib.h>
#define TEXT_BUFFER_LIMIT (1<<12)
#define FRAME_LIMIT (1<<4)
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define CLAMP(a,b,c) (a)<(b)?(b):(a)>(c)?(c):(a)
typedef struct {
Font font;
float frame_x[FRAME_LIMIT];
float frame_y[FRAME_LIMIT];
int horizontal, vertical;
float ups, fps;
} game_t;
/* render.c */
void DrawSquareGrid (game_t * game, size_t frame, int size, Texture * texture, int * array, size_t length);
void DrawVerticalBargraph (game_t * game, size_t frame, int size, Color color, int * arr, size_t length);
void DrawCenteredText (game_t * game, size_t frame, int font_size, Color color, char * format, ...);
/* game.c */
void GameInitialize(game_t * game, char * window_name);
void GameDeinitialize(game_t * game);
void GameFrame(game_t * game, size_t frame, float x, float y);
void GameFrameReset(game_t * game);
Vector2 GameFrameVector(game_t * game, size_t frame);
/* ... */
#endif /* EVERYTHING_ALWAYS_H_ */
|