wxWidgets/utils/glcanvas/motif
1999-12-24 12:28:20 +00:00
..
glcanvas.cpp
glcanvas.h Added default constructor to wxGLCanvas. 1999-12-24 12:28:20 +00:00
makefile.unx
readme.txt

GLCanvas class for wxWindows 1.66 using the GLX protocol extension
==================================================================

I have just uploaded a file 'wx166glx.tar.gz' to the wxWindows
incoming directory.  It contains an implementation of a GLCanvas class
(interfacing an ordinary wxCanvas with OpenGL calls) for X11 (I tested
with Motif, maybe it works with XView as well).  I tried to imitate
what Julian did in 'wxmesa1.zip' for MS Windows in conjunction with
the Mesa library.

Of the several possibilities to use OpenGL under X11, I chose the GLX
server extension, because it is the most efficient method on machines
with graphics hardware support (I expect wxWindows/OpenGL applications
to _fly_ on my Indy :-).  However, you don't need a 'real' OpenGL
implementation to use GLCanvas -- the free Mesa library has a
simulated GLX interface built-in.  Just link in libMesaGLU and
libMesaGL along with libwx_motif and everything should work fine.

Installation:

Untar wx166glx.tar.gz from your main wxWindows directory (i.e. where
the `include' and `src' subdirectories are).  Then apply the small
patch file which has appeared in the `glx' subdirectory:

% patch -p0 < glx/wx166-glx.diff

Recompile the wx_motif library in the standard way.  The inclusion of
the GLCanvas class in libwx_motif is protected with a new 'USE_GLX'
flag in wx_setup.h, so it could maybe be included in a future
wxWindows release (with USE_GLX turned off by default).

Two new samples (bounce and prim) are included.  I adapted them from
wxmesa1.zip -- they should compile under both MS Windows (with wxMesa)
and X11.  The makefile.unx's are set up for the Mesa libraries; if you
have original libGLU/libGL's just change the GLLIBS = ... line.

Problems:

One more or less serious problem remains: the visual generated by the
GLCanvas class must match the visual of wxCanvas.xwindow (which
currently is always the screen's default visual).  The end result is
that you will get a nice RGB mode for OpenGL only if your display's
default visual is TrueColor or DirectColor (the XFree86 S3 servers for
PCs with the '-bpp 16/32' option are examples).  I'm contemplating a
solution where the wxCanvas drawingarea widget is destroyed and then
re-created from within the GLCanvas constructor.  I would welcome
suggestions on this and discussions of the GLCanvas 'API'.

Regards,

Wolfram Gloger.
(Gloger@lrz.uni-muenchen.de)