Files
cell/source/sprite.h
John Alanbrook ead61e648a
Some checks failed
Build and Deploy / package-dist (push) Has been cancelled
Build and Deploy / deploy-itch (push) Has been cancelled
Build and Deploy / deploy-gitea (push) Has been cancelled
Build and Deploy / build-windows (CLANG64) (push) Has been cancelled
Build and Deploy / build-linux (push) Has been cancelled
changes to update to newer quickjs version
2025-05-01 12:50:03 -05:00

25 lines
627 B
C

#ifndef SPRITE_H
#define SPRITE_H
#include "HandmadeMath.h"
#include "render.h"
#include "quickjs.h"
struct sprite{
HMM_Vec2 pos; // x,y coordinates of the sprite
HMM_Mat2 affine_m; // defines all deformation
rect affine; //
JSValue image; // the actual texture resource - perhaps SDL_GPUTexture, or SDL_Texture, or something else ...
SDL_GPUTexture *tex;
rect uv; // pixel coordinates of the sprite on its image
int layer; // layer this sprite draws onto
HMM_Vec4 color; // color in 0-1f
};
typedef struct sprite sprite;
sprite *make_sprite(void);
void sprite_free(JSRuntime *rt, sprite *sprite);
#endif