home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / egltk22.zip / glcustom.hpp < prev    next >
Text File  |  1998-07-30  |  5KB  |  109 lines

  1. #ifndef GLCUSTOM_HPP
  2. #define GLCUSTOM_HPP
  3. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  4. //
  5. // GLCustomModel
  6. //  Copyright Snow Storm Software, 1997
  7. //  OpenGL Custom Model
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. #ifndef OS2
  12. #define OS2
  13. #endif
  14.  
  15. #ifndef APIENTRY
  16. #define APIENTRY _System
  17. #endif
  18.  
  19. #ifndef __gl_h_
  20. #include <gl.h>
  21. #endif
  22.  
  23. #ifndef __glu_h_
  24. #include <glu.h>
  25. #endif
  26.  
  27. class GLCustomModelData;
  28.  
  29. class GLCustomModel
  30. {
  31.    public:
  32.       GLCustomModel( char * desc );                            // constructor
  33.       virtual ~GLCustomModel();                                // virtual destructor
  34.       virtual void initialize();                               // virtual function to initialize the model
  35.       virtual void destroy();                                  // virtual function to destroy the model
  36.       virtual void animate( GLfloat fStep );                   // virtual function to animate the model
  37.       virtual void display();                                  // virtual function to display the model
  38.       virtual void reshape( long width, long height );         // virtual function to reshape the viewport
  39.       virtual void addSettings();                              // virtual function to add settings definitions
  40.  
  41.       GLCustomModelData *privateData();                        // pointer to private data, do not use
  42.    protected:
  43.       void addOnOffSetting( char *id, char *desc, char *help,  // add on/off setting (checkbox)
  44.               GLboolean onOffDefault );
  45.       void addNumericSetting( char *id, char *desc, char *help,// add numeric setting
  46.               GLint numberDefault, GLint minimum, GLint maximum );
  47.       void addDirectorySetting( char *id, char *dirDefault,    // add directory setting
  48.               char *fileDefault, GLboolean includeSubDirectoriesDefault );
  49.       GLboolean getOnOffSetting( char *id );                   // get on/off setting
  50.       GLint getNumericSetting( char *id );                     // get numeric setting
  51.       void getDirectorySetting( char *id, char dir[256],       // get directory setting
  52.               char file[256], GLboolean *includeSubDirectories );
  53.  
  54.       void setDoubleBuffered( GLboolean = GL_TRUE );           // set double buffered flag
  55.       void setFPS( GLfloat = 0. );                             // set desired max frames per second, 0 for unlimited
  56.       void setMaxStepSize( GLfloat = 0.25 );                   // set maximum step size (seconds)
  57.  
  58.    private:
  59.       GLCustomModelData *data;
  60. };
  61.  
  62. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  63. //
  64. // Point3D
  65. //  Copyright Snow Storm Software, 1998
  66. //  3D point
  67. //    Note: Values are in integers for easier user entry. For example angles should be in degrees, not radians.
  68. //          If you want a position between 0 and 1, just get user to enter position between 0 and 100, then divide
  69. //          values by 100 before use.
  70. //
  71. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  72.  
  73. class Point3D
  74. {
  75.    public:
  76.       Point3D( GLint a0, GLint b0, GLint c0 );                 // initialize point to given values
  77.       Point3D();                                               // intializes point to zeros
  78.       GLint a, b, c;
  79. };
  80.  
  81. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  82. //
  83. // GLCustomModelV2
  84. //  Copyright Snow Storm Software, 1998
  85. //  OpenGL Custom Model V2
  86. //
  87. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  88.  
  89. class GLCustomModelV2
  90.    : public GLCustomModel
  91. {
  92.    public:
  93.       GLCustomModelV2( char * desc );                          // constructor
  94.    protected:
  95.       void addDescription( char *desc );                       // module description
  96.       void setDefaultWindowSize( GLint );                      // set the default window size (1 - 10)
  97.       void setDefaultFloatingWindow( GLboolean );              // sets floating window defaults
  98.  
  99.       void addTextSetting( char *id, char *desc, char *help,   // add text setting
  100.               char *textDefault );                             // default must not be null!!
  101.       char *getTextSetting( char *id );                        // get text setting
  102.  
  103.       void addPointSetting( char *id, char *desc, char *help,  // add 3D Point setting, note min and max are integers
  104.               Point3D pointDefault, GLint minimum, GLint maximum );
  105.       Point3D getPointSetting( char *id );                     // get text setting
  106. };
  107.  
  108. #endif
  109.