still working on adding frames to config
This commit is contained in:
parent
3fa74e8f9e
commit
0591b6ca6e
10 changed files with 199 additions and 53 deletions
|
|
@ -19,6 +19,9 @@ typedef struct ARC_EngineData {
|
|||
ARC_Keyboard *keyboard;
|
||||
|
||||
double dt;
|
||||
uint32_t running;
|
||||
|
||||
ARC_Handler_CleanDataFn cleanfn;
|
||||
} ARC_EngineData;
|
||||
|
||||
//NOTE: most work below is temp, and will change once I figure out a better way to write this header
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
#ifdef ARC_SDL
|
||||
|
||||
#include <SDL.h>
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
#include "arc/graphics/sprite.h"
|
||||
|
||||
struct ARC_Sprite {
|
||||
ARC_Spritesheet *spritesheet;
|
||||
SDL_Rect *bounds;
|
||||
ARC_Rect *frames;
|
||||
uint32_t *frameSize;
|
||||
uint32_t *frameIndex;
|
||||
};
|
||||
|
||||
#endif // ARC_SDL
|
||||
|
|
|
|||
|
|
@ -5,8 +5,20 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/graphics/spritesheet.h"
|
||||
#include "arc/math/rectangle.h"
|
||||
|
||||
typedef struct ARC_Sprite ARC_Sprite;
|
||||
|
||||
void ARC_Sprite_Create(ARC_Sprite **sprite, ARC_Spritesheet *spritesheet, ARC_Rect *bounds);
|
||||
|
||||
void ARC_Sprite_Destroy(ARC_Sprite *sprite);
|
||||
|
||||
void ARC_Sprite_Render(ARC_Sprite *sprite, ARC_Renderer *renderer, ARC_Rect *renderBounds);
|
||||
|
||||
ARC_Rect *ARC_Sprite_GetBounds(ARC_Sprite *sprite);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ typedef enum ARC_MouseButton {
|
|||
void ARC_Mouse_Create(ARC_Mouse **mouse, ARC_MouseInfo *info);
|
||||
void ARC_Mouse_Destroy(ARC_Mouse *mouse);
|
||||
void ARC_Mouse_Update(ARC_Mouse *mouse);
|
||||
ARC_Point ARC_Mouse_GetCoords(ARC_Mouse *mouse);
|
||||
ARC_Point *ARC_Mouse_GetCoords(ARC_Mouse *mouse);
|
||||
ARC_MouseState ARC_Mouse_GetState(ARC_Mouse *mouse, ARC_MouseButton button);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef ARC_MATH_RECT_H_
|
||||
#define ARC_MATH_RECT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct ARC_Rect {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
int32_t w;
|
||||
int32_t h;
|
||||
} ARC_Rect;
|
||||
|
||||
typedef struct ARC_URect {
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
} ARC_URect;
|
||||
|
||||
#endif // ARC_MATH_POINT_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue