Bug fixes
[rodin/chimara.git] / interpreters / nitfol / graphics.c
1 #include "nitfol.h"
2
3 /* A bunch of trivial wrappers so we can get away with ignoring whether
4  * during compilation whether or not the glk library supports graphics.
5  *  
6  * Link this in only if you glk supports graphics */
7
8
9 #ifdef GLK_MODULE_IMAGE
10
11
12 glui32 wrap_glk_image_draw(winid_t win, glui32 image, glsi32 val1, glsi32 val2)
13 {
14   if(!glk_gestalt(gestalt_Graphics, 0))
15     return FALSE;
16   return glk_image_draw(win, image, val1, val2);
17 }
18
19
20 glui32 wrap_glk_image_draw_scaled(winid_t win, glui32 image, glsi32 val1, glsi32 val2, glui32 width, glui32 height)
21 {
22   if(!glk_gestalt(gestalt_Graphics, 0))
23     return FALSE;
24   return glk_image_draw_scaled(win, image, val1, val2, width, height);
25 }
26
27
28 glui32 wrap_glk_image_get_info(glui32 image, glui32 *width, glui32 *height)
29 {
30   if(!glk_gestalt(gestalt_Graphics, 0)) {
31     *width = 0; *height = 0;
32     return FALSE;
33   }
34   return glk_image_get_info(image, width, height);
35 }
36
37
38 #endif