Merge branch 'main' of gitlab.emi.u-bordeaux.fr:pt2/teams-s4/tm07/lightup-07c
No files matched your search
@@ -46,9 +46,9 @@ add_executable(game_solve game_solve.c)
|
|||||||
target_link_libraries(game_solve game)
|
target_link_libraries(game_solve game)
|
||||||
|
|
||||||
# game_sdl
|
# game_sdl
|
||||||
include_directories(${SDL2_ALL_INC})
|
# include_directories(${SDL2_ALL_INC})
|
||||||
add_executable(game_sdl main.c model.c)
|
# add_executable(game_sdl main.c model.c)
|
||||||
target_link_libraries(game_sdl game ${SDL2_ALL_LIBS} m)
|
# target_link_libraries(game_sdl game ${SDL2_ALL_LIBS} m)
|
||||||
|
|
||||||
# libgame
|
# libgame
|
||||||
add_library (game game.c game_aux.c game_ext.c game_private.c history.c game_tools.c game_examples.c)
|
add_library (game game.c game_aux.c game_ext.c game_private.c history.c game_tools.c game_examples.c)
|
||||||
|
|||||||
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -11,7 +11,14 @@
|
|||||||
/* **************************************************************** */
|
/* **************************************************************** */
|
||||||
|
|
||||||
struct Env_t {
|
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) {
|
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) {
|
if (e->type == SDL_QUIT) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PUT YOUR CODE HERE TO PROCESS EVENTS */
|
#ifdef _ANDROID_
|
||||||
|
#else
|
||||||
|
|
||||||
|
else if (e->type == SDL_WINDOWEVENT){
|
||||||
|
init(win, ren , w, h/*(w, h) a changer*/);
|
||||||
|
}
|
||||||
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||