home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible / OpenGL_Superbible_Waite_Group_Press_1996.iso / borland / borland.txt
Text File  |  1996-06-03  |  3KB  |  33 lines

  1. This directory contains special support files and instructions for Borland C++ users. All samples in the book were originally created using Visual C++ version 4.0. Except for the samples that make use of MFC (there are very few of these), these samples can easily be compiled with Borland C++. The Borland samples provided were compiled with Borland C++ 5.0. 
  2.  
  3. **********************************************************************************
  4. Compiling the book samples with Borland C++ 5.0
  5.  
  6. Since, the Borland resource compiler does not understand App Studio directives, you will need to comment out the following line from the resource file (<something>.rc):
  7.  
  8. //#include <afxres.h>
  9.  
  10. This header is included by default by Visual C++, but none of the declarations are used by any of the C samples in this book, so you can safely leave them out.
  11.  
  12. I have also found that not all of the newer OpenGL API's are exported in the Borland import libraries. You may wish to create your own import libraries from the system OpenGL DLL's. You can then use the headers from the Microsoft SDK as well. You will especially want to do this if you want to access any of the version 1.1 functionality. To create your own import libraries, use the Borland implib.exe utility. The command lines to do this follow:
  13.  
  14. implib opengl32.lib opengl32.dll
  15. implib glu32.lib glu32.dll
  16.  
  17. You will need to run this from your system directory where the DLL's reside. Then put the created library files in the path where your compiler can find them, and manually specify these libraries as part of your project.
  18.  
  19.  
  20.  
  21. ***********************************************************************************
  22. AUX Library Support
  23.  
  24. The Auxiliary library (glaux.lib) that ships with the Win32 SDK and Visual C++ is incompatible with the Borland compilers. This is due to the different object format used by Microsoft and Borland. I was unable to recompile glaux.lib with the Borland compiler and get a version stable enough to ship with the book.
  25.  
  26. However, I was able to work around this by creating a DLL with Visual C++ that linked in the glaux.lib functions, then exported them in the .def file. By using the Borland implib.exe utility, I created a Borland compatible link library. The source for this DLL is in the \Borland\Auxlib\glauximp subdirectory. The DLL itself and the Borland generated import library is in \Borland\Auxlib (glauximp.lib and glauximp.dll).
  27.  
  28. By making the .dll available (put it in your system directory) and linking your program to the glauximp.lib, the entire Auxiliary library is available. Several of the GUI based samples use the aux library objects and work with this library. In addition, all of the console based aux samples from chapter 3 work as well (In fact, I included Borland project files and examples for Chapter 3 in the \Borland\Chapt3 directory). I've tested this with several of the Red Book examples as well and found it works quite well. 
  29.  
  30. I did find some annoying floating point exceptions for some animated samples when they were left to run for some length of time. In particular the auxdemo sample that ships with the Microsoft Win32 SDK and Visual C++. Since this library is not intended for production use, this seemed an acceptible compromise as opposed to a full port of the library.
  31.  
  32.  
  33.