Ajout des travaux effectuer
This commit is contained in:
37
23DEV1.1/SAE/1-SAE/Test.c
Normal file
37
23DEV1.1/SAE/1-SAE/Test.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <graph.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#define DELTA 1000000L;
|
||||
|
||||
void DessinerScene(int n) {
|
||||
couleur c;
|
||||
char buf[100];
|
||||
c = CouleurParNom("white");
|
||||
ChoisirCouleurDessin(c);
|
||||
RemplirRectangle(0,0,100,100);
|
||||
c = CouleurParNom("black");
|
||||
ChoisirCouleurDessin(c);
|
||||
snprintf(buf, 100, "Temps : %05d", n);
|
||||
EcrireTexte(10,20,buf,0);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int n;
|
||||
couleur c;
|
||||
unsigned long suivant;
|
||||
InitialiserGraphique();
|
||||
CreerFenetre(10,10,800,500);
|
||||
n = 0;
|
||||
suivant = Microsecondes()+DELTA;
|
||||
while(1){
|
||||
if(Microsecondes()>suivant) {
|
||||
n++;
|
||||
DessinerScene(n);
|
||||
suivant = Microsecondes()+DELTA;
|
||||
}
|
||||
}
|
||||
Touche();
|
||||
FermerGraphique();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user