now you can set optional ogl version through the first 2 parameters

This commit is contained in:
Anakin
2016-11-01 14:16:18 +01:00
parent 9d35634c0c
commit bc518f58ee
4 changed files with 45 additions and 65 deletions

View File

@@ -50,8 +50,7 @@ OpenGLController::~OpenGLController()
OpenGLController::OpenGLController(int oglMajor, int oglMinor)
{
// init variables
initDefault();
// adjust ogl version optional
iOglMajorVersion = oglMajor;
iOglMinorVersion = oglMinor;
@@ -62,34 +61,6 @@ OpenGLController::OpenGLController(int oglMajor, int oglMinor)
/////////////////////////////////////////////////////////////////////////
// private functions
void OpenGLController::initDefault()
{
pWindow = NULL;
sWindowName = "MeshViewer 2.0 pre-alpha";
iWidth = 640;
iHeight = 480;
iAntiAliasingLevel = 4;
gluiInstanceBufferID = 0;
gluiTextureID = 0;
gluiShaderPrgmID = 0;
gluiSamplerID = 0;
gluiMatrixID = 0;
fRotationX = 0;
fRotationY = 0;
fRotationZ = 0;
dTranslationX = 0;
dTranslationY = 0;
dTranslationZ = 5;
fFOV = 45.0f;
fMinView = 0.1f;
fMaxView = 100.0f;
}
void OpenGLController::processInit()
{
startGLFW();
@@ -159,10 +130,10 @@ void OpenGLController::createWindow()
if (pWindow == NULL)
{
std::string message = "Your GPU does not support OpenGL ";
message += iOglMajorVersion;
message += std::to_string(iOglMajorVersion);
message += ".";
message += iOglMinorVersion;
message += "\nTry to use older version";
message += std::to_string(iOglMinorVersion);
message += "\nTry to use an other version";
MessageBox(NULL, message.c_str(), "MeshViewer 2.0 Error", MB_OK | MB_ICONERROR);