#ifndef LEXSDL_sprite_H_ #define LEXSDL_sprite_H_ /* "Constants" */ #define LEXSDL_SpriteIDInvalid 0xFFFFFFFF #define LEXSDL_SpriteCreationFailed 0xFFFFFFFE #define LEXSDL_SpriteTextureInvalid 0xFFFFFFFD #define LEXSDL_SpriteOperationInvalid 0xFFFFFFFC #define LEXSDL_SpriteOperationFailed 0xFFFFFFFB #define LEXSDL_SpriteOperationSucceded 0xFFFFFFFA /* Types */ typedef uint32_t LEXSDL_SpriteID; /* Creation */ // int LEXSDL_AddSprite(LEXSDL_Sprite sprite); extern LEXSDL_SpriteID LEXSDL_CreateSprite(LEXSDL_TextureID textureID, uint32_t frames, uint32_t fps, SDL_Rect frameDimensions); /* Getters */ extern uint32_t LEXSDL_SpriteGetCurrentFrame(LEXSDL_SpriteID id); extern SDL_Rect LEXSDL_SpriteGetFrameDimensions(LEXSDL_SpriteID id); extern uint32_t LEXSDL_SpriteGetFrames(LEXSDL_SpriteID id); extern uint32_t LEXSDL_SpriteGetFps(LEXSDL_SpriteID id); extern SDL_Texture* LEXSDL_SpriteGetTexture(LEXSDL_SpriteID id); extern LEXSDL_TextureID LEXSDL_SpriteGetTextureId(LEXSDL_SpriteID id); extern LEXSDL_SpriteID LEXSDL_SpriteSetTextureId(LEXSDL_SpriteID id, LEXSDL_TextureID textureID); /* Manipulation */ extern LEXSDL_SpriteID LEXSDL_SpriteClone(LEXSDL_SpriteID id); extern void LEXSDL_SpriteSkipFrames(LEXSDL_SpriteID id, uint32_t frames); extern void LEXSDL_SpriteSetFrame(LEXSDL_SpriteID id, uint32_t frame); extern void LEXSDL_SpriteStep(LEXSDL_SpriteID id); extern void LEXSDL_SpriteUpdate(LEXSDL_SpriteID id); /* Drawing */ extern void LEXSDL_SpriteDraw(LEXSDL_SpriteID id, int x, int y, int w, int h); extern void LEXSDL_SpriteDrawFlip(LEXSDL_SpriteID id, int x, int y, int w, int h); extern void LEXSDL_SpriteDrawFlipRot(LEXSDL_SpriteID id, int x, int y, int w, int h, double rot); extern void LEXSDL_SpriteDrawRot(LEXSDL_SpriteID id, int x, int y, int w, int h, double rot); /* Playing */ extern void LEXSDL_SpritePlay(LEXSDL_SpriteID id, int x, int y, int w, int h); extern void LEXSDL_SpritePlayBackground(LEXSDL_SpriteID id); extern void LEXSDL_SpritePlayFlip(LEXSDL_SpriteID id, int x, int y, int w, int h); extern void LEXSDL_SpritePlayFlipRot(LEXSDL_SpriteID id, int x, int y, int w, int h, double rot); extern void LEXSDL_SpritePlayRot(LEXSDL_SpriteID id, int x, int y, int w, int h, double rot); #endif