2021-11-22 17:29:33 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <graph.h>
|
|
|
|
#include <time.h>
|
2021-11-24 10:24:18 +01:00
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
2021-11-22 17:29:33 +01:00
|
|
|
#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);
|
2021-11-24 10:24:18 +01:00
|
|
|
|
|
|
|
char screen[30] = "taquin";
|
|
|
|
|
2021-11-22 17:29:33 +01:00
|
|
|
while (1) {
|
2021-11-24 10:24:18 +01:00
|
|
|
if (RegisterInputs(screen) == -1) return EXIT_SUCCESS;
|
2021-11-22 17:29:33 +01:00
|
|
|
|
2021-11-24 10:24:18 +01:00
|
|
|
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);
|
|
|
|
}
|
2021-11-22 17:29:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
FermerGraphique();
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|