-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.h
More file actions
104 lines (81 loc) · 2.3 KB
/
main.h
File metadata and controls
104 lines (81 loc) · 2.3 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef MAIN_H
#define MAIN_H
#include <GL/glew.h>
#include <GL/glut.h>
#include <stdlib.h>
#include <cuda_runtime.h>
#include <cuda_gl_interop.h>
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include "glslUtility.h"
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "kernel.h"
#include "utilities.h"
#if CUDA_VERSION >= 5000
#include <helper_cuda.h>
#include <helper_cuda_gl.h>
#define compat_getMaxGflopsDeviceId() gpuGetMaxGflopsDeviceId()
#else
#include <cutil_inline.h>
#include <cutil_gl_inline.h>
#define compat_getMaxGflopsDeviceId() cutGetMaxGflopsDeviceId()
#endif
using namespace std;
//-------------------------------
//------------GL STUFF-----------
//-------------------------------
GLuint positionLocation = 0;
GLuint texcoordsLocation = 1;
const char *attributeLocations[] = { "Position", "Texcoords" };
GLuint pbo = (GLuint)NULL;
GLuint planeVBO = (GLuint)NULL;
GLuint planeTBO = (GLuint)NULL;
GLuint planeIBO = (GLuint)NULL;
GLuint planetVBO = (GLuint)NULL;
GLuint planetIBO = (GLuint)NULL;
GLuint displayImage;
GLuint program[2];
const unsigned int HEIGHT_FIELD = 0;
const unsigned int PASS_THROUGH = 1;
const int field_width = 800;
const int field_height = 800;
float fovy = 60.0f;
float zNear = 0.10;
float zFar = 5.0;
glm::mat4 projection;
glm::mat4 view;
glm::vec3 cameraPosition(1.75,1.75,1.35);
//-------------------------------
//----------CUDA STUFF-----------
//-------------------------------
int width=750; int height=750;
//-------------------------------
//-------------MAIN--------------
//-------------------------------
int main(int argc, char** argv);
//-------------------------------
//---------RUNTIME STUFF---------
//-------------------------------
void runCuda();
void display();
void keyboard(unsigned char key, int x, int y);
//-------------------------------
//----------SETUP STUFF----------
//-------------------------------
void init(int argc, char* argv[]);
void initPBO(GLuint* pbo);
void initCuda();
void initTextures();
void initVAO();
void initShaders(GLuint * program);
//-------------------------------
//---------CLEANUP STUFF---------
//-------------------------------
void cleanupCuda();
void deletePBO(GLuint* pbo);
void deleteTexture(GLuint* tex);
void shut_down(int return_code);
#endif