prosperon/source/engine/sprite.h

42 lines
817 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
2023-12-27 14:16:43 -06:00
#define DRAW_SIMPLE 0
#define DRAW_TILE 1
struct sprite {
HMM_Vec2 pos;
HMM_Vec2 scale;
float angle;
struct rgba color;
struct rgba emissive;
2023-12-12 08:46:27 -06:00
gameobject *go;
texture *tex;
struct rect frame;
int enabled;
2023-12-27 14:16:43 -06:00
int drawmode;
2024-01-01 07:44:43 -06:00
float parallax;
unsigned int next;
2021-11-30 21:29:18 -06:00
};
typedef struct sprite sprite;
sprite *sprite_make();
2023-12-11 16:59:59 -06:00
int make_sprite(gameobject *go);
void sprite_free(sprite *sprite);
2023-01-12 17:41:54 -06:00
void sprite_delete(int id);
2022-02-06 10:14:57 -06:00
void sprite_initialize();
void sprite_draw(struct sprite *sprite);
2022-07-01 11:14:43 -05:00
void sprite_draw_all();
2023-05-07 19:47:49 -05:00
void sprite_flush();
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