-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsolemgr.h
38 lines (35 loc) · 975 Bytes
/
consolemgr.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
32
33
34
35
36
37
38
#pragma once
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <vector>
#include <chrono>
#include "SDL2/SDL.h"
#include "SDL2/SDL_ttf.h"
#ifdef __cplusplus
extern "C" {
#endif
#include "tmt.h"
#ifdef __cplusplus
}
#endif
typedef struct {
TMT* terminal;
TTF_Font* font;
SDL_Surface* surface;
SDL_Rect screenRect;
SDL_Rect consoleRect;
bool cursor;
int charactW;
int charactH;
std::chrono::high_resolution_clock::time_point time;
} ConsoleMgr;
void initTmt(ConsoleMgr* mgr, TMT* tmt);
bool initFont(ConsoleMgr* mgr, const char* fontName, int fontSize);
void setFontStyle(ConsoleMgr* mgr, int renderstyle);
void setConsoleRect(ConsoleMgr* mgr, SDL_Rect rect);
void setScreenRect(ConsoleMgr* mgr, SDL_Rect rect);
void closeFont(ConsoleMgr* mgr);
SDL_Surface* createConsoleSurface(int width, int height);
SDL_Surface* renderConsole(ConsoleMgr* mgr);
void renderCursor(ConsoleMgr* mgr);