From 78c24a6541d11bd090935d67b908454f74301065 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Sat, 29 Nov 2025 20:25:05 +0100 Subject: [PATCH] =?UTF-8?q?POur=20l'instant=20le=20progmme=20pert=20seulem?= =?UTF-8?q?ent=20d'ouvrir=20une=20fen=C3=AAtre=20d'affichage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 34 ++++++++++++++++++++++++++++++++++ affichage.c | 13 +++++++++++++ affichage.h | 8 ++++++++ main.c | 19 +++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 Makefile create mode 100644 affichage.c create mode 100644 affichage.h create mode 100644 main.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c2ce303 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +### VARIABLES ### +CC = gcc +CFLAGS = -Wall \ + -ansi \ + -pedantic +LIBS = -lgraph +EXE = taquin +OFILES = main.o \ + affichage.o + +### BUT PAR DEFAUT ### +but : ${EXE} + +### REGLES ESSENTIELLES ### +affichage.o : affichage.h + +main.o : affichage.h + +${EXE} : ${OFILES} + $(CC) $(CFLAGS) -o ${EXE} ${OFILES} ${LIBS} + +### REGLES OPTIONNELLES ### +run : but + ./${EXE} + +clean : + -rm -f ${OFILES} ${EXE} + +mrproper : clean but + +### BUTS FACTICES ### +.PHONY : but clean mrproper run + +### FIN ### diff --git a/affichage.c b/affichage.c new file mode 100644 index 0000000..d3c38d7 --- /dev/null +++ b/affichage.c @@ -0,0 +1,13 @@ +#include "affichage.h" +#include + +void init_affichage(void){ + + InitialiserGraphique(); + CreerFenetre(100, 100, 800, 600); +} + +void fermer_affichage(void){ + + FermerGraphique(); +} diff --git a/affichage.h b/affichage.h new file mode 100644 index 0000000..7802388 --- /dev/null +++ b/affichage.h @@ -0,0 +1,8 @@ +#ifndef AFFICHAGE_H +#define AFFICHAGE_H + +void init_affichage(void); +void fermer_affichage(void); + + +#endif diff --git a/main.c b/main.c new file mode 100644 index 0000000..2555130 --- /dev/null +++ b/main.c @@ -0,0 +1,19 @@ +#include "affichage.h" +#include +#include +int main(void){ + int k; + init_affichage(); + + while(1){ + + if (ToucheEnAttente()){ + k = Touche(); + if (k == XK_q)break; + + } + + } + fermer_affichage(); + return 0; +}