SAE11_2022/test.c

34 lines
642 B
C
Raw Normal View History

#include <stdlib.h>
#include <graph.h>
int main(void){
int i,j;
2022-11-28 10:02:00 +01:00
int x=1;
int touche;
InitialiserGraphique();
CreerFenetre(10,10,1000,1000);
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
2022-11-28 10:02:00 +01:00
while(1){
if (ToucheEnAttente()){
touche = Touche();
if (touche == XK_t)
x = -x;
if (x==-1){
EffacerEcran(CouleurParComposante(255,255,255));
ChoisirCouleurDessin(CouleurParComposante(255,0,0));
EcrireTexte(10,10,"mode triche",2);
}
if (x==1){
EffacerEcran(CouleurParComposante(255,255,255));
}
if (touche == XK_space)
break;
}
}
FermerGraphique();
return EXIT_SUCCESS;
}