2Dwrap: layer to port 2d primitives from Iris to Open GL

TOP | Up | Pheedbak | Download | Tree | Topic | A-Z | Search | Hot | New


2Dwrap is a layer which will enable you to port 2d primitive calls (arc,circle,rectangle,sbox) from IrisGL to OpenGL.

Why do you need 2DWRAP?

For porting rectangles, you may try to use the OpenGL call glRect(), but you have to keep track of the current polygon mode. glRect() will draw filled or plain rectangles depending upon the polygon mode. Querying and setting polygon modes could be expensive. OpenGL does not provide separate calls for filled and unfilled rectangles (like rect and rectf in IrisGL).

There's no sbox() equivalent in OpenGL and using glRect() will have similar performance issues (see reason above).

For arcs, you may use gluPartialDisk(). But it draws 2 radial lines (like pacman) at the end of arcs. Also it does some checking for different state variables. The routine in the wrapper layer could be tuned to the application needs.

The 2 directories igl and ogl are IrisGL and OpenGL equivalents of the same program.

Yusuf Attarwala
yusuf@sgi.com
April, 1995


Select any combo of files you'd like to send yourself a compressed tar image of. Executables/scripts are indicated with a trailing `*' character. (Depending upon the browser, it may be necessary to hold down the Ctrl key to select/deselect disjoint items.) a compressed tar image of the above-selected items.
OR, ...
a compressed tar image of the entire 2Dwrap subtree.

Copyright © 1995, Silicon Graphics, Inc.