CPPGPGPU Library - Reference (Doxygen)

Main Page | General Use | Reference | Examples Info | Get/Download CPPGPGPU | SF.net Page

GLUTCore Class Reference

GLUT Core Class. More...

#include <GLUTCore.h>

List of all members.

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.


Detailed Description

GLUT Core Class.

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.


Constructor & Destructor Documentation

GLUTCore::GLUTCore (  ) 

Definition at line 87 of file GLUTCore.cpp.


Member Function Documentation

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]

Sets the startup drawing function.

Definition at line 61 of file GLUTCore.h.

void GLUTCore::SetReshapeFunct ( ReshapeFunct  RS  )  [inline]

Sets the startup reshaping function.

Definition at line 64 of file GLUTCore.h.

void GLUTCore::SetMousePressFunct ( MousePressFunct  MP  )  [inline]

Sets the startup mouse press function.

Definition at line 67 of file GLUTCore.h.

void GLUTCore::SetMouseDragFunct ( MouseDragFunct  MD  )  [inline]

Sets the startup mouse drag function.

Definition at line 70 of file GLUTCore.h.

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.


Member Data Documentation

int GLUTCore::miWidth

The current Width and Height of the window.

Definition at line 85 of file GLUTCore.h.

int GLUTCore::miHeight

Definition at line 85 of file GLUTCore.h.

int GLUTCore::miLastMouseX

The last location of the mouse.

Definition at line 88 of file GLUTCore.h.

int GLUTCore::miLastMouseY

Definition at line 88 of file GLUTCore.h.

int GLUTCore::miSetMouseX

The current location of the mouse.

Definition at line 91 of file GLUTCore.h.

int GLUTCore::miSetMouseY

Definition at line 91 of file GLUTCore.h.

int GLUTCore::miZoomY

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]

Delta time between last frame and this frame.

Definition at line 100 of file GLUTCore.h.

unsigned GLUTCore::iNumFrames [private]

Total number of frames ever seen.

Definition at line 103 of file GLUTCore.h.

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]

The last second seen by the frametimer.

Definition at line 109 of file GLUTCore.h.

unsigned GLUTCore::iTmrLastMillisecond [private]

The last millisecond seen by the frametimer.

Definition at line 111 of file GLUTCore.h.

DrawFunct GLUTCore::mDF [private]

Current drawing function.

Definition at line 114 of file GLUTCore.h.

ReshapeFunct GLUTCore::mRS [private]

Current drawing function.

Definition at line 116 of file GLUTCore.h.

MousePressFunct GLUTCore::mMP [private]

Current drawing function.

Definition at line 118 of file GLUTCore.h.

MouseDragFunct GLUTCore::mMD [private]

Current drawing function.

Definition at line 120 of file GLUTCore.h.


The documentation for this class was generated from the following files:
© 2005-2007 Charles Lohr, Joshua Allen, David Chapman, Andrew Lohr. All material including documentation under the MIT/X11 license.