-
Notifications
You must be signed in to change notification settings - Fork 8
/
display.h
executable file
·68 lines (51 loc) · 1.68 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
/*
* author: Yupan Liu
* date: Dec 27, 2015
* brief: normal, mean curvature and mesh saliency
* comment: modified by "Anton's OpenGL 4 Tutorials"
*/
#include <GL/glew.h> // include GLEW and new version of GL on Windows
#include <GLFW/glfw3.h> // GLFW helper library
#include <math.h>
#include <assert.h>
#include <stdio.h>
#include "lib/maths_funcs.h"
#include "lib/gl_utils.h"
#include "QSlim.h"
#define _USE_MATH_DEFINES
#define GL_LOG_FILE "gl.log"
#define VERTEX_SHADER_FILE "shader/test_vs.glsl"
#define FRAGMENT_SHADER_FILE "shader/test_fs.glsl"
extern float fMin(float x, float y);
extern float fMax(float x, float y);
extern GLfloat* normals; // array of vertex normals
extern GLfloat* meanCurvature;
extern GLfloat* smoothSaliency;
extern GLfloat* points;
extern GLfloat* simplifiedPoints;
extern GLfloat* simplifiedNormals;
extern int vertexCnt;
extern int simplifiedVertexCnt;
extern GLuint objVAO;
extern int ObjPointCount;
extern float cam_speed;
extern float cam_yaw_speed;
extern float cam_pos[3];
extern float cam_xaw;
extern float cam_yaw;
extern float cam_zaw;
extern int view_mat_location;
extern int proj_mat_location;
extern double xLoc, yLoc;
extern double dx, dy;
// Update display mode depends on keyboard state
void updateDisplayType(int type);
// Check the pixel's color whether is legal or not
inline void checkLegal(float &x);
// Get RGB value from the YUV value
void getYUVtoRGB(bool flag, float Y, float U, float V, GLfloat& R, GLfloat& G, GLfloat& B);
void initializeOpenGL();
void createShaders(GLuint shader_programme);
inline void updateView();
void keyBoardEvent(double elapsed_seconds);
void mouseEventHandler(GLFWwindow* window, double xNow, double yNow);