f***ed up and needed to rework packages
This commit is contained in:
parent
b43ab1702f
commit
f7a87d7519
78 changed files with 3713 additions and 0 deletions
42
packages/input/glfw/input.c
Normal file
42
packages/input/glfw/input.c
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#ifdef ARC_GLFW_INPUT
|
||||
#include "arc/input/input.h"
|
||||
|
||||
#include "arc/input/mouse.h"
|
||||
#include "arc/input/keyboard.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct ARC_Input {
|
||||
ARC_Keyboard *keyboard;
|
||||
ARC_Mouse *mouse;
|
||||
|
||||
GLFWwindow *window;
|
||||
};
|
||||
|
||||
void ARC_Input_CreateWithEngineData(ARC_Input **input, ARC_EngineData *data){
|
||||
*input = (ARC_Input *)malloc(sizeof(ARC_Input));
|
||||
|
||||
(*input)->event = (SDL_Event *)malloc(sizeof(SDL_Event));
|
||||
|
||||
ARC_Keyboard_CreateWithEngineData(&(*input)->keyboard, data);
|
||||
ARC_Keyboard_CreateWithEngineData(&(*input)->mouse, data);
|
||||
}
|
||||
|
||||
void ARC_Input_Destroy(ARC_Input *input){
|
||||
ARC_Keyboard_Destroy(input->keyboard);
|
||||
ARC_Mouse_Destroy(input->mouse);
|
||||
|
||||
free(input->event);
|
||||
free(input);
|
||||
}
|
||||
|
||||
ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input){
|
||||
return input->keyboard;
|
||||
}
|
||||
|
||||
ARC_Mouse *ARC_Input_GetMouse(ARC_Input *input){
|
||||
return input->mouse;
|
||||
}
|
||||
|
||||
#endif // ARC_SDL2_INPUT
|
||||
Loading…
Add table
Add a link
Reference in a new issue