From a4d2d28a9d80ccc96952a53398d2ad2f02844530 Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Fri, 25 May 2018 21:53:41 +0200 Subject: [PATCH] Define primary structure --- gameMenu.c | 23 +++++++++++++++++++++++ gameMenu.h | 6 ++++++ playerInterface.c | 6 ++++-- playerInterface.h | 5 +++-- 4 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 gameMenu.c create mode 100644 gameMenu.h diff --git a/gameMenu.c b/gameMenu.c new file mode 100644 index 0000000..05e051e --- /dev/null +++ b/gameMenu.c @@ -0,0 +1,23 @@ +#include "SDL2/SDL.h" + +void initDisplayLib() { + if (SDL_Init(SDL_INIT_VIDEO) != 0) { + printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError()); + exit(EXIT_FAILURE); + } +} + +int createMainWindows() { + if (SDL_Init(SDL_INIT_VIDEO) != 0) { + printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError()); + exit(EXIT_FAILURE); + } + + SDL_Window *main_test; + main_test = SDL_CreateWindow("My test windows", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 140, SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); + SDL_Delay(5000); + SDL_DestroyWindow(main_test); + + SDL_Quit(); + return EXIT_SUCCESS; +} diff --git a/gameMenu.h b/gameMenu.h new file mode 100644 index 0000000..fe92f33 --- /dev/null +++ b/gameMenu.h @@ -0,0 +1,6 @@ +#ifndef GAMEMENU_H_ +#define GAMEMENU_H_ + + + +#endif diff --git a/playerInterface.c b/playerInterface.c index e4ca972..c848f48 100644 --- a/playerInterface.c +++ b/playerInterface.c @@ -1,16 +1,18 @@ #include "SDL2/SDL.h" -int createMainWindows() { +void initDisplayLib() { if (SDL_Init(SDL_INIT_VIDEO) != 0) { printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError()); exit(EXIT_FAILURE); } +} +void displayScreen(int scr_id) { SDL_Window *main_test; main_test = SDL_CreateWindow("My test windows", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 140, SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); SDL_Delay(5000); SDL_DestroyWindow(main_test); SDL_Quit(); - return EXIT_SUCCESS; + //return EXIT_SUCCESS; } diff --git a/playerInterface.h b/playerInterface.h index 189b17a..99701f1 100644 --- a/playerInterface.h +++ b/playerInterface.h @@ -1,6 +1,7 @@ #ifndef PLAYERINTERFACE_H_ #define PLAYERINTERFACE_H_ -int createMainWindows(); +void initDisplayLib(); +void displayScreen(int scr_id); -#endif /* PLAYERINTERFACE_H_ */ +#endif