prosperon/source/engine/sprite.h

46 lines
941 B
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#ifndef SPRITE_H
#define SPRITE_H
2023-01-02 07:55:26 -06:00
#include "texture.h"
2023-05-24 20:45:50 -05:00
#include "HandmadeMath.h"
#include "render.h"
2023-11-30 10:47:59 -06:00
#include "transform.h"
2023-12-11 08:36:45 -06:00
#include "gameobject.h"
2021-11-30 21:29:18 -06:00
struct sprite {
HMM_Vec2 pos;
HMM_Vec2 scale;
float angle;
struct rgba color;
struct rgba emissive;
2024-04-23 15:58:08 -05:00
HMM_Vec2 spritesize;
HMM_Vec2 spriteoffset;
};
struct spriteuni {
HMM_Vec4 color;
HMM_Vec4 emissive;
HMM_Vec2 size;
HMM_Vec2 offset;
HMM_Mat4 model;
2021-11-30 21:29:18 -06:00
};
typedef struct sprite sprite;
2024-04-21 10:05:18 -05:00
extern sg_bindings bind_sprite;
2024-04-30 10:32:27 -05:00
extern sg_pipeline pip_sprite;
2024-04-21 10:05:18 -05:00
sprite *sprite_make();
void sprite_free(sprite *sprite);
2024-04-21 10:05:18 -05:00
void sprite_tex(texture *t);
2022-02-06 10:14:57 -06:00
void sprite_initialize();
2024-04-30 10:32:27 -05:00
void tex_draw(texture *tex, gameobject *go);
2024-04-21 10:05:18 -05:00
void sprite_draw(struct sprite *sprite, gameobject *go);
void sprite_pipe();
2022-07-01 11:14:43 -05:00
void sprite_draw_all();
2024-04-30 10:32:27 -05:00
void sprite_setpipe(sg_pipeline p);
2022-08-12 14:03:56 -05:00
void gui_draw_img(texture *tex, transform2d t, int wrap, HMM_Vec2 wrapoffset, float wrapscale, struct rgba color);
2022-12-24 13:18:06 -06:00
2021-11-30 21:29:18 -06:00
#endif