2010-10-12 10:55:23 +02:00
|
|
|
/*
|
2019-08-03 19:43:48 +02:00
|
|
|
* This software is licensed under the terms of the MIT License.
|
2017-02-11 04:52:08 +01:00
|
|
|
* See COPYING for further information.
|
2011-03-05 13:44:21 +01:00
|
|
|
* ---
|
2024-05-16 23:30:41 +02:00
|
|
|
* Copyright (c) 2011-2024, Lukas Weber <laochailan@web.de>.
|
|
|
|
* Copyright (c) 2012-2024, Andrei Alexeyev <akari@taisei-project.org>.
|
2010-10-12 10:55:23 +02:00
|
|
|
*/
|
|
|
|
|
2021-08-12 23:09:01 +02:00
|
|
|
#pragma once
|
2017-11-25 20:45:11 +01:00
|
|
|
#include "taisei.h"
|
2010-10-12 10:55:23 +02:00
|
|
|
|
2018-04-12 16:08:48 +02:00
|
|
|
#include "resource.h"
|
2024-05-17 04:41:28 +02:00
|
|
|
#include "util/geometry.h"
|
2011-12-25 08:18:03 +01:00
|
|
|
|
2011-07-04 09:14:08 +02:00
|
|
|
typedef struct Texture Texture;
|
2011-03-19 16:21:48 +01:00
|
|
|
|
2018-01-29 04:37:05 +01:00
|
|
|
void begin_draw_texture(FloatRect dest, FloatRect frag, Texture *tex);
|
2018-01-20 15:53:31 +01:00
|
|
|
void end_draw_texture(void);
|
|
|
|
|
2018-02-06 07:19:25 +01:00
|
|
|
void fill_viewport(float xoff, float yoff, float ratio, const char *name);
|
|
|
|
void fill_viewport_p(float xoff, float yoff, float ratio, float aspect, float angle, Texture *tex);
|
|
|
|
|
|
|
|
void fill_screen(const char *name);
|
|
|
|
void fill_screen_p(Texture *tex);
|
2011-11-01 21:20:40 +01:00
|
|
|
|
2019-11-22 04:37:11 +01:00
|
|
|
void loop_tex_line_p(cmplx a, cmplx b, float w, float t, Texture *texture);
|
|
|
|
void loop_tex_line(cmplx a, cmplx b, float w, float t, const char *texture);
|
2017-03-25 09:22:45 +01:00
|
|
|
|
2018-04-12 16:08:48 +02:00
|
|
|
extern ResourceHandler texture_res_handler;
|
|
|
|
|
2017-04-18 21:48:18 +02:00
|
|
|
#define TEX_PATH_PREFIX "res/gfx/"
|
2018-02-06 07:19:25 +01:00
|
|
|
#define TEX_EXTENSION ".tex"
|
2019-01-23 21:10:43 +01:00
|
|
|
|
2020-06-09 03:33:22 +02:00
|
|
|
DEFINE_RESOURCE_GETTER(Texture, res_texture, RES_TEXTURE)
|
|
|
|
DEFINE_OPTIONAL_RESOURCE_GETTER(Texture, res_texture_optional, RES_TEXTURE)
|