APL/APL1.1/SAE11_2021/main.c
2021-11-24 10:24:18 +01:00

43 lines
1019 B
C

#include <stdio.h>
#include <stdlib.h>
#include <graph.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include "utils.h"
#include "graph_sup.h"
#include "lib_taquin/taquin.h"
#include "lib_menu/menu.h"
int main(void) {
InitialiserGraphique();
CreerFenetre(100, 100, 1200, 700);
char screen[30] = "taquin";
while (1) {
if (RegisterInputs(screen) == -1) return EXIT_SUCCESS;
if (DrawNextFrame()) {
EffacerEcran(CouleurParNom("white"));
SourisPosition();
clearButtons();
double x = (double)Microsecondes() / 100000.0;
AddButton(300+sin(x)*50, 300+cos(x)*50, 100, 100, "owo");
AddButton(500+cos(x)*50, 500+sin(x)*50, 100, 100, "owo2");
for (int i = 0; i < BT_Count; i++) {
button BT = Buttons[i];
char* ID = GetButton(_X, _Y);
if (!strcmp(ID, BT.id)) {
ChoisirCouleurDessin(CouleurParNom("red"));
} else ChoisirCouleurDessin(CouleurParNom("black"));
DessinerRectangle(BT.x, BT.y, BT.w, BT.h);
}
}
}
FermerGraphique();
return EXIT_SUCCESS;
}