File: r1_sub.c

package info (click to toggle)
coolmail 1.3-13
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: ansic: 1,527; makefile: 69
file content (66 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download | duplicates (9)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* r1_sub.c
 *
 * By Byron C. Darrah
 * 10-May-1994, Tuesday
 *
 * This is a short program for testing the system-dependent
 * display_list routines.  It substitues itself for render1 (hence the
 * name, r1_sub) by calling the display routines directly.
 *
 * If the test is successfull, r1_sub will display a blue rectangle on
 * top of a red diamond.
 */

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

#include "display_list.h"

polygon_t diamond;
polygon_t rectangle;
int_point_t diamond_points[] =
{
   {100, 25},
   {150, 100},
   {100, 175},
   { 50, 100}
};
int_point_t rectangle_points[] =
{
   {50, 50},
   {100, 50},
   {100, 100},
   {50, 100}
};

int main(int argc, char *argv[])
{
   polygon_node_t polys[2];
   polys[0].next = polys+1;
   polys[1].next = NULL;
   polys[0].k = 6.0;
   polys[1].k = 1.0;
   
   polys[0].polygon = &diamond;
   polys[1].polygon = &rectangle;

   diamond.color   = RED;
   diamond.npoints = 4;
   diamond.int_points = diamond_points;

   rectangle.color   = BLUE;
   rectangle.npoints = 4;
   rectangle.int_points = rectangle_points;

   disp_init(&argc, argv);

   disp_polygons(polys);
 
   disp_freeze();

   disp_end();

   return(0);
}