Screen Properties

You do not have to hard code the size of the screen or the number of colors available in your program. Instead, you can find this information out dynamically after the connection is made to the graphics server, by using the GrGetScreenInfo call. This returns the above information, and in addition returns the color values for black and white, the aspect ratio of pixels, the number of built-in fonts available, and the modifiers and buttons which are available. The aspect ratio is useful for drawing objects which need to be scaled correctly, such as circles. The aspect ratio is the quotient of xdpcm and ydpcm, which are integer values.

typedef struct {
	GR_SIZE		rows;		/* number of rows on screen */
	GR_SIZE		cols;		/* number of columns on screen */
	GR_SIZE		xdpcm;		/* dots/centimeter in x direction */
	GR_SIZE		ydpcm;		/* dots/centimeter in y direction */
	GR_COLOR	maxcolor;	/* maximum legal color value */
	GR_COLOR	black;		/* the color black */
	GR_COLOR	white;		/* the color white */
	GR_COUNT	fonts;		/* number of built-in fonts */
	GR_BUTTON	buttons;	/* buttons which are implemented */
	GR_MODIFIER	modifiers;	/* modifiers which are implemented */