-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.c
39 lines (30 loc) · 824 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//------------------------------------------------
// POOL GAME
// Created by Stefano Rossi and Riccardo Piccolo
//------------------------------------------------
#include "init_t.h"
#include "ptask.h"
#include <allegro.h>
#include <pthread.h>
int main(void) {
int i; // temporary variable
init();
// balls task creation
for (i = 0; i < NUM_BALLS; i++) {
ptask_create_edf(ball_task, MS, B_EX_T, B_DL, NOW);
}
// user task creation
user_id = ptask_create_edf(user_task, MS, U_EX_T, U_DL, NOW);
// graphic task creation
graphics_id = ptask_create_edf(graphics_task, MS, G_EX_T, MS, NOW);
while (!key[KEY_ESC]) {
};
for (i = 0; i < NUM_BALLS; i++) {
destroy_bitmap(balls[i]);
}
destroy_bitmap(bground);
destroy_bitmap(cue);
destroy_bitmap(buf);
allegro_exit();
return 0;
}