-
Notifications
You must be signed in to change notification settings - Fork 0
/
WindowManager.hpp
41 lines (37 loc) · 1.02 KB
/
WindowManager.hpp
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
#pragma once
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
#include <string_view>
#include "shader.hpp"
#include "KernelLauncher.cuh"
#include "cmath"
namespace VertexAttributes{
enum VertexAttributes{
vao_position=0,
vao_color=1,
vao_texture=2,
};
};
class WindowManager
{
public:
WindowManager()=delete;
WindowManager(int width=500, int height=500, const char* windowName="FlashLight Simulation");
~WindowManager() ;
void GLFWindowGeneration() ;
void simulation() ; // game loop
private:
void initialize() ; // a function that initializes glfw
void renderer() ; // a function that renders the window, contains the loop
void drawing(GLFWwindow * window, Shader& program) ; // a function that actually draws stuffs on screen
void createFlashlightTexture(uchar *flashlightTexture);
GLFWwindow * p_window ;
int p_width, p_height ;
const char* p_windowName{nullptr};
GLuint _vbo, _ebo, _vao ;
GLuint _image ;
GLuint _texture;
KernelLauncher* p_kernelLauncher ;
float p_radius{0.25f};
};