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

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();
}