input and handler possibly fixed
This commit is contained in:
parent
31b8730a61
commit
d6281e8eac
11 changed files with 84 additions and 59 deletions
|
|
@ -7,12 +7,16 @@ extern "C" {
|
|||
|
||||
#include "arc/graphics/window.h"
|
||||
#include "arc/graphics/renderer.h"
|
||||
#include "arc/input/mouse.h"
|
||||
#include "arc/input/keyboard.h"
|
||||
#include "arc/std/handler.h"
|
||||
|
||||
typedef struct ARC_EngineData {
|
||||
ARC_Window *window;
|
||||
ARC_Renderer *renderer;
|
||||
ARC_Handler *state;
|
||||
ARC_Mouse *mouse;
|
||||
ARC_Keyboard *keyboard;
|
||||
|
||||
double dt;
|
||||
} ARC_EngineData;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,12 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (* ARC_State_UpdateFn)(void *data);
|
||||
typedef void (* ARC_State_RenderFn)(void *data);
|
||||
typedef struct ARC_State {
|
||||
void (* updateFn)();
|
||||
void (* renderFn)();
|
||||
ARC_State_UpdateFn updateFn;
|
||||
ARC_State_RenderFn renderFn;
|
||||
void *data;
|
||||
} ARC_State;
|
||||
|
||||
void ARC_State_Update(void *data);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#include "arc/std/config.h"
|
||||
#include "arc/graphics/renderer.h"
|
||||
|
||||
|
|
@ -14,4 +14,4 @@ void ARC_GraphicsConfig_Init(ARC_Config *config, ARC_Renderer *renderer);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // !ARC_GRAPHICS_CONFIG_H_
|
||||
#endif // !ARC_GRAPHICS_CONFIG_H_
|
||||
|
|
@ -18,7 +18,7 @@ typedef struct ARC_RenderInfo ARC_RenderInfo;
|
|||
* @param renderer ARC_Renderer to initialize
|
||||
* @param info Info on how to create ARC_Window
|
||||
*/
|
||||
void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *data);
|
||||
void ARC_Renderer_Create(ARC_Renderer **renderer, ARC_RenderInfo *info);
|
||||
|
||||
/**
|
||||
* @brief destroys ARC_Renderer type
|
||||
|
|
|
|||
|
|
@ -1,30 +1,12 @@
|
|||
#ifndef ARC_MATH_VECTOR2_H_
|
||||
#define ARC_MATH_VECTOR2_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct ARC_Vector2 {
|
||||
int32_t x, y;
|
||||
} ARC_Vector2;
|
||||
|
||||
typedef struct ARC_UVector2 {
|
||||
uint32_t x, y;
|
||||
} ARC_UVector2;
|
||||
|
||||
typedef struct ARC_FVector2 {
|
||||
float x, y;
|
||||
} ARC_FVector2;
|
||||
} ARC_Vector2;
|
||||
|
||||
typedef struct ARC_DVector2 {
|
||||
double x, y;
|
||||
} ARC_DVector2;
|
||||
|
||||
typedef struct ARC_LVector2 {
|
||||
int64_t x, y;
|
||||
} ARC_LVector2;
|
||||
|
||||
typedef struct ARC_ULVector2 {
|
||||
uint64_t x, y;
|
||||
} ARC_ULVector2;
|
||||
|
||||
#endif // ARC_MATH_VECTOR2_H_
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
#define ARC_ERRNO_COPY -0x03
|
||||
#define ARC_ERRNO_EXISTS -0x04
|
||||
#define ARC_ERRNO_OVERFLOW -0x05
|
||||
|
||||
#define ARC_ERRNO_INIT -0x06
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
static int32_t arc_errno = 0;
|
||||
// #pragma GCC diagnostic pop
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue