diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c29054..832c25e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,9 +46,9 @@ add_executable(game_solve game_solve.c) target_link_libraries(game_solve game) # game_sdl -include_directories(${SDL2_ALL_INC}) -add_executable(game_sdl main.c model.c) -target_link_libraries(game_sdl game ${SDL2_ALL_LIBS} m) +# include_directories(${SDL2_ALL_INC}) +# add_executable(game_sdl main.c model.c) +# target_link_libraries(game_sdl game ${SDL2_ALL_LIBS} m) # libgame add_library (game game.c game_aux.c game_ext.c game_private.c history.c game_tools.c game_examples.c) diff --git a/boutons_img/New_game_down.png b/boutons_img/New_game_down.png new file mode 100644 index 0000000..ade2483 Binary files /dev/null and b/boutons_img/New_game_down.png differ diff --git a/boutons_img/New_game_up.png b/boutons_img/New_game_up.png new file mode 100644 index 0000000..3b317bf Binary files /dev/null and b/boutons_img/New_game_up.png differ diff --git a/boutons_img/redo_down.png b/boutons_img/redo_down.png new file mode 100644 index 0000000..4a4fe3d Binary files /dev/null and b/boutons_img/redo_down.png differ diff --git a/boutons_img/redo_up.png b/boutons_img/redo_up.png new file mode 100644 index 0000000..ef1b2a4 Binary files /dev/null and b/boutons_img/redo_up.png differ diff --git a/boutons_img/restart_down.png b/boutons_img/restart_down.png new file mode 100644 index 0000000..867c87b Binary files /dev/null and b/boutons_img/restart_down.png differ diff --git a/boutons_img/restart_up.png b/boutons_img/restart_up.png new file mode 100644 index 0000000..0068027 Binary files /dev/null and b/boutons_img/restart_up.png differ diff --git a/boutons_img/undo_down.png b/boutons_img/undo_down.png new file mode 100644 index 0000000..6bbe99d Binary files /dev/null and b/boutons_img/undo_down.png differ diff --git a/boutons_img/undo_up.png b/boutons_img/undo_up.png new file mode 100644 index 0000000..288cf1b Binary files /dev/null and b/boutons_img/undo_up.png differ diff --git a/model.c b/model.c index 7225bd6..ebff75d 100644 --- a/model.c +++ b/model.c @@ -11,7 +11,14 @@ /* **************************************************************** */ struct Env_t { - /* PUT YOUR VARIABLES HERE */ + SDL_Texture* but_new_game_up; + SDL_Texture* but_new_game_down; + SDL_Texture* but_undo_up; + SDL_Texture* but_undo_down; + SDL_Texture* but_redo_up; + SDL_Texture* but_redo_down; + SDL_Texture* but_solve_up; + SDL_Texture* but_solve_down; }; /* **************************************************************** */ @@ -32,12 +39,27 @@ void render(SDL_Window* win, SDL_Renderer* ren, Env* env) { /* PUT YOUR CODE HER /* **************************************************************** */ bool process(SDL_Window* win, SDL_Renderer* ren, Env* env, SDL_Event* e) { + int w, h; + SDL_GetWindowSize(win, &w, &h); + if (e->type == SDL_QUIT) { - return true; + return true; + } + +#ifdef _ANDROID_ +#else + + else if (e->type == SDL_WINDOWEVENT){ + init(win, ren , w, h/*(w, h) a changer*/); } - - /* PUT YOUR CODE HERE TO PROCESS EVENTS */ - + else if (e->type == SDL_SDL_MOUSEMOTION){ + SDL_Point mouse; + SDL_GetMouseState(&mouse.x, &mouse.y); + } + else if (e->type == SDL_MOUSEBUTTONDOWN){ + + } +#endif return false; }