src/main.cpp File Reference

Entry point for application. Creates main OpenGL window using SDL, global scene settings, tests invocation, starting point for application. More...

#include "test_fill.h"
#include "test_frag.h"
#include "test_geom.h"
#include "test_vert.h"
#include "test_complex.h"
#include "test_compute.h"

Functions

int CalcHash (string str)
 Secure score by calculating its hash.
void WriteResults ()
 Write results to file.
bool NextTest ()
 Skip to the next test.
bool InitScene ()
 Initialize scene.
void SysInfo ()
 Print system info into XML file.
void Redraw ()
 Main drawing function, runs the test.
void KeyInput (SDL_Event event)
 Handle keyboard input.
void MouseClick (SDL_Event event)
 Handle mouse clicks.
void MouseMotion (SDL_Event event)
 Handle mouse motion.
void WrongParams ()
 Print program usage if wrong parameters have been used. Then exits program.
int Timer (void *unused)
 Measure time in separate thread - solves problem when drawing is slower than 100fps.
int main (int argc, char **argv)
 Main entry point for application - initialize render, create test and performs drawing loop.

Variables

int curr_test
 Current test.
int final_test
 Final test.
Testtest
 Test class for initialization and run.
float total_score = 0.0
 Total score.
unsigned cycle = 0
 Drawn cycles in one second.
unsigned fps
 Actual framerate.
TScenes
 Scene class for initialization and run.
string msg
 Text message.
bool wire = false
 wireframe rendering flag
stringstream results
 stream to save results
bool info = false
 Should we print only system info?
int meminfo [4]
 VRAM memory info.
int resx
 Screen width.
int resy
 Screen height.
int fsaa = 1
 Antialiasing level.
bool devmode = false
 developer mode
int status
 mouse button status

Detailed Description

Entry point for application. Creates main OpenGL window using SDL, global scene settings, tests invocation, starting point for application.


Function Documentation

int CalcHash ( string  str  ) 

Secure score by calculating its hash.

Parameters:
str string with score number
Returns:
hash as integer
bool InitScene (  ) 

Initialize scene.

Returns:
success/fail of initialization
void KeyInput ( SDL_Event  event  ) 

Handle keyboard input.

Parameters:
event keyboard event
int main ( int  argc,
char **  argv 
)

Main entry point for application - initialize render, create test and performs drawing loop.

/////////////////////////////////////////////////////////////////////////////////////////////////

Parameters:
argc argument count
argv argument vector
Returns:
exit code of application /////////////////////////////////////////////////////////////////////////////////////////////////
void MouseClick ( SDL_Event  event  ) 

Handle mouse clicks.

Parameters:
event mouse event
void MouseMotion ( SDL_Event  event  ) 

Handle mouse motion.

Parameters:
event mouse event
bool NextTest (  ) 

Skip to the next test.

Returns:
success/fail of new test creation
int Timer ( void *  unused  ) 

Measure time in separate thread - solves problem when drawing is slower than 100fps.

Parameters:
unused null parameter

Generated by  doxygen 1.6.2