- Main Page
- Namespaces
- Data Structures
- Files

- Search for |

- File List
- Globals

# HydroSDL/main.cpp File Reference

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "SDL.h"`
`#include "SDL_OpenGL.h"`
`#include "main.h"`
`#include "math.h"`
`#include "mex.h"`
`#include "oGL_graphics/graphics_relative.h"`
`#include "oGL_graphics/solid_objects.h"`
`#include "hydro_source/hydro_includes.h"`
`#include "CVODEincludes.h"`
`#include "timing/timing.h"`
`#include "f.h"`

Include dependency graph for main.cpp:

Go to the source code of this file.

## Functions
void | quit_tutorial (int code)
| Program quit function.
int | main (int argc, char *argv[])
| Main function (program entry).
## Variables
static GLboolean | should_rotate = GL_TRUE
float | rot1 = 0.0f
float | rot2 = 0.0f
int | goLoop = 1
ODE_data | f_dats
ODE_data * | f_dat = &f_dats

## Detailed Description

Author:
  basile.graf@epfl.ch

This is the main program file, containing the main function and loop.

Definition in file main.cpp.

## Function Documentation

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

Main function (program entry).

This is the programm entry. On OS X, be aware that there is a cocoa wrap around it (see SDLmain.m and/or SDL.framework)

< parameters Par; parameters structure (from MATLAB)

< parameters *P; pointer to Par, will be passed to many functions

< joy_parameters jPar; joystick parameters structure (from MATLAB)

< joy_parameters *jP; pointer to jPar, will be passed to other functions

< datas dat; model data structure containing all model (physics) informations

< pointer to dat, will be passed to many many functions

Definition at line 112 of file main.cpp.

References Boat_create(), ODE_data::d, data_init(), data_update_param(), data_update_state(), do_on_keystate(), DrawGLScene(), f_dat, getCallibatingPhase(), joystick_init(), ODE_data::P, pass_joy_parameters(), process_events(), quit_tutorial(), read_arguments_from_file(), setup_font(), setup_opengl(), setup_SDL(), solve_ODE(), solver_init(), ODE_data::state, STATENUM, datas::t, tic(), ODE_data::time_param, toc(), wave_init(), and write_results_to_file().

void quit_tutorial | ( | int | code | ) |

Program quit function.

This function quits the program ant returns the error code passed to it to the standard error (shell) Pass 0 to to quit normally, and any other value to indicate a quit on an error.

Parameters:

  | code | : error code

Definition at line 84 of file main.cpp.

References Boat_delete(), close_font(), f_dat, free_wave_variables(), joystick_close(), solver_free(), and ODE_data::state.

Referenced by handle_key_down(), main(), process_events(), resize_window(), and setup_SDL().

## Variable Documentation

ODE_data* f_dat = &f_dats

Definition at line 67 of file main.cpp.

Referenced by f(), main(), quit_tutorial(), solve_ODE(), solver_free(), and solver_init().

ODE_data f_dats

Definition at line 66 of file main.cpp.

int goLoop = 1

Definition at line 64 of file main.cpp.

float rot1 = 0.0f

Definition at line 61 of file main.cpp.

float rot2 = 0.0f

Definition at line 62 of file main.cpp.

GLboolean should_rotate = GL_TRUE`[static]`

Definition at line 54 of file main.cpp.