temp update to now close sdl windows on exit
This commit is contained in:
parent
6d64a17b1d
commit
a8c8324fac
3 changed files with 11 additions and 5 deletions
|
|
@ -7,6 +7,7 @@ extern "C" {
|
||||||
|
|
||||||
#include "arc/input/keyboard.h"
|
#include "arc/input/keyboard.h"
|
||||||
#include "arc/input/mouse.h"
|
#include "arc/input/mouse.h"
|
||||||
|
#include "arc/std/bool.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief predefien ARC_EngineData so as not to get circular reference
|
* @brief predefien ARC_EngineData so as not to get circular reference
|
||||||
|
|
@ -19,7 +20,7 @@ void ARC_Input_CreateWithEngineData(ARC_Input **input, ARC_EngineData *data);
|
||||||
|
|
||||||
void ARC_Input_Destroy(ARC_Input *input);
|
void ARC_Input_Destroy(ARC_Input *input);
|
||||||
|
|
||||||
void ARC_Input_Update(ARC_Input *input);
|
ARC_Bool ARC_Input_Update(ARC_Input *input);
|
||||||
|
|
||||||
ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input);
|
ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input);
|
||||||
|
|
||||||
|
|
@ -29,4 +30,4 @@ ARC_Mouse *ARC_Input_GetMouse(ARC_Input *input);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // !ARC_INPUT_H_
|
#endif // !ARC_INPUT_H_
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,16 @@ void ARC_Input_Destroy(ARC_Input *input){
|
||||||
free(input);
|
free(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARC_Input_Update(ARC_Input *input){
|
ARC_Bool ARC_Input_Update(ARC_Input *input){
|
||||||
SDL_PollEvent(input->event);
|
SDL_PollEvent(input->event);
|
||||||
|
if(input->event->type == SDL_QUIT){
|
||||||
|
return ARC_False;
|
||||||
|
}
|
||||||
|
|
||||||
ARC_Keyboard_Update(input->keyboard);
|
ARC_Keyboard_Update(input->keyboard);
|
||||||
ARC_Mouse_Update(input->mouse);
|
ARC_Mouse_Update(input->mouse);
|
||||||
|
|
||||||
|
return ARC_True;
|
||||||
}
|
}
|
||||||
|
|
||||||
ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input){
|
ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input){
|
||||||
|
|
@ -37,4 +42,4 @@ ARC_Keyboard *ARC_Input_GetKeyboard(ARC_Input *input){
|
||||||
|
|
||||||
ARC_Mouse *ARC_Input_GetMouse(ARC_Input *input){
|
ARC_Mouse *ARC_Input_GetMouse(ARC_Input *input){
|
||||||
return input->mouse;
|
return input->mouse;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ void ARC_Engine_RunUncapped(ARC_EngineData *data){
|
||||||
// data->dt = currentTime - lastTime;
|
// data->dt = currentTime - lastTime;
|
||||||
// lastTime = currentTime;
|
// lastTime = currentTime;
|
||||||
|
|
||||||
ARC_Input_Update(data->input);
|
data->running = ARC_Input_Update(data->input);
|
||||||
|
|
||||||
ARC_Handler_Clean(data->state);
|
ARC_Handler_Clean(data->state);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue