############################################################################### # TkOGL - Embedding OpenGL in Tcl/Tk # # README # ############################################################################### Contents 1. How to Install in Windows? 2. How to Install in Linux? 3. How to Run the Demos? 4. File and Directory Structure? 5. How is installation done in Windows? 6. How is installation done in Linux? 7. I only have tcl8.3, how can I make it work for tcl8.3 instead of tcl8.4? 8. I get "can't find package Tkogl" errors... 9. My machine has SWIG1.3 installed instead of SWIG1.1, can I use that? ############################################################################### 1. How to Install in Windows a. Double click on the install.exe b. Find the location of where Tcl is installed ############################################################################### 2. How to Install in Linux a. Go to src/swig.gl/Makefile.am, modify the locations of SWIG and Tcl files if needed. b. Go to src/swig.glu/Makefile.am, modify the locations of SWIG and Tcl files if needed. c. Go to src/tkogl/Makefile.am, modify the locations of Tcl files if needed. d. Go to the top directory, type "./configure", "make", then "make install". e. To install to a custom location, use "./configure --prefix=YOUR_DIRECTORY". f. For other install options, read the INSTALL file. ############################################################################### 3. How to Run the Demos Once you have the packages installed: For Windows, you should be able to double click on the .tcl files directly. For Linux, you can perform a "wish ". Note: Only Windows can run demos with the createFont command. Other demos can be ran on both Windows and Linux. There may be problems (crash) with some demos upon exit because they don't have a "quit" button. ############################################################################### 4. File and Directory Structure Source files are shared between Linux and Windows. This is done to decrease maintenance overhead. Linux - TkOGL source files are in Tkogl(ver)/src/tkogl. - OpenGL source files are in Tkogl(ver)/src/swig.gl. - OpenGLU source files are in Tkogl(ver)/src/swig.glu. Windows The makeWIN.cmd script must be ran first, this copies necessary files to the windows directories so it would have it's own development space. The corresponding VC++ makefiles are waiting in there already. - TkOGL source files and Makefiles are in Tkogl(ver)/src/tkogl/windows. - OpenGL source files and Makefiles are in Tkogl(ver)/src/swig.gl/windows. - OpenGLU source files and Makefiles are in Tkogl(ver)/src/swig.glu/windows. - Windows install wizard is in Tkogl(ver)/WindowsInstall, this includes the install manual. Demos - Demos are in Tkogl(ver)/demo and Tkogl(ver)/demo/NMR ############################################################################### 5. How is installation done in Windows The Windows installation program is called HJ-Install and is available for free online at www.freebyte.com/hjinstall. Follow section 7 to re-compile TkOGL if needed. HJ-Install uses a script file (install.script) and install.exe uses that script to perform certain tasks specified in the file. For more details, read the HJ-Install manual for all the available functions. For TkOGL, a batch file "wizard.cmd" has been written to copy all the needed files to the WindowsInstall directory. Once all the files are present, the install.exe is ran to move the files to the Tcl/lib directories. This way, the interpret will know where the libraries are during autoload. ############################################################################### 6. How is installation done in Linux Installation is done in Linux via GNU Autotools. It uses a deep level packaging system meaning that all the source files aren't all in one place. The top level Tkogl(ver) contains the main configure script that generates all the Makefiles in the levels below. Here is a description of the files below: --Tkogl(ver)/Makefile.am-- Points to the SRC directory. --Tkogl(ver)/configure.in-- Basic automake configurations --Tkogl(ver)/src/Makefile.am-- Points to tkogl, swig.gl, swig.gl directories --Tkogl(ver)/src/tkogl/Makefile.am-- Compiles the tkogl.c file and creates libraries in the .libs hidden directory. This makefile uses an install-exec-hook which runs shell script code to move files to proper locations and to install the packages by using tcl's "wish" commands. This is done after compilation and library creation. An install.tcl file is used to help install the packages. --Tkogl(ver)/src/swig.gl/Makefile.am-- Uses swig to generate the wrapper file (opengl_wrap.c). There's a problem with the interface file where it complains about an unterminated #endif. The "-" command is used to ignore this error since it creates the correct wrapper code. This also uses the install-exec-hook mentioned above. -- Tkogl(ver)/src/swig.glu/Makefile.am-- Similar to swig.gl Autotools should compile, make libraries, and run wish to install the packages. ############################################################################### 7. I only have tcl8.3, how can I make it work for tcl8.3 instead of tcl8.4? You would need to re-compile the source with tcl8.3 libraries. This can be done by installing tcl8.3, modifying the Tcl versions. Run the following commands: Linux: In the top directory: tkogl(ver) >aclocal >automake >autoconf >./configure >make >make install Windows: - Use Visual C++, open the Project Workspace. - Compile - Files should be .../windows/tcl - Run the wizard.cmd in Tkogl(ver)/WindowsInstall. - Run install.exe ############################################################################### 8. I get "can't find package Tkogl" errors... This happens when the Tcl interpreter can't find a certain package. This is either due to packages created with different versions of Tcl, or it is not in the TCLLIBPATH. In the first case, follow section 7. For the second case, set an environment variable called "TCLLIBPATH" to the top level directory of where you installed TkOGL. ############################################################################### 9. My machine has SWIG1.3 installed instead of SWIG1.1, can I use that? Up until version 3.2, SWIG1.1 has been used and has proven to work. Newer versions of SWIG has some significant changes and it may not be as simple as re-compiling with the new libraries. There may be some debugging involved.