merged from herbglitch/master
This commit is contained in:
commit
2f221987af
21 changed files with 339 additions and 10 deletions
16
include/arc/audio/audio.h
Normal file
16
include/arc/audio/audio.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef ARC_AUDIO_H_
|
||||
#define ARC_AUDIO_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct ARC_Audio ARC_Audio;
|
||||
|
||||
void ARC_Audio_Play(ARC_Audio *audio);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !ARC_AUDIO_H_
|
||||
22
include/arc/audio/config.h
Normal file
22
include/arc/audio/config.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#ifndef ARC_AUDIO_CONFIG_H_
|
||||
#define ARC_AUDIO_CONFIG_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include "arc/std/string.h"
|
||||
|
||||
typedef struct ARC_Config ARC_Config;
|
||||
void ARC_AudioConfig_Init(ARC_Config *config);
|
||||
|
||||
uint8_t ARC_Audio_Read(ARC_Config *config, ARC_String *string, void **value);
|
||||
|
||||
void ARC_Audio_Delete(ARC_Config *config, ARC_String *string, void *value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //ARC_AUDIO_CONFIG_H_
|
||||
12
include/arc/audio/sdl/audio.h
Normal file
12
include/arc/audio/sdl/audio.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#ifndef ARC_SDL_AUDIO_H_
|
||||
#define ARC_SDL_AUDIO_H_
|
||||
|
||||
#ifdef ARC_SDL
|
||||
#include <SDL2/SDL_mixer.h>
|
||||
|
||||
typedef struct ARC_Audio {
|
||||
Mix_Chunk *chunk;
|
||||
} ARC_Audio;
|
||||
|
||||
#endif // !ARC_SDL
|
||||
#endif // !ARC_SDL_AUDIO_H_
|
||||
|
|
@ -12,7 +12,7 @@ extern "C" {
|
|||
|
||||
void ARC_Circle_Render(ARC_Circle *circle, ARC_Renderer *renderer, ARC_Color *color);
|
||||
|
||||
// void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color);
|
||||
void ARC_Circle_RenderFill(ARC_Circle *circle, ARC_Renderer *renderer, ARC_Color *color);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ struct ARC_Sprite {
|
|||
ARC_Spritesheet *spritesheet;
|
||||
ARC_Array *frames;
|
||||
uint32_t *frameIndex;
|
||||
//TODO: temp
|
||||
uint8_t opacity;
|
||||
};
|
||||
|
||||
#endif // !ARC_SDL
|
||||
|
|
|
|||
|
|
@ -42,6 +42,18 @@ void ARC_Sprite_Destroy(ARC_Sprite *sprite);
|
|||
*/
|
||||
void ARC_Sprite_Copy(ARC_Sprite **newSprite, ARC_Sprite *oldSprite);
|
||||
|
||||
//TODO: temp
|
||||
/**
|
||||
* @brief sets ARC_Sprite's opacity
|
||||
*
|
||||
* @param sprite ARC_Sprite that is changing opacity
|
||||
* @param opacity new opacity for ARC_Sprite
|
||||
*
|
||||
* @note this is temp because opacity probably should be a value
|
||||
* bigger than 255
|
||||
*/
|
||||
void ARC_Sprite_SetOpacity(ARC_Sprite *sprite, uint8_t opacity);
|
||||
|
||||
/**
|
||||
* @brief renders ARC_Sprite type
|
||||
*
|
||||
|
|
@ -94,6 +106,15 @@ void ARC_Sprite_SetFrameIndex(ARC_Sprite *sprite, uint32_t index);
|
|||
*/
|
||||
void ARC_Sprite_IterateFrame(ARC_Sprite *sprite);
|
||||
|
||||
/**
|
||||
* @brief gets ARC_Sprite's current frame
|
||||
*
|
||||
* @param sprite ARC_Sprite to get frame from
|
||||
*
|
||||
* @return index ARC_Sprite's current frame index
|
||||
*/
|
||||
uint32_t ARC_Sprite_GetFrameIndex(ARC_Sprite *sprite);
|
||||
|
||||
/**
|
||||
* @brief returns the current bounds based on the ARC_Sprite's frames
|
||||
*
|
||||
|
|
|
|||
59
include/arc/graphics/view.h
Normal file
59
include/arc/graphics/view.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#ifndef ARC_GRAPHICS_VIEW_H_
|
||||
#define ARC_GRAPHICS_VIEW_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/math/rectangle.h"
|
||||
|
||||
typedef struct ARC_View {
|
||||
ARC_Renderer *renderer;
|
||||
ARC_Rect bounds;
|
||||
} ARC_View;
|
||||
|
||||
/**
|
||||
* @brief a function for ARC_View where contents of the function will be rendered within a view
|
||||
*
|
||||
* @param data data to be used within ARC_View_RenderFn
|
||||
*/
|
||||
typedef void (* ARC_View_RenderFn)(void *data);
|
||||
|
||||
/**
|
||||
* @brief creates ARC_View type
|
||||
*
|
||||
* @param view ARC_View to initialize
|
||||
* @param renderer ARC_Renderer the view will render to
|
||||
* @param bounds ARC_Rect bounds of the view within the renderer
|
||||
*/
|
||||
void ARC_View_Create(ARC_View **view, ARC_Renderer *renderer, ARC_Rect bounds);
|
||||
|
||||
/**
|
||||
* @brief destroys ARC_View type
|
||||
*/
|
||||
void ARC_View_Destroy(ARC_View *view);
|
||||
|
||||
/**
|
||||
* @brief renders callbacks contents within an ARC_View
|
||||
*
|
||||
* @param view ARC_View to be renedered to
|
||||
* @param renderFn function which contents will render to given ARC_View
|
||||
* @param data data to be used in renderFn
|
||||
*/
|
||||
void ARC_View_Render(ARC_View *view, ARC_View_RenderFn renderFn, void *data);
|
||||
|
||||
/**
|
||||
* @brief gets bounds from ARC_View type
|
||||
*
|
||||
* @param view ARC_View to get bounds from
|
||||
*
|
||||
* @return bounds of the view
|
||||
*/
|
||||
ARC_Rect ARC_View_GetBounds(ARC_View *view);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !ARC_GRAPHICS_VIEW_H_
|
||||
|
|
@ -64,6 +64,7 @@ typedef enum ARC_KeyboardKey {
|
|||
|
||||
ARC_KEY_SPACE,
|
||||
ARC_KEY_ESC,
|
||||
ARC_KEY_ENTER,
|
||||
} ARC_Keyboard_Key;
|
||||
|
||||
ARC_KeyboardState ARC_Keyboard_GetState(ARC_Keyboard *keyboard, enum ARC_KeyboardKey key);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ typedef struct ARC_FPoint {
|
|||
float y;
|
||||
} ARC_FPoint;
|
||||
|
||||
ARC_FPoint ARC_FPoint_Lerp(ARC_FPoint *start, ARC_FPoint *end, float t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue