home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!contex!sam.contex.com!james
- From: james@sam.contex.com (James McQueston)
- Newsgroups: comp.graphics.opengl
- Subject: GL sboxf() functionality in OpenGL?
- Keywords: sboxf rectf glRect
- Message-ID: <3339@contex.contex.com>
- Date: 28 Jan 93 23:45:09 GMT
- Sender: news@contex.contex.com
- Lines: 42
-
-
- I have a question about what *seems* to be a piece of GL functionality
- not present in OpenGL.
-
- In the GL, there are two rectangle drawing functions, rectf() and sboxf();
-
- Rectf() draws rectangles that are equivalent to polygons: all four corners
- obey the transformation on the matrix stack.
-
- Sboxf() however, draws rectangles that are screen-aligned: it behaves as
- if only the two diagonal points are sent through the transformation matrix
- and then a rectangle is constructed (and filled) in screen space.
-
- So sboxf() is less general than rectf(), but when drawing copious
- screen-aligned but very small rectangles, sboxf() has half the transformation
- cost that rectf() has whenever the drawing bottleneck is the transformation
- rate. A useful [not guaranteed] side-effect of sboxf() is that on all SGI
- implementations, it does not decompose the rectangle into triangles when
- filling, and so avoids "seeing" triangles "flashing" when drawing large
- screen-aligned rectangles in singlebuffer mode. We use this primitive
- a lot, for both of these purposes.
-
- The problem is that glRect() seems to be the OpenGL analogue of rectf().
- In fact, the man page [of 30 June 1992] states that "glRect2()" is
- equivalent to a series of glBegin, glVertex, and glEnd routines,
- that to me seem equivalent to GL rectf().
-
- 1) What is the "2" in "glRect2?" Is it a typo?
- 2) How can one get the very useful functionality provided by GL sboxf()
- from OpenGL?
-
- Those at SGI should know that I put this question to an SGI hotline engineer
- some time ago, and it resulted in RFE number 113630 (or maybe SCR 112952).
- There is some kind of response from Kurt Akeley in that file which seems
- to be saying that glRect() can do what Sbox() does. How can this be
- true?
-
- --
- -----
- James H. McQueston james@contex.com
- Xyvision Color Systems, Inc. (617) 246-1776 x 5523 (office, voicemail)
- Wakefield MA 01880-1291 (617) 245-4471 (lab phone direct)
-