Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

Chapter 2 - Initializing and Terminating SunCGI 21 Q Clear View Surface Cerror clear_view_surface(name, defflag, index) Cint name; /* name assigned to cgi view surface*/ Cflag defflag; /* default color flag*/ Cint index; /* color of cleared screen *I clear_ view_surface changes all pixels in the relevant area of the view sur- face specified by name to the color specified by the index argument, unless the defflag argument is set to OFF. If defflag is equal to OFF, the view surface is cleared to color zero. The area of the view surface which is actually cleared is determined by the clear_control function.

clear_view_surface also resets the internal state of SunCGI according to previous calls to the clear control function. clear view surface resets the current back- - - - ground color to the color of the cleared view surface. Errors ENOTVSAC [4) CGI not in proper state: CGI shall be in state VSAC. EVSIDINV [10] Specified view surface name is invalid. EVSNOTOP [13] Specified view surface not open. EVSNTACT [15) Specified view surface is not active. ECINDXLZ [35] Color index is less than zero. EBADCOLX [36] Color index is invalid.

Q Clear Control Cerror clear_control(soft, hard, intern, extent) Cacttype soft, hard; /* soft and hard copy actions*/ Cacttype intern; /* internal action*/ Cexttype extent; /* clear extent*/ clear_control determines the action taken when clear view surface is called. The argument soft can be set to either NO_ OP or CLEAR. The argument hard which regulates clearing rules for plotters is ignored (because Sun CG I does not currently support hard-copy devices) and is included only for ANSI CG! compatibility. The argument intern is set to either RETAIN or CLEAR. This · parameter was included to support segmentation storage which is not currently a part of ANSI CG!.

Therefore, the intern argument is ignored. The argument extent determines what area of the screen is cleared. It is set to one of the values in the Cexttype enumerated type: typedef enum { CLIP_RECT, VIEWPORT, VIEWSURFACE Cexttype; Errors ENOTOPOP [5] CGI not in proper state CGI shall be either in state CGOP, VSOP, or VSAC. ENOTCCPW [ 112] Function not compatible with CGIPW mode. Q Set Error Warning Mask Version C of 17 March 1986