README file for GTK/OpenGL Window sample
---------------------------------------------------------------
February 19, 2010
---------------------------------------------------------------

This code is just an example of how I have pieced together a method to get OpenGL integrated 
into a GTK widget in a way that works on X11, Win32, and OSX operating systems.  The operating 
system is selected through a pre-processor definition as follows:

GTKGL_OS_X11: select X11 integration (glx)
GTKGL_OS_WIN32: select Win32 integration
GTKGL_OS_MACOSX: select OSX integration

The minimum requirements to compile and run this code are GTK installed and some kind of support 
for OpenGL (hardware or software acceleration).  I have set up compilation environments for each 
platform that at least works for me.  If successful, you should get a GTK window with a black 
background and red square in the middle.

More details on each operating system are given as follows:

X11 (GTKGL_OS_X11):
------------------
GTK needs to be installed along with pkg-config and the development headers for GTK.  The headers 
may not be installed by default on all operating systems, but these should be easily obtained 
using yum or apt-get (on RHEL4 and RHEL5, it is the gtk2-devel package).  The makefile should be 
set up to produce the program (some changes to paths or linking may be necessary).


Win32 (GTKGL_OS_WIN32):
----------------------
For Win32, Visual C++ 2008 Express is required (http://www.microsoft.com/express/Windows/).
Additionally, a build of GTK for Windows will be required.  This can be obtained from GTK's
website (http://www.gtk.org/download-windows.html).  You will need an all-in-one bundle of the
development library.  With these two tools, load the Visual C++ project (gtkgl.vcproj) and most 
or all of the settings should be already set.  You may have to adjust paths for some things like 
the GTK libraries (I installed them in C:\GTK\).




OSX (GTKGL_OS_MACOSX):
---------------------
For OSX, XCode must be installed.  Also, I obtained the frameworks for native OSX GTK from the website, 
http://gtk-osx.org/ (the link from the main GTK page seems to currently be broken).  Although they 
list the frameworks in beta state and do not recommend them, I found they work quite well.  With these
two things installed, load the XCode project settings file (gtkgl.xcodeproj).  Most of the settings should
be completed, but you will probably have to pick "10.6" and "Release" from the project settings menu.
You may also have to adjust path locations of the frameworks and dependencies if your system is different 
than mine.  I believe that some of the functions I have used for OSX may be only available in 10.6, so 
it may not be possible to compile on previous versions of the OX without substituting some of those calls.


Please note: 
OpenGL is a registered trademark of SGI.
GTK is a freely distributable GUI Toolkit made available to us all under LGPL license through
http://www.gtk.org/

