#ifndef SWIFT_WINDOW_RENDER_H
#define SWIFT_WINDOW_RENDER_H
#include <swift/window/glad.h>
#include <GLFW/glfw3.h>
#include <swift/maths.h>
#include <swift/stdlib.h>
#include <swift/window/window.h>
#include <swift/window/api.h>
#include <swift/window/texture_cache.h>

typedef struct swift_sprite_t swift_sprite_t;

struct swift_sprite_t {
	swift_tex_t *tex;
	swift_vec3f_t pos;
	swift_vec2f_t size;
	swift_vec4f_t col, tex_pos;
	float rotation;
	void *shader;
};

#define SWIFT_SPRITE(...) ((swift_sprite_t){__VA_ARGS__})

SWIFT_WINDOW_API void swift_set_clip_box(swift_window_t *window,
	swift_vec4f_t box);
SWIFT_WINDOW_API void swift_draw_state_default(void);
SWIFT_WINDOW_API void swift_3d_draw_enable(void);
SWIFT_WINDOW_API void swift_set_draw_view(swift_window_t *window,
	swift_vec4f_t box);
SWIFT_WINDOW_API void swift_clear_screen(swift_vec4f_t color);
SWIFT_WINDOW_API swift_sprite_t swift_init_sprite(const char *img_path);
SWIFT_WINDOW_API swift_sprite_t *swift_new_sprite(const char *img_path);
SWIFT_WINDOW_API swift_sprite_t swift_init_sprite_notex(swift_vec4f_t color);
SWIFT_WINDOW_API swift_sprite_t *swift_new_sprite_notex(swift_vec4f_t color);
SWIFT_WINDOW_API void swift_unload_sprite(swift_sprite_t *sprite);
SWIFT_WINDOW_API void swift_destory_sprite(swift_sprite_t *sprite);
SWIFT_WINDOW_API bool swift_init_rendering(void);
SWIFT_WINDOW_API void swift_term_render(void);
SWIFT_WINDOW_API void swift_bind_texture(size_t texture_id);
SWIFT_WINDOW_API void swift_render(swift_window_t *window,
	swift_sprite_t *sprite);

#endif /* SWIFT_WINDOW_RENDER_H */
