Slightly changed the main to make the app run correctly

merge-requests/1/merge
marouault 4 years ago
parent 563350f190
commit 3a68c6f700

@ -5,7 +5,8 @@ SET(PROJECT_NAME Pontu)
project(${PROJECT_NAME})
file(GLOB_RECURSE MY_SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c)
add_executable(${PROJECT_NAME} ${MY_SOURCES})
add_executable(${PROJECT_NAME} ${MY_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/entryPoints/main.c)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

@ -1,5 +1,8 @@
#include <SDL2/SDL.h>
#include <stdio.h>
#include <stdbool.h>
#include "engine/InputProcessor.h"
#include "engine/InputElement.h"
int main(int argc, char* argv[])
{
@ -27,12 +30,44 @@ int main(int argc, char* argv[])
goto Quit;
}
SDL_bool quit = SDL_FALSE;
InputProcessor inputProcessor = {.selectedCase = {.x=-1, .y=-1}};
SDL_Rect rectBoard = {.x=20, .y=20, .w=99, .h=99};
bool quit = false;
while(!quit)
{
// Event handling
InputElement inputElement;
while (InputType_None != (inputElement = proccessInput(&inputProcessor, &rectBoard)).type) {
switch (inputElement.type)
{
case InputType_ActivateUI:
switch (inputElement.data.uiAction)
{
case UIAction_Quit:
quit = true;
break;
case UIAction_Validate:
break;
case UIAction_Cancel:
break;
default:
break;
}
break;
case InputType_MoveGame:
break;
case InputType_ClickGame:
break;
case InputType_None:
default:
break;
}
}
// Drawing
Loading…
Cancel
Save