#ifndef _LEXSDL_TEXTURE_H_ #define _LEXSDL_TEXTURE_H_ /* "Constants" */ #define LEXSDL_TextureIDInvalid 0xFFFFFFFF #define LEXSDL_TextureInvalid 0xFFFFFFFE #define LEXSDL_TextureCreationFailed 0xFFFFFFFD #define LEXSDL_TextureAddingFailed 0xFFFFFFFC #define LEXSDL_TextureOperationSucceded 0xFFFFFFFA /* Types */ typedef uint32_t LEXSDL_TextureID; /* Creation/Loading */ extern LEXSDL_TextureID LEXSDL_TextureAdd(SDL_Texture *texture); extern LEXSDL_TextureID LEXSDL_TextureLoad(const char* file); extern LEXSDL_TextureID LEXSDL_TextureLoadBytes(const unsigned char* data, int len); /* Getters */ extern SDL_Texture* LEXSDL_TextureGet(int id); /* Manipulation */ extern int LEXSDL_TextureChangeAlpha(LEXSDL_TextureID id, uint8_t a); extern int LEXSDL_TextureChangeColor(LEXSDL_TextureID id, uint8_t r, uint8_t g, uint8_t b); extern int LEXSDL_TextureDestroy(LEXSDL_TextureID id); /* Drawing */ extern void LEXSDL_TextureDraw(LEXSDL_TextureID id, SDL_Rect *srcrect, SDL_Rect *dstrect); extern void LEXSDL_TextureDrawAt(LEXSDL_TextureID id, int x, int y, int w, int h); extern void LEXSDL_TextureDrawFill(LEXSDL_TextureID id); extern void LEXSDL_TextureDrawRot(LEXSDL_TextureID id, SDL_Rect *srcrect, SDL_Rect *dstrect, double rot); extern void LEXSDL_TextureDrawRotAt(LEXSDL_TextureID id, int x, int y, int w, int h, double rot); extern void LEXSDL_TextureDrawRotCenterAt(LEXSDL_TextureID id, int x, int y, int w, int h, double rot, int cx, int cy); #endif