home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
egltk22.zip
/
glcustom.hpp
< prev
next >
Wrap
Text File
|
1998-07-30
|
5KB
|
109 lines
#ifndef GLCUSTOM_HPP
#define GLCUSTOM_HPP
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// GLCustomModel
// Copyright Snow Storm Software, 1997
// OpenGL Custom Model
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef OS2
#define OS2
#endif
#ifndef APIENTRY
#define APIENTRY _System
#endif
#ifndef __gl_h_
#include <gl.h>
#endif
#ifndef __glu_h_
#include <glu.h>
#endif
class GLCustomModelData;
class GLCustomModel
{
public:
GLCustomModel( char * desc ); // constructor
virtual ~GLCustomModel(); // virtual destructor
virtual void initialize(); // virtual function to initialize the model
virtual void destroy(); // virtual function to destroy the model
virtual void animate( GLfloat fStep ); // virtual function to animate the model
virtual void display(); // virtual function to display the model
virtual void reshape( long width, long height ); // virtual function to reshape the viewport
virtual void addSettings(); // virtual function to add settings definitions
GLCustomModelData *privateData(); // pointer to private data, do not use
protected:
void addOnOffSetting( char *id, char *desc, char *help, // add on/off setting (checkbox)
GLboolean onOffDefault );
void addNumericSetting( char *id, char *desc, char *help,// add numeric setting
GLint numberDefault, GLint minimum, GLint maximum );
void addDirectorySetting( char *id, char *dirDefault, // add directory setting
char *fileDefault, GLboolean includeSubDirectoriesDefault );
GLboolean getOnOffSetting( char *id ); // get on/off setting
GLint getNumericSetting( char *id ); // get numeric setting
void getDirectorySetting( char *id, char dir[256], // get directory setting
char file[256], GLboolean *includeSubDirectories );
void setDoubleBuffered( GLboolean = GL_TRUE ); // set double buffered flag
void setFPS( GLfloat = 0. ); // set desired max frames per second, 0 for unlimited
void setMaxStepSize( GLfloat = 0.25 ); // set maximum step size (seconds)
private:
GLCustomModelData *data;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Point3D
// Copyright Snow Storm Software, 1998
// 3D point
// Note: Values are in integers for easier user entry. For example angles should be in degrees, not radians.
// If you want a position between 0 and 1, just get user to enter position between 0 and 100, then divide
// values by 100 before use.
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class Point3D
{
public:
Point3D( GLint a0, GLint b0, GLint c0 ); // initialize point to given values
Point3D(); // intializes point to zeros
GLint a, b, c;
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// GLCustomModelV2
// Copyright Snow Storm Software, 1998
// OpenGL Custom Model V2
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class GLCustomModelV2
: public GLCustomModel
{
public:
GLCustomModelV2( char * desc ); // constructor
protected:
void addDescription( char *desc ); // module description
void setDefaultWindowSize( GLint ); // set the default window size (1 - 10)
void setDefaultFloatingWindow( GLboolean ); // sets floating window defaults
void addTextSetting( char *id, char *desc, char *help, // add text setting
char *textDefault ); // default must not be null!!
char *getTextSetting( char *id ); // get text setting
void addPointSetting( char *id, char *desc, char *help, // add 3D Point setting, note min and max are integers
Point3D pointDefault, GLint minimum, GLint maximum );
Point3D getPointSetting( char *id ); // get text setting
};
#endif