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

Chapter 1 - Introduction 7 Q Programming Tips For novice C language users, the syntax of SunCGI may pose some initial difficulties. When a pointer is specified as an argument to a SunCGI function, SunCGI usually expects space to be allocated by the application program and the function argument to be preceded by an ampersand (&). SunCGI uses many enumerated types. These types are printed by the printf function as integers. If you want to print out these values in English, you should use the enumerated types as indices into a character array which contains appropriate English equivalents of the enumerated types.

Finally, if you are a novice programmer, copy the example programs in Appendix E and use them as templates to build your own program with. Further help can be obtained by referring to the tables at the end of Appendix D. These tables list commonly encountered problems and how to solve them. Appendices The first five appendices are intended to make SunCGI easier to understand. This information will probably be particularly useful to novice users. The last two appendices describe the interfaces: I. between SunCGI and Sun View, and 2. between SunCGI and the FORTRAN programming language. Appendix A explains the difference between SunCGI and SunCore. Appendix B lists the ANSI CG!

standard functions which are not implemented by SunCGI and the SunCGI functions which are not part of the ANSI CG! standard. Appen- dix C provides the type definitions used by the SunCGI functions. Appendix D lists the error messages and possible strategies for eliminating them. Appendix D also lists possible causes of simple run-time errors. Appendix E describes sample programs. 0 The final two appendices describe the interfaces between SunCGI and other Sun software packages: Sun View and FORTRAN. The first of the two interface appen- dices explains how to call SunCGI from application programs written on top of Sun View.

This interface allows SunCGI to write output primitives in different windows using different attributes. This interface is useful for application pro- grams which wish to control different areas of the view surface independently. Appendix G describes the interface to the FORTRAN programming language. The behavior of each SunCGI function is the same in both C and FORTRAN. 1.4. References [1] ANSI X3H3. Computer Graphics Virtual Device Interface. March 1984. [2] J.D. Foley and A. van Dam. Fundamentals of Interactive Computer Graphics. Addison-Wesley, 1982. [3] E.W. Kernighan and D.M. Ritchie. The C Programming Language. Prentice-Hall, 1978. [4] W.M. Newman and R.F. Sproull.

Principles of Interactive Computer Graphics. McGraw-Hill, 1979. [5] V.R. Pratt. Standards and Performance Issues in the Workstation Market. IEEE Computer Graphics and Applications, April 1984. 0 Ver>ion C of 17 March 1986