SWBF2-Classic-Msh-Viewer/MshViewer/Header/OpenGLController.h

74 lines
1.1 KiB
C++

#pragma once
#include <string>
#include <glm\glm.hpp>
#include <vector>
#include "Camera.h"
#include "Object.h"
class OpenGLController
{
public:
static OpenGLController& getInstance(int oglMajor = 4, int oglMinor = 5);
~OpenGLController();
private:
OpenGLController() {};
OpenGLController(int oglMajor, int oglMinor);
private:
int iOglMajorVersion;
int iOglMinorVersion;
int iAntiAliasingLevel;
std::string sWindowName;
GLFWwindow* pWindow;
int iWidth;
int iHeight;
GLuint gluiMatrixID;
GLuint gluiSamplerID;
glm::mat4 m4x4Model;
glm::mat4 m4x4MVP;
Camera* camera;
Object* object;
struct {
double posX;
double posY;
bool leftHold;
bool middleHold;
bool rightHold;
double speed;
} stcMouse;
private:
void initDefault();
void processInit();
void startGLFW();
void startGLEW();
void createWindow();
void setCallbackFunctions();
public:
glm::mat4 getMVPMatrix();
GLFWwindow* getWindow() const;
void resize(int width, int height);
void addRotX(float value);
void addRotY(float value);
void addTransX(double value);
void addTransY(double value);
void addTransZ(double value);
void updateScene();
};