C:/Users/Dennis/src/lang/bertrand/BERTRAND/bertrand/graphicsnull.c

Go to the documentation of this file.
00001 /*********************************************************
00002  *
00003  * Null graphics routines.
00004  *
00005  * If you do not have the capabilities for graphics output
00006  * you can use these routines to supply null stubs.
00007  *
00008  *********************************************************/
00009 
00010 #include "def.h"
00011 
00012 /* this variable is set to true when the graphics device has been opened */
00013 int graphics = FALSE;
00014 
00015 /* open graphics device */
00016 void
00017 graphics_init()
00018 {
00019 printf("null graphics device is open\n");
00020 graphics = TRUE;
00021 }
00022 
00023 /* Assume numbers in Bertrand are in inches */
00024 /* If other units are desired, simply use a different constant */
00025 #define INCHES 100      /* resolution of the screen, in pixels per inch */
00026 
00027 /* draw a line between two points */
00028 void
00029 draw_line(x1,y1,x2,y2)
00030 double x1, y1, x2, y2;
00031 {
00032 if (!graphics) graphics_init();
00033 printf("draw line from (%g,%g) to (%g,%g)\n", x1, y1, x2, y2);
00034 }
00035 
00036 /* paint a string, centered at a certain location */
00037 void
00038 draw_string(str,x,y)
00039 char *str;
00040 double x,y;
00041 {
00042 if (!graphics) graphics_init();
00043 printf("draw string \"%s\" at (%g,%g)\n", str, x, y);
00044 }
00045 
00046 /* close the graphics device, only called if graphics == TRUE */
00047 void
00048 graphics_close()
00049 {
00050 printf("close graphics device\n");
00051 graphics = FALSE;
00052 }

Generated on Fri Jan 25 09:58:43 2008 for Bertrand by  doxygen 1.5.4