Reputation: 1163
I checked docs, and it says OpenGL version must be at least 1.5 to make glGenBuffers()
work. The user has version 1.5 but the function call will cause a crash. Is this a mistake in the docs, or a driver problem on the user?
I am using this glGenBuffers()
for VBO, how do i check if the user has support for this?
Edit: im using glew with glewInit()
to initialize VBO
Edit2: I got it working on the user with glGenBuffersARB()
function calls. But im still looking a way to find out when should i use glGenBuffers()
and when should i use glGenBuffersARB()
AND when should i use VertexArrays if none of the VBO function calls are supported.
I also found out that if(GLEW_VERSION_1_5)
returns false on the user, but GL_VERSION
gives 1.5.0, which just doesnt make any sense!
Upvotes: 2
Views: 4211
Reputation: 257
I'm going to tell you now to stay far away from GLEW or any of these libraries mostly because they're useless, this is how I have always done it.
#ifndef STRINGIFY
#define STRINGIFY(x) #x
#endif
#ifdef WIN32
#include <windows.h>
#define glGetProcAddress(a) wglGetProcAddress(a)
#endif
#ifdef X11
#define glGetProcAddress(a) glXGetProcAddress ( \
reinterpret_cast<const unsigned char*>(a) \
)
#endif
#ifndef GetExtension
#define GetExtension(Type, ExtenName) \
ExtenName = (Type) \
glGetProcAddress(STRINGIFY(ExtenName)); \
if(!ExtenName) \
{ \
std:cout << "Your Computer Does Not " \
<< "Support GL Extension: " \
<< STRINGIFY(ExtenName) \
<< std::endl; \
exit(1); \
} \
else \
{ \
std::cout << "Loadded Extension: " \
<< STRINGIFY(ExtenName) \
<< std::endl; \
}
#endif
// then just use this :D
GetExtension(PFNGLGENBUFFERSARBPROC, glGenBuffersARB)
// after your done you can do this
#undef GetExtension
#undef glGetProcAddress
// you can then also undef the STRINGIFY macro
// though it does come in handy.
Upvotes: 2