src/Main.cpp File Reference

The main function. More...

#include <cstdlib>
#include <config.h>
#include <GL/glut.h>
#include "Display.h"

Include dependency graph for Main.cpp:

Go to the source code of this file.

Functions

void display_init ()
 Call the init() method of the Display instance.
void display_quit ()
 Call the quit() method of the Display instance.
void display_draw ()
 Call the draw() method of the Display instance.
void display_reshape (int width, int height)
 Call the reshape() method of the Display instance.
void display_inputKey (unsigned char key, int x, int y)
 Call the inputKey() method of the Display instance.
void display_inputMouse (int button, int state, int x, int y)
 Call the inputMouse() method of the Display instance.
int main (int argc, char *argv[])
 The main function.


Detailed Description

The main function.

Author:
Émilien Girault, Léo Terziman
Date:
: feb 02 2008

Definition in file Main.cpp.


Function Documentation

void display_inputKey ( unsigned char  key,
int  x,
int  y 
)

Call the inputKey() method of the Display instance.

Parameters:
key the key pressed
x the x mouse coordinate
y the y mouse coordinate

Definition at line 75 of file Main.cpp.

References Display::inputKey(), and Display::instance().

Referenced by main().

00075                                                        {
00076   Display::instance()->inputKey(key, x, y);
00077 }

Here is the call graph for this function:

Here is the caller graph for this function:

void display_inputMouse ( int  button,
int  state,
int  x,
int  y 
)

Call the inputMouse() method of the Display instance.

Parameters:
button the button pressed
state the state of the button (up or down)
x the x mouse coordinate
y the y mouse coordinate

Definition at line 87 of file Main.cpp.

References Display::inputMouse(), and Display::instance().

Referenced by main().

00087                                                              {
00088   Display::instance()->inputMouse(button, state, x, y);
00089 }

Here is the call graph for this function:

Here is the caller graph for this function:

void display_reshape ( int  width,
int  height 
)

Call the reshape() method of the Display instance.

Parameters:
width the new width of the window
height the new height of the window

Definition at line 64 of file Main.cpp.

References Display::instance(), and Display::reshape().

Referenced by main().

00064                                             {
00065   Display::instance()->reshape(width, height);
00066 }

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

The main function.

Parameters:
argc the number of parameters
argv the parameters of the program

Definition at line 97 of file Main.cpp.

References display_draw(), display_init(), display_inputKey(), display_inputMouse(), display_quit(), and display_reshape().

00097                                  {
00098   int win;
00099 
00100   glutInit(&argc, argv);
00101   glutInitDisplayMode(GLUT_DEPTH | GLUT_ACCUM | GLUT_RGBA | GLUT_DOUBLE);
00102   glutInitWindowSize(1024,768);
00103   glutInitWindowPosition(0, 0);
00104   win = glutCreateWindow(PACKAGE " " VERSION);
00105   glutDisplayFunc(display_draw);
00106   glutFullScreen();
00107   glutReshapeFunc(display_reshape);
00108   glutKeyboardFunc(display_inputKey);
00109   glutMouseFunc(display_inputMouse);
00110   display_init();
00111   atexit(display_quit);
00112   glutMainLoop();
00113 
00114   return 0;
00115 }

Here is the call graph for this function:


Generated on Sat Feb 2 22:23:01 2008 for Teapot Colony Wars by  doxygen 1.5.4