#include <GLUTCore.h>
Public Member Functions | |
GLUTCore () | |
void | Init (int argc, char **argv, int iWidth, int iHeight, char *sName) |
Initialization function, call this before doing anything else. | |
void | DrawAndDoMainLoop () |
Main GLUT Loop call. | |
void | SetDrawFunct (DrawFunct DF) |
Sets the startup drawing function. | |
void | SetReshapeFunct (ReshapeFunct RS) |
Sets the startup reshaping function. | |
void | SetMousePressFunct (MousePressFunct MP) |
Sets the startup mouse press function. | |
void | SetMouseDragFunct (MouseDragFunct MD) |
Sets the startup mouse drag function. | |
float | TackFPS () |
FPS Tack and Get Delta Time. | |
void | SetCamDist (const float fDist) |
Set camera distance for default distance on reshape. | |
int | GetDeltaMS () |
Public Attributes | |
int | miWidth |
The current Width and Height of the window. | |
int | miHeight |
int | miLastMouseX |
The last location of the mouse. | |
int | miLastMouseY |
int | miSetMouseX |
The current location of the mouse. | |
int | miSetMouseY |
int | miZoomY |
Static Public Attributes | |
static float | fGLUTCamDistance |
This value gets set by SetCamDistance (See that function). | |
Private Attributes | |
int | iDeltaMS |
Delta time between last frame and this frame. | |
unsigned | iNumFrames |
Total number of frames ever seen. | |
unsigned | iLastSecond |
The last seen second. If this is different, FPS will be printed upon tack. | |
unsigned | iTmrLastSecond |
The last second seen by the frametimer. | |
unsigned | iTmrLastMillisecond |
The last millisecond seen by the frametimer. | |
DrawFunct | mDF |
Current drawing function. | |
ReshapeFunct | mRS |
Current drawing function. | |
MousePressFunct | mMP |
Current drawing function. | |
MouseDragFunct | mMD |
Current drawing function. |
This class provides a C++ interface to a simple GL window using GLUT. By utilizing this class, it provides a common interface for other things in the CPPGPGPU library without increasing code common to all of the projects.
Definition at line 42 of file GLUTCore.h.
GLUTCore::GLUTCore | ( | ) |
Definition at line 87 of file GLUTCore.cpp.
void GLUTCore::Init | ( | int | argc, | |
char ** | argv, | |||
int | iWidth, | |||
int | iHeight, | |||
char * | sName | |||
) |
Initialization function, call this before doing anything else.
This must be called AFTER you use GLUTCore's callbacks and before pretty much anything else with GLUT you can simply call this immediately after main with the parameters from your main() function as well as the initial width, height and title for the window
Definition at line 135 of file GLUTCore.cpp.
void GLUTCore::DrawAndDoMainLoop | ( | ) |
Main GLUT Loop call.
Call this after you've done everything you want to have execute once. This is what causes the different callbacks to get called over and over.
Definition at line 164 of file GLUTCore.cpp.
void GLUTCore::SetDrawFunct | ( | DrawFunct | DF | ) | [inline] |
void GLUTCore::SetReshapeFunct | ( | ReshapeFunct | RS | ) | [inline] |
void GLUTCore::SetMousePressFunct | ( | MousePressFunct | MP | ) | [inline] |
void GLUTCore::SetMouseDragFunct | ( | MouseDragFunct | MD | ) | [inline] |
float GLUTCore::TackFPS | ( | ) |
FPS Tack and Get Delta Time.
This function updates the internal (GLUTCore) timers and if a second has been past, it will display FPS. It will always return the total time between last frame and this frame
Definition at line 97 of file GLUTCore.cpp.
void GLUTCore::SetCamDist | ( | const float | fDist | ) | [inline] |
Set camera distance for default distance on reshape.
Whenever the viewport is resized, the default change viewport function gets called and that looks at the camera distance to generate the apropriate camera transformations
Definition at line 82 of file GLUTCore.h.
int GLUTCore::GetDeltaMS | ( | ) | [inline] |
Definition at line 97 of file GLUTCore.h.
Definition at line 85 of file GLUTCore.h.
Definition at line 88 of file GLUTCore.h.
Definition at line 91 of file GLUTCore.h.
Definition at line 93 of file GLUTCore.h.
float GLUTCore::fGLUTCamDistance [static] |
This value gets set by SetCamDistance (See that function).
Definition at line 96 of file GLUTCore.h.
int GLUTCore::iDeltaMS [private] |
unsigned GLUTCore::iNumFrames [private] |
unsigned GLUTCore::iLastSecond [private] |
The last seen second. If this is different, FPS will be printed upon tack.
Definition at line 106 of file GLUTCore.h.
unsigned GLUTCore::iTmrLastSecond [private] |
unsigned GLUTCore::iTmrLastMillisecond [private] |
DrawFunct GLUTCore::mDF [private] |
ReshapeFunct GLUTCore::mRS [private] |
MousePressFunct GLUTCore::mMP [private] |
MouseDragFunct GLUTCore::mMD [private] |