Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF (EN)

Chapter 2 - Initializing and Terminating SunCGl 17 0 A call to close cgi should be included in the exit routines of an application program to guarantee leaving the Sun View and Sun CG I in a stable state. Errors ENOTOPOP [5] CGI not in proper state CGI shall be either in state CGOP, VSOP, or VSAC. ENOTCCPW [112] Function or argument not compatible with standard CGI. 2.2. View Surface Control The functions described in this section I. define the range of world and device coordinates, 2. control clipping, and 3. reset selected aspects of the view surface and the internal state of SunCGI. Most functions in SunCGI express coordinates in VDC space (Virtual Device Coordinate space).

In conventional computer graphics terms, VDC space corresponds to world coordinate space. The mapping between VDC space and screen space is determined by the physical size of the screen in pixels. Screen space is set by default to the entire size of the screen or the graphics window depending on the device type. The mapping from VDC space to screen space is always isotropic (the shape of the rectangle defining screen space is the same shape as VDC space). Therefore, VDC space defines the shape of the active view surface. The portion of screen space which does not correspond to VDC space is ignored.

The aspect ratio (the ratio between the height and width) is therefore, defined by VDC space and not screen space. 0 VDC Extent Cerror vdc_extent(cl, c2) Ccoor *cl, *c2; /* bottom left-hand and*/ /* top right-hand corner of VDC space*/ vdc extent defines the limits of VDC space. The range of the coordinates must be between -32767 and 32767 (or an error is generated). VDC space can be set by the application program, but it ranges from O to 32767 in both the x and they directions by default. Resetting VDC space impacts the display of output primitives on all view surfaces.

Resetting the limits of voe space automatically redefines the clipping rectangle to the new limits of voe space, regardless of the value of the clip indicator. Changing the mapping from screen space to VDC space allows for translation (move) or scaling (zoom in/zoom out) of output primitives. However, no rota- tion functions are provided by SunCGI, and therefore, must be supplied in the application program. The code fragment below translates and zooms in on a rec- tangle: 0 Version C of 17 March 1986