aboutsummaryrefslogtreecommitdiff
path: root/sources/TZR_LightBegin.c
blob: 421d4c9030756c59c55572abd3fa4eb0a1e59a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "TZR_light.h"
#include "TZR_globals.h"
#include "sdl_error.h"
#include <SDL2/SDL_render.h>

int
TZR_LightBegin(void)
{
	if (!___tzr_config.light_system) {
		fprintf(stderr, "light system disabled\n");
		return -1;
	}
	if (SDL_SetRenderDrawBlendMode(___tzr_renderer, SDL_BLENDMODE_ADD) < 0)
		return sdl_error(-1);
	if (SDL_SetRenderTarget(___tzr_renderer, ___tzr_target_light) < 0)
		return sdl_error(-1);
	return 0;
}