aboutsummaryrefslogtreecommitdiff
path: root/src/saffron.c
blob: 64c7842193c41647bd9a237132aa3b1ce42a5300 (plain)
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
#include <stdio.h>
#include <stdbool.h>
#include <SDL3/SDL.h>
#include <SDL3_ttf/SDL_ttf.h>
#include <saffron.h> /* meson include directories */

/* why is this defined in saffron.c, you ask, and not in a separate saffron_theme.c file? because i cant be bothered to make a whole separate .c file for theming which is pretty much mostly headers and some tweaks around the engine */
const SaffronTheme SAFFRON_DEFAULT_THEME = {
	.bg = {30, 30, 46, 255},
	.fg = {205, 214, 244, 255},
	.primary = {137, 180, 250, 255},
	.secondary = {166, 227, 161, 255},
	.tertiary = {203, 166, 247, 255}
};

bool saffron_init(void) {
	if (!SDL_Init(SDL_INIT_VIDEO)) {
		printf("[Saffron] SDL init failed: %s\n", SDL_GetError());
		return false;
	}
	if (!TTF_Init()) {
		printf("[Saffron] TTF init failed: %s\n", SDL_GetError());
		return false;
	}
	return true;
}

void saffron_quit(void) {
	TTF_Quit();
	SDL_Quit();
}