-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpu.h
More file actions
29 lines (26 loc) · 1014 Bytes
/
gpu.h
File metadata and controls
29 lines (26 loc) · 1014 Bytes
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
#ifndef GPU_H
#define GPU_H
#include <pthread.h>
// Text message structure for drawing from main.c
typedef struct {
char text[256];
int x, y;
int r, g, b;
int active;
} text_message_t;
#define MAX_TEXT_MESSAGES 10
extern text_message_t text_messages[MAX_TEXT_MESSAGES];
extern pthread_mutex_t framebuffer_mutex;
void free_drawstring_buffer(int ***cbuf, int height, int width);
void draw(int buf[800][1280][3], int bgbuf[800][1280][3], volatile int *running);
void putpixel(int colorR, int colorG, int colorB, int x, int y);
void drawchar(unsigned int c, int x, int y, int fgR, int fgG, int fgB);
void drawstring(char* t, int x, int y, int fgR, int fgG, int fgB);
int ***drawstring2buf(char *t, int x, int y, int fgR, int fgG, int fgB);
void drawstring_safe(char* t, int x, int y, int fgR, int fgG, int fgB);
void add_text_message(const char* text, int x, int y, int r, int g, int b);
void clear_text_messages();
void init_framebuffer_mutex();
void clearForeground();
void smartClearFg();
#endif