Files

50 lines
1.0 KiB
C

#ifndef ENGINE_SPRITE_H
#define ENGINE_SPRITE_H
#include <raylib.h>
typedef struct {
Texture2D texture;
Rectangle sourceRec;
Rectangle destRec;
Vector2 frameSize;
Vector2 origin;
float rotation;
Color color;
} Sprite;
typedef struct {
const char *path;
float frameWidth;
float frameHeight;
float rotation;
} TextureAsset;
typedef struct {
const char *path;
} ShaderAsset;
typedef struct {
const char *path;
} SoundtrackAsset;
typedef struct {
const char *path;
} SoundAsset;
typedef struct {
const TextureAsset *textureAssets;
const ShaderAsset *shaderAssets;
const SoundtrackAsset *soundtrackAssets;
const SoundAsset *soundAssets;
} Assets;
void UpdateSpriteSourceRec(Sprite *sprite, const Vector2 *vector);
void UpdateSpriteDestRec(Sprite *sprite, const Vector2 *vector);
void UpdateSpriteRotation(Sprite *sprite, float rotation);
void UpdateSpriteRotationTowards(Sprite *sprite, float rotation, float degreesPerSecond,
float deltaTime);
void RenderSprite(const Sprite *sprite);
#endif