42 lines
No EOL
941 B
C
42 lines
No EOL
941 B
C
#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
|