preparation to replace glew by glad
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user