Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

/driver/main.cpp File Reference

#include "unitSimulation.h"
#include <glut.h>
#include "trackball.h"
#include "common.h"
#include "main.h"
#include "TextBox.h"

Include dependency graph for main.cpp:

Include dependency graph

Functions

pRecContext getCurrentContext ()
int main (int argc, char **argv)
void createMenus ()
void processMenuEvents (int option)
int processFramesPerSecond (char *argument[], int maxNumArgs)
void keyPressed (unsigned char key, int x, int y)
 Called when a key is pressed, and no other keys are held down.

void mouseMovedButton (int x, int y)
 Called when the mouse is moved with a button pressed down.

void mousePressedButton (int button, int state, int x, int y)
 Called when a mouse button is pressed.

void mousePan (int x, int y, pRecContext pContextInfo)
void mouseDolly (int x, int y, pRecContext pContextInfo)
void renderScene (void)
 Renders the scene.

void resizeWindow (int x, int y)
 Called when the window is resized.

void resizeGL (pRecContext pContextInfo, CGRect viewRect)
 Handles resizing of GL need context update and if the window dimensions change, a window dimension update, reseting of viewport and an update of the projection matrix.

void updateProjection (pRecContext pContextInfo)
 Update the projection matrix based on camera and view info.

void updateModelView (pRecContext pContextInfo)
 Updates the viewpoint of the model.

void drawCStringGL (char *cstrOut, GLuint fontList)
 Draws a CString in OpenGL.

void appendTextToBuffer (char *tempStr)
void submitTextToBuffer (const char *val)
void drawInfo (pRecContext)
 Displays the info on the screen.

void drawGL (pRecContext pContextInfo)
 Main OpenGL drawing function.

void buildGL (void)
 Initializes OpenGL.


Variables

pRecContext pContextInfo
GLint gDollyPanStartPoint [2] = {0, 0}
GLfloat gTrackBallRotation [4] = {0.0f, 0.0f, 0.0f, 0.0f}
GLboolean gDolly = GL_FALSE
GLboolean gPan = GL_FALSE
GLboolean gTrackball = GL_FALSE
pRecContext gTrackingContextInfo = NULL
int gCurrButton = -1
pRecContext backup
double fps = 30.0
TextBoxmyTextBox = 0

Function Documentation

void appendTextToBuffer char *  tempStr  ) 
 

void buildGL void   ) 
 

Initializes OpenGL.

void createMenus  ) 
 

void drawCStringGL char *  cstrOut,
GLuint  fontList
 

Draws a CString in OpenGL.

void drawGL pRecContext  pContextInfo  ) 
 

Main OpenGL drawing function.

void drawInfo pRecContext   )  [static]
 

Displays the info on the screen.

pRecContext getCurrentContext  ) 
 

void keyPressed unsigned char  key,
int  x,
int  y
 

Called when a key is pressed, and no other keys are held down.

int main int  argc,
char **  argv
 

void mouseDolly int  x,
int  y,
pRecContext  pContextInfo
[static]
 

void mouseMovedButton int  x,
int  y
 

Called when the mouse is moved with a button pressed down.

void mousePan int  x,
int  y,
pRecContext  pContextInfo
[static]
 

void mousePressedButton int  button,
int  state,
int  x,
int  y
 

Called when a mouse button is pressed.

int processFramesPerSecond char *  argument[],
int  maxNumArgs
 

void processMenuEvents int  option  ) 
 

void renderScene void   ) 
 

Renders the scene.

Used by GLUT for it's display function. Wraps the drawGL() function.

void resizeGL pRecContext  pContextInfo,
CGRect  viewRect
 

Handles resizing of GL need context update and if the window dimensions change, a window dimension update, reseting of viewport and an update of the projection matrix.

void resizeWindow int  x,
int  y
 

Called when the window is resized.

Specific format for GLUT.

void submitTextToBuffer const char *  val  ) 
 

void updateModelView pRecContext  pContextInfo  ) 
 

Updates the viewpoint of the model.

void updateProjection pRecContext  pContextInfo  ) 
 

Update the projection matrix based on camera and view info.

Should be called when viewport size, eye z position, or camera aperture changes. Also call if far or near changes which is determined by shape size in this case.


Variable Documentation

pRecContext backup
 

double fps = 30.0
 

int gCurrButton = -1
 

GLboolean gDolly = GL_FALSE
 

GLint gDollyPanStartPoint[2] = {0, 0}
 

GLboolean gPan = GL_FALSE
 

GLboolean gTrackball = GL_FALSE
 

GLfloat gTrackBallRotation[4] = {0.0f, 0.0f, 0.0f, 0.0f}
 

pRecContext gTrackingContextInfo = NULL
 

TextBox* myTextBox = 0
 

pRecContext pContextInfo
 


Generated on Tue Aug 18 03:35:58 2009 for HOG by doxygen 1.3.4