int dtype;
int argc;
char *argv[];
struct dm *dmp;
/*
* Open a 512x512 X display manager window on the local
* display using my_default_bindings to set default key
* and mouse button bindings.
*/
dtype = DM_TYPE_X;
argv[0] = "X_open";
argv[1] = "-i";
argv[2] = "my_default_bindings";
argv[3] = "-S";
argv[4] = "512";
argv[5] = "-d";
argv[6] = ":0";
argv[7] = (char *)NULL;
dmp = DM_OPEN(dtype, argc, argv);
/* open a display manager */
dmp = DM_OPEN(dtype, argc, argv);
. . .
/* close the display manager */
DM_CLOSE(dmp);
/* begin another drawing sequence */
(void)DM_DRAW_BEGIN(dmp);
/* end the current drawing sequence */
(void)DM_DRAW_END(dmp);
/* restore to normal mode */
(void)DM_NORMAL(dmp);
/* load the display manager with mat --- not using stereo */
(void)DM_LOADMATRIX(dmp, mat, 0);
/*
* - draw the string starting at the lower left corner
* - use the small font
* - don't use aspect ratio to modify string placement
*/
(void)DM_DRAW_STRING_2D(dmp, "starting string at lower left", -2040, -2040, 0, 0)
/* draw a line from the lower left corner of the window to the upper right corner */
(void)DM_DRAW_LINE_2D(dmp, -2048, -2048, 2047, 2047);
/* draw a yellow dot in the center of the window */
(void)DM_SET_FGCOLOR(dmp, 230, 230, 0, 1);
(void)DM_DRAW_POINT_2D(dmp, 0, 0);
/* draw the vlists pointed to by view_list_ptr */
(void)DM_DRAW_VLIST(dmp, view_list_ptr);
/* set the drawing color to red */
(void)DM_SET_FGCOLOR(dmp, 220, 0, 0, 1);
/* set the background color to red */
(void)DM_SET_BGCOLOR(dmp, 220, 0, 0);
/* get the background color */
return DM_GET_BGCOLOR(dmp, interp);
/* set the display manager up to draw fat dashed lines */
(void)DM_SET_LINE_ATTR(dmp, 10, 1);
int clip[6] = { -2048, 2047, -2048, 2047, -2048, 2047 };
/* set the display managers clipping planes */
(void)DM_SET_WIN_BOUNDS(dmp, clip);
/* turn on debugging */
(void)DM_DEBUG(dmp, 1);
/* begin the definition of display list 1 */
(void)DM_BEGINDLIST(dmp, 1);
/* define display list 1 to draw objects */
(void)DM_BEGINDLIST(dmp, 1);
/* Put code to draw objects here */
(void)DM_ENDDLIST(dmp);
unsigned int i;
/* draw display lists 1 through 9 */
for(i = 1; i < 10; ++i)
(void)DM_DRAWDLIST(dmp, i);
/* free display lists 10 through 29 */
(void)DM_FREEDLISTS(dmp, 10, 20);
/* use the most efficient method for calculating fog */
dm_fogHint(dmp, 1);
/* use the most accurate method for calculating fog */
dm_fogHint(dmp, 0);
/* The examples below assume that NOISE is 16 */
/* i = 0 */
i = dm_limit(16);
/* i = 1 */
i = dm_limit(17);
/* i = 0 */
i = dm_limit(-16);
/* i = -1 */
i = dm_limit(-17);
/* i = 0 */
i = dm_unlimit(0);
/* i = 17 */
i = dm_unlimit(1);
/* i = -17 */
i = dm_unlimit(-1);
/* f = 0.9 */
f = dm_wrap(0.9);
/* f = -0.5 */
f = dm_wrap(1.5);
/* f = 0.0 */
f = dm_wrap(6.0);
/* f = 1.0 */
f = dm_wrap(7.0);
/* f = 0.5 */
f = dm_wrap(-1.5);
/* f = -1.0 */
f = dm_wrap(-5.0);
| Options | Description |
|---|---|
| -d string | This option specifies where to draw the display manager. string is expected to be in the same form as the X DISPLAY environment variable. |
| -i init_script | This option specifies a Tcl script to use to initialize the display manager. |
| -N height | This option specifies the number of scanlines or height to make the display manager window. |
| -n name | This option specifies a name to use for the display manager. |
| -S size | This option specifies the display manager windows square size. |
| -s | This option turns on stereo mode and is currently only available with the ogl display manager. |
| -t 0|1 | This option specifies whether the display manager window will be a top level window or an imbedded window. A non-zero value indicates a top level window, while zero indicates an imbedded window. |
| -W width | This option specifies the width in pixels of the display manager window. |
/* turn zbuffering on */
dm_zbuffer(dmp, 1);
/* turn lighting on */
dm_lighting(dmp, 1);