Newsgroups: comp.graphics.api.opengl,comp.sys.sgi.graphics From: mkrause@TechFak.Uni-Bielefeld.DE (Michael Krause) Subject: ANNOUNCE: repGL, an incomplete implementation of GL on top of OpenGL Message-ID: Date: Tue, 29 Aug 1995 18:30:04 GMT Organization: Universitaet Bielefeld, Technische Fakultaet. Keywords: IRIS GL, OpenGL, porting Hello, I just want to announce where you can get the first public version of repGL. You find it on: ftp://ftp.informatik.uni-oldenburg.de/pub/netpbm/incoming/repGL-0.2.tar.gz and the next days hopefully somewhere in: ftp://ftp.informatik.uni-oldenburg.de/pub/grafik/ Have fun, Michael repGL - an incomplete implementation of GL on top of OpenGL 0. 0 is the major version of this libray, you know what you have to expect ========================================================================== 1. Introduction =============== repGL is a 3D graphics library with an API which is similar to that of IRIS GL*. The author makes no claim that repGL is in any way a compatible replacement for IRIS GL, or that repGL is associated with Silicon Graphics, Inc., in any manner. Those who wish to use a licensed implementation of IRIS GL should contact Silicon Graphics. With the introduction of OpenGL* it was clear that the predecessor GL will become obsolete for good reason. While GL was fixed to a specific window system and all implementations of GL were differing across all vendors, OpenGL is a standardized, vendor neutral API, which is implemented on window systems like X11 and those of Windows NT and Windows 95 (to appear soon). To support the migration from GL to OpenGL, I tried to implement GL on top of OpenGL. This offers the following opportunities to you: - You have an example how to port most of the functions you are using with GL in case you want to migrate to OpenGL at all. - You might run your GL applications on systems, for which an implementation of GL will never appear. - And last, but not least, you can try to run your old GL programs on top of OpenGL using this library without modification of your sources. * IRIS GL and OpenGL are registered trademarks of Silicon Graphics, Inc. 2. Author ========= Michael Krause, mkrause@techfak.uni-bielefeld.de. 3. Installing the repGL library =============================== - Unpack the archive with "zcat repGL-0.2.tar.gz | tar xvf -" and go to its directory. - Type "./configure" to create the Makefile for your system. - Enter "make" to create the library - In case you want to install the library on your system, type "make install" As the libray makes heavy use of the GLUT toolkit for OpenGL you have to install a version of GLUT 2.3 on your system, but stop for a second. Because interaction in GL is often done by polling, I need a routine, which handles events of the X Window System without passive waiting until the next event shows up. This is as time consuming as annoying and another reason for you to migrate completely to OpenGL. So you have to copy the file glut_event.c over the one, which is located in _your_glut_dir/lib/glut. If you are using GLUT anyway, you may use the modified version also for the rest of your programming. I did not modify existing functions, instead I made renamed copies of them and customized them for use with repGL. All the GLUT functions should remain working. Now install GLUT as described, but all you need for repGL is libglut.a and glut.h. Do not remove the rest of GLUT, because you will need it after you totally failed using your apps with repGL and when have to port it by hand. 4. Using the repGL library ========================== When you were linking with GL, you probably did this with "-lgl -lfm" or something like this. Functions like 'winopen' were provided by the libgl. With repGL 'winopen' and most other functions are implemented in librepGL.a, which makes use of the GLUT, OpenGL, and X11 libraries. So you have to replace "-lgl -lfm" by something like "-lrepGL -lglut -lGL -lGLU -lX11 -lXmu -lm". Furthermore do not forget to let the compiler know the path, in which librepGL.a and libglut.a are waiting for their use. Now try to compile your program, confess your sins, and let it run. You might encounter a flood of messages like "repGL: blink not implemented" on stderr, which should speak for themselves. Even if all of the functions you are using have been implemented, does this in no case guarantee that anything is working correctly. But lucky as we are, we do not emulate of library doing numerical calculations for use in rocket science, but a graphics library were you can *see* what is going on. Right now repGL compiles on Irix5, Irix6, OSF/1, AIX and Linux(Mesa). If you use Mesa, make sure that your compiler finds GL/gl.h and GL/glu.h. 5. Modifying the behaviour of repGL =================================== There are some environment variables, which affect the run-time behaviour of repGL. Try setting some of these environment variables, to get different results in terms of handling difficult topics of GL. a) "export REPGL_CI=1" for Bourne shell, or "setenv REPGL_CI 1" for C shell Use unset or unsetenv respectively to invert this switch again. repGL does allocate a color index visual, instead of simulating it on an RGB visual as it does normally. This causes windows to close and reopen when gconfig() is called. b) "export REPGL_BF=1" for Bourne shell, or "setenv REPGL_BF 1" for C shell Changes between correct handling of backbuffer(), frontbuffer() and always drawing to both buffers. c) "export REPGL_SINGLE=1" Because changing the visual without closing the window is not possible at the moment, repGL opens a double buffered window. Setting REPGL_SINGLE results in opening a single buffered visual. d) "export REPGL_VERBOSE=1" Allows some debug messages, "export REPGL_VERBOSE=trace" directs a message for each GL function, which is called to stderr. e) "export REPGL_FLUSH=yes": flushes after every GL function that is drawing "export REPGL_FLUSH=no": does not flush if REPGL_FLUSH is unset, repGL flushes the first 1000 GL functions, to mark simple programs (winopen,clear,draw,sleep...) work on remote connections. f) "export REPGL_EVENT=" sets the interval (in microseconds) in which the events are polled. This saves some CPU time. ****************************************************************************** * If you are using repGL at all, you should really be adventurous and * * if you want to continue using it, you have to look at the source to * * see the oddities, workarounds and dangerous assumptions repGL bases on. * ****************************************************************************** 6. Acknowledgements =================== Without the GLUT Toolkit from Mark Kilgard this library would not only have been nearly impossible, but I would not have started programming OpenGL at all without the possibility to handle multiple windows etc. Brian Paul does a really good job on Mesa, a software based OpenGL implementation, which is almost complete. repGL works quite well with Mesa and allows repGL to run GL programs on standard X displays. Mesa is under GNU license. As you might know John Ousterhout has done an incredible good job on his Tcl/Tk system. Its capability impressed me not less than its appearance as an example of proper code style. The legal terms of Tcl/Tk should make it impossible for anyone, not to use it when dealing with GUI programming on the X Window System. A tailored copy of its license you find below, because it was the most appropriate one for repGL. 6. Pointers for related topics ============================== Excerpts from the OpenGL FAQ: Books: Neider, Jackie, Tom Davis, and Mason Woo, OpenGL Programming Guide: The Official Guide to Learning OpenGL, Release 1, Addison-Wesley, Reading, Massachusetts, 1993 (ISBN 0-201-63274-8). OpenGL Architecture Review Board, OpenGL Reference Manual: The Official Reference Document for OpenGL, Release 1, Addison-Wesley, Reading, Massachusetts, 1992 (ISBN 0-201-63276-4). Software: GLUT: ftp://sgigate.sgi.com/pub/opengl/xjournal/GLUT/glut.2.3.tar.Z Mesa: http://www.ssec.wisc.edu/~brianp/Mesa.html Tcl/Tk: http://www.sunlabs.com:80/research/tcl/ Newsgroups: comp.graphics.api.opengl comp.sys.sgi.graphics comp.lang.tcl 7. Legal terms of repGL ======================= This software is copyrighted by Michael Krause. The following terms apply to all files associated with the software unless explicitly disclaimed in individual files. The authors hereby grant permission to use, copy, modify, distribute, and license this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. No written agreement, license, or royalty fee is required for any of the authorized uses. Modifications to this software may be copyrighted by their authors and need not follow the licensing terms described here, provided that the new terms are clearly indicated on the first page of each file where they apply. IN NO EVENT SHALL THE AUTHOR OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHOR AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. -- - Michael Krause - E-Mail: mkrause@techfak.uni-bielefeld.de