/
display.h
78 lines (67 loc) · 1.67 KB
/
display.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* \file display.h
* \brief Initializes SDL et OpenGL
* \author Perrachon Quentin, Gourgoulhon Maxime, Boufedji Belkacem
* \version 0.9
* \date 04 25 2016
*
* Initializes OpenGL and set up the camer.
*
*/
#ifndef __DISPLAY_H__
#define __DISPLAY_H__extern GLdouble detail;
#include <SDL2/SDL.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <SDL2/SDL_opengl.h>
#include <png.h>
#define DEBUG 0
extern double pixelsize;
extern int screenshoot;
/**
* \brief LoD, Level of details
*/
extern int detail;
/**
* \brief minlon value
*/
extern GLdouble min_x;
/**
* \brief maxlon value
*/
extern GLdouble max_x;
/**
* \brief minlat value
*/
extern GLdouble min_y;
/**
* \brief maxlat value
*/
extern GLdouble max_y;
/**
* \fn void Display_InitGL()
* \brief Initializes OpenGL and enable options.
* \return void
*/
void Display_InitGL();
/**
* \fn void Display_SetViewport(int width, int height, GLdouble dx, GLdouble dy, GLdouble zoom);
* \brief Sets up the camera (proportion, position, zoom).
* \param width width of the window available for drawing.
* \param height height of the window available for drawing.
* \param dx x camera translation.
* \param dy y camera translation.
* \param zoom zoom factor.
* \return void
*/
void Display_SetViewport(int width, int height, GLdouble dx, GLdouble dy,
float zoom);
/**
* \fn void screenshot_png(const char *filename, unsigned int width, unsigned int height, GLubyte **pixels, png_byte **png_bytes, png_byte ***png_rows)
* \brief Takes a screenshoot (png format).
*/
void screenshot_png(const char *filename, unsigned int width,
unsigned int height, GLubyte ** pixels,
png_byte ** png_bytes, png_byte *** png_rows);
#endif