Define primary structure
This commit is contained in:
parent
fce9114443
commit
a4d2d28a9d
23
gameMenu.c
Normal file
23
gameMenu.c
Normal file
@ -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;
|
||||||
|
}
|
6
gameMenu.h
Normal file
6
gameMenu.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef GAMEMENU_H_
|
||||||
|
#define GAMEMENU_H_
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
@ -1,16 +1,18 @@
|
|||||||
#include "SDL2/SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
|
|
||||||
int createMainWindows() {
|
void initDisplayLib() {
|
||||||
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
|
||||||
printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError());
|
printf("Erreur chargement librairie SDL ! %s\n",SDL_GetError());
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void displayScreen(int scr_id) {
|
||||||
SDL_Window *main_test;
|
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);
|
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_Delay(5000);
|
||||||
SDL_DestroyWindow(main_test);
|
SDL_DestroyWindow(main_test);
|
||||||
|
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return EXIT_SUCCESS;
|
//return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef PLAYERINTERFACE_H_
|
#ifndef PLAYERINTERFACE_H_
|
||||||
#define PLAYERINTERFACE_H_
|
#define PLAYERINTERFACE_H_
|
||||||
|
|
||||||
int createMainWindows();
|
void initDisplayLib();
|
||||||
|
void displayScreen(int scr_id);
|
||||||
|
|
||||||
#endif /* PLAYERINTERFACE_H_ */
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user