Programming and Graphics

(Kiana) #1

8.1 Glut 257


GLUTRGBA Select an RGBA mode window; default if neither
GLUTRGBA nor GLUTINDEX are specified.
GLUTRGB Alias for GLUTRGBA.
GLUTINDEX Color-index-mode window;
overrides GLUTRGBA.
GLUTSINGLE Single buffered window; default if neither
GLUTDOUBLE or GLUTSINGLE is specified.
GLUTDOUBLE Double buffered window;
overrides GLUTSINGLE.
GLUTACCUM Accumulation buffer.
GLUTALPHA Alpha component to the color buffer(s).
GLUTDEPTH Depth buffer.
GLUTSTENCIL Stencil buffer.
GLUTMULTISAMPLE Multisampling support.
GLUTSTEREO Stereo window.
GLUTLUMINANCE “Luminance” color model.

Table 8.1.1Directives of the theglutInitDisplayModefunction.


upper limits of thex, y,andzaxes.



  • TheGLUTDEPTHdirective of theglutInitDisplayModefunction requests
    a color depth buffer,GLUTSINGLErequests a single buffer, andGLUTRGBA
    requests the RGBA color coding system. A list of possible directives is
    given in table 8.1.1.

  • The first argument of theglutInitDisplayPositionfunction is the num-
    ber of pixels from the left of the screen. The default value is -1, signifying
    that the window manager is free to choose where the window will appear.
    The second argument of the function is the number of pixels measured
    from the top of the screen.

  • The first and second arguments of theglutInitWindowSizefunction are
    the window width and height, both measured in pixel units.


Graphics files


Obtaining a file or hard copy of the graphics window or display is easier
said than done. Although some conversion software is available, the quick
way out is to save a screen shot and obtain the desired image using an image
manipulation application such as thegimp. The images shown in this chapter
were extracted in this manner and then saved in the encapsulated postscript
(eps) format.

Free download pdf