Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Commit last experimental bits (dated December 6th, 2013).
[graphlib.git] / simpledw / SimpleDW.h
1 #ifndef SIMPLE_DW_H
2 #define SIMPLE_DW_H
3
4 #include <string>
5
6 void drawText(int x, int y, const char *text, int flags = 0);
7 void drawText(int x, int y, const std::string &text, int flags = 0);
8
9 #define SDW_CHECK_ARGS(A, B, ...) SDW_CHECK_ARGS_(__VA_ARGS__, B, A)
10 #define SDW_CHECK_ARGS_(a2, a1, X, ...) X
11
12 #define call0()                                         \
13     simpleDW_user_main()
14
15 #define call2()                                         \
16     extern int global_argc;                             \
17     extern char **global_argv;                          \
18     simpleDW_user_main(global_argc, global_argv)
19
20 #define main(...)                                         \
21     simpleDW_user_main(__VA_ARGS__);                      \
22     void simpleDW_user_main_wrapper()                     \
23     {                                                     \
24         SDW_CHECK_ARGS(call0(), call2(), __VA_ARGS__);    \
25     }                                                     \
26     int simpleDW_user_main(__VA_ARGS__)
27
28 #endif // !SIMPLE_DW_H