managed old tutorial implementation with classes.
Bugs: nothing is displayed
This commit is contained in:
70
MshViewer/Header/OpenGLController.h
Normal file
70
MshViewer/Header/OpenGLController.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <glm\glm.hpp>
|
||||
#include <vector>
|
||||
#include "Camera.h"
|
||||
#include "Object.h"
|
||||
|
||||
class OpenGLController
|
||||
{
|
||||
public:
|
||||
OpenGLController();
|
||||
OpenGLController(int oglMajor, int oglMinor);
|
||||
~OpenGLController();
|
||||
|
||||
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();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user