preparation to replace glew by glad

This commit is contained in:
Erwin Coumans
2018-02-20 19:44:02 -08:00
parent 8bb40b632b
commit b0984de046
21 changed files with 151 additions and 41375 deletions

View File

@@ -71,6 +71,8 @@ static SimpleOpenGL3App* gApp=0;
static void SimpleResizeCallback( float widthf, float heightf)
{
int width = (int)widthf;
int height = (int)heightf;
if (gApp && gApp->m_instancingRenderer)
@@ -285,6 +287,14 @@ struct MyRenderCallbacks : public RenderCallbacks
}
};
static void printGLString(const char *name, GLenum s) {
const char *v = (const char *) glGetString(s);
printf("%s = %s\n",name, v);
}
bool sOpenGLVerbose = true;
SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, bool allowRetina)
{
gApp = this;
@@ -308,7 +318,16 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
m_window->setWindowTitle(title);
b3Assert(glGetError() ==GL_NO_ERROR);
{
printGLString("Version", GL_VERSION);
printGLString("Vendor", GL_VENDOR);
printGLString("Renderer", GL_RENDERER);
}
glClearColor( m_backgroundColorRGB[0],
m_backgroundColorRGB[1],
@@ -321,7 +340,10 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
b3Assert(glGetError() ==GL_NO_ERROR);
#ifndef NO_GLEW
//gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
#ifdef USE_GLEW
#ifndef __APPLE__
#ifndef _WIN32
#ifndef B3_USE_GLFW
@@ -337,7 +359,8 @@ SimpleOpenGL3App::SimpleOpenGL3App( const char* title, int width,int height, boo
exit(1); // or handle the error in a nicer way
#endif //B3_USE_GLFW
#endif //__APPLE__
#endif //NO_GLEW
#endif //USE_GLEW
glGetError();//don't remove this call, it is needed for Ubuntu
b3Assert(glGetError() ==GL_NO_ERROR);