- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

# D:/Basile/VisualCppProjects/hydroMEX3/hydroMEX3/oGL_graphics/graphics_relative.h File Reference

`#include <windows.h>`
`#include <stdio.h>`
`#include <stdarg.h>`
`#include <GL\glut.h>`
`#include <GL\gl.h>`
`#include <GL\glu.h>`
`#include <GL\glaux.h>`
`#include "../joystick/joystick_PC.h"`
`#include "../hydro_source/Datas.h"`
`#include "Sea.h"`
`#include "solid_objects.h"`

Include dependency graph for graphics_relative.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Functions
LRESULT CALLBACK | WndProc (HWND, UINT, WPARAM, LPARAM)
| Callback and keyboard management.
GLvoid | ReSizeGLScene (GLsizei width, GLsizei height)
int | InitGL (GLvoid)
| Initialize OpenGL stuff.
int | DrawGLScene (datas *d)
| Draws the scene (openGL).
GLvoid | KillGLWindow (GLvoid)
BOOL | CreateGLWindow (char *title, int width, int height, int bits, bool fullscreenflag)
| Sub-function for window closing stuffs.
int | draw_graphics_init (datas *d)
| General graphic stuff initialisation.
bool | draw_graphics (datas *d)
| General graphic (scene) display and keyboard reading.
int | draw_graphics_kill ()
| General graphic (scene/window) closing.
void | pass_joy_parameters (joy_parameters *jP)
| Copy joystick parameters from MATLAB struct.

## Detailed Description

Author:
  basile.graf@epfl.ch

This file contains includes for graphical purposes and declarations for some graphic related functions

Definition in file graphics_relative.h.

## Function Documentation

BOOL CreateGLWindow | ( | char * | title,
|  | int | width,
|  | int | height,
|  | int | bits,
|  | bool | fullscreenflag
| ) |

| Sub-function for window closing stuffs. Definition at line 331 of file graphics_main.cpp. References fullscreen, hDC, hInstance, hRC, hWnd, InitGL(), KillGLWindow(), ReSizeGLScene(), and WndProc(). Referenced by draw_graphics(), and draw_graphics_init().

bool draw_graphics | ( | datas * | d | ) |

  | General graphic (scene) display and keyboard reading. A call to this function refreshes the entire scene. This function is to be used in the main computing loop. It also reads the keyboard for the different keyboard controls... Parameters:
  | *d | : pointer to the datas data-structure
Returns: true if all went OK Definition at line 599 of file graphics_main.cpp. References active, allowChangeDirR, allowChangeDirX, allowChangeDirY, allowChangeDirZ, allowChangeDoR, allowChangeDoX, allowChangeDoY, allowChangeDoZ, datas::angle_girouette, CreateGLWindow(), dirR, dirX, dirY, dirZ, done, doR, doX, doY, doZ, DrawGLScene(), dviewAngle, dviewDist, fullscreen, hDC, datas::Hslider_x, keys, KillGLWindow(), datas::max_abs_angle_baume, msg, datas::t, datas::tanAngle_sail, datas::target_x, datas::target_y, time_before, time_elapsed, viewAngle1, viewAngle2, viewDist, datas::Vslider_x, datas::Wave_amp, datas::Wave_amp0, datas::Wave_amp1, datas::Wave_amp2, datas::Wind, datas::Wind_angle, datas::Wind_x, and datas::Wind_y. Referenced by mexFunction().

int draw_graphics_init | ( | datas * | d | ) |

  | General graphic stuff initialisation. Ask for full-screen or not, creates window and try to initialize the joystick. Parameters:
  | *d | : pointer to the datas data-structure
Returns: 1 if window created sucessfully Definition at line 568 of file graphics_main.cpp. References CreateGLWindow(), fullscreen, joystick_exist, and joystick_init(). Referenced by mexFunction().

int draw_graphics_kill | ( |  | ) |

| General graphic (scene/window) closing. Closes window and joystick Returns: msg.wParam (MS Windows !) Definition at line 774 of file graphics_main.cpp. References done, joystick_close(), KillGLWindow(), and msg. Referenced by mexFunction().

int DrawGLScene | ( | datas * | d | ) |

| Draws the scene (openGL). Draws the scene by appling all necessary geometrical (spacial) transformations and by calling the different element drawing functions (for the boat, the sea, the instruments...). This is not the highest function for drwaing the current scene, see draw_graphics(). Definition at line 189 of file graphics_main.cpp. References angles_update(), Boat_draw(), dirR, dirX, dirY, dirZ, doR, doX, doY, doZ, Draw_sea(), datas::dx, datas::dy, f(), fps, Girouette_draw(), glPrint(), HSlider_draw(), datas::Hslider_x, joystick_exist, joystick_getXYZR(), LightPosition, datas::phi, datas::psi, RelativeWind_draw(), Sail_create_and_draw(), Target_draw(), datas::target_x, datas::target_y, datas::theta, time_elapsed, viewAngle1, viewAngle2, viewDist, VSlider_draw(), datas::Vslider_x, wave_z_compute(), datas::Wind, datas::Wind_x, datas::Wind_y, datas::x, datas::y, and datas::z. Referenced by draw_graphics().

int InitGL | ( | GLvoid |  | ) |

| Initialize OpenGL stuff. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Definition at line 159 of file graphics_main.cpp. References BuildFont(), f(), LightAmbient, LightDiffuse, and LightPosition. Referenced by CreateGLWindow().

GLvoid KillGLWindow | ( | GLvoid |  | ) |

| Definition at line 287 of file graphics_main.cpp. References fullscreen, hDC, hInstance, hRC, and hWnd. Referenced by CreateGLWindow(), draw_graphics(), and draw_graphics_kill().

void pass_joy_parameters | ( | joy_parameters * | jP | ) |

  | Copy joystick parameters from MATLAB struct. Copy the joystick parameters (doX, doY ,doZ ,doR and dirX ,dirY ,diZ ,dirR) from the MATLAB struct *jP to the local joystick parameters variables. Parameters:
  | *jP | : Structure comming from MATLAB or filled with default values defining joystick axes usage and direction.
Definition at line 788 of file graphics_main.cpp. References joy_parameters::dirR, dirR, joy_parameters::dirX, dirX, joy_parameters::dirY, dirY, joy_parameters::dirZ, dirZ, joy_parameters::doR, doR, joy_parameters::doX, doX, joy_parameters::doY, doY, joy_parameters::doZ, and doZ. Referenced by mexFunction().

GLvoid ReSizeGLScene | ( | GLsizei | width,
|  | GLsizei | height
| ) |

| Definition at line 138 of file graphics_main.cpp. References f(). Referenced by CreateGLWindow(), and WndProc().

LRESULT CALLBACK WndProc | ( | HWND | ,
|  | UINT | ,
|  | WPARAM | ,
|  | LPARAM |
| ) |

| Callback and keyboard management. Definition at line 510 of file graphics_main.cpp. References active, keys, and ReSizeGLScene(). Referenced by CreateGLWindow().