/* * DrawRect * -------- * This program automatically creates a window, and draws two * rectangles. * * The first rectangle is a red outline and the second rectangle * is filled in with blue. * * The rect function returns a rectangle. The syntax of the rect * function is: rect(x,y,width,height). The x and y co-ordinates * refer to the placement of the top-left point of the rectangle, * relative to the point (0,0) which is at the top-left of the * window. * * Hence, the first rectangle starts 10 pixels to the right and * 10 pixels down from the top-left point of the window. * * Both rectangle are 80 pixels wide and 10 pixels high. * * The setcolour function uses some pre-defined constants to * change the drawing colour. Red, Blue, Green, Black and White * can all be used. * * The drawrect function draws the outline of a rectangle, while * the fillrect function fills the rectangle in with colour. */ #include void main(void) { rect r = rect(10,10,80,10); setcolour(Red); drawrect(r); setcolour(Blue); fillrect(rect(10,40,80,10)); }