EGL OpenGL window.

This commit is contained in:
yunfeibai
2017-02-06 16:22:17 -08:00
parent 7e08e960a1
commit c92fd6120d
8 changed files with 223 additions and 132 deletions

View File

@@ -20,7 +20,11 @@
#include "Win32OpenGLWindow.h"
#else
//let's cross the fingers it is Linux/X11
#ifdef BT_USE_EGL
#include "EGLOpenGLWindow.h"
#else
#include "X11OpenGLWindow.h"
#endif //BT_USE_EGL
#endif //_WIN32
#endif//__APPLE__
#include <stdio.h>
@@ -115,25 +119,27 @@ SimpleOpenGL2App::SimpleOpenGL2App(const char* title, int width, int height)
m_window->setWindowTitle(title);
#ifndef NO_GLEW
#ifndef __APPLE__
#ifndef _WIN32
//some Linux implementations need the 'glewExperimental' to be true
//some Linux implementations need the 'glewExperimental' to be true
glewExperimental = GL_TRUE;
#endif
#endif //_WIN32
if (glewInit() != GLEW_OK)
{
{
b3Error("glewInit failed");
exit(1);
}
exit(1);
}
if (!GLEW_VERSION_2_1) // check that the machine supports the 2.1 API.
{
b3Error("GLEW_VERSION_2_1 needs to support 2_1");
exit(1); // or handle the error in a nicer way
}
#endif
{
b3Error("GLEW_VERSION_2_1 needs to support 2_1");
exit(1); // or handle the error in a nicer way
}
#endif //__APPLE__
#endif //NO_GLEW
TwGenerateDefaultFonts();