The OpenGL Kit

The OpenGL Kit provides an interface between your BeOS application and the OpenGL graphics library, which is provided with BeOS. The two classes in the OpenGL Kit, BGLView and BGLScreen, let you display graphics rendered using OpenGL on a computer running the BeOS.


The OpenGL Kit Classes

The BGLView class is used to create a view within a window that contains OpenGL-rendered data. Derived from BView, it adds functions for locking and unlocking the OpenGL context associated with the view, as well as for copying pixel data into and out of the graphics buffer, and swapping the front and back buffers.

The BGLScreen class, derived from BWindowScreen, provides most of the same functionality provided by the BGLView class, but is used to take over the full screen instead of presenting OpenGL graphics in a window.

Note that if you want to use OpenGL graphics in a BDirectWindow, you would simply create your BDirectWindow and attach a BGLView to it.


OpenGL On BeOS

BeOS has included an OpenGL implementation since the first Preview Release for PowerPC processors. This implementation of OpenGL is complete, and GLU is supported as well. The optional AUX and GLUT libraries, however, aren't supported at this time.

Also, the current implementation of OpenGL on BeOS supports only 32-bit graphic buffers. Your BGLView or BGLScreen can be in any graphics mode you want, but the graphics buffer offscreen is always 32-bit.

Complete descriptions of the features and use of OpenGL are beyond the scope of this book; however, you can get full documentation of OpenGL as well as sample code at the OpenGL web site at http://www.opengl.org.

There are also some sample OpenGL programs that have already been ported to BeOS available for download on the Be web site; visit http://www.be.com/developers/topics/opengl.html.




The Be Book, in lovely HTML, for BeOS Release 4.

Copyright © 1998 Be, Inc. All rights reserved.

Last modified February 4, 1998.