merged herbglitch/master with local changes
This commit is contained in:
commit
a0c02c0dcd
26 changed files with 329 additions and 38 deletions
|
|
@ -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_
|
||||
Loading…
Add table
Add a link
Reference in a new issue