Adding Opengl Extensions (ARB_direct_state_access)

Im trying to use Opengl 4.5 functions such as CreateBuffer() and Ive initialized GLEW but I do not understand how to Implement ARB_direct_state_access to make the 4.5 functions work.

if I say:

if(GLEW_ARB_direct_state_access)
 {
   glewInit()
 }

The CreateBuffers Seem to work (I think) but now CreateShader() Yields another access error. I know Im doing something wrong. Ive been looking all over but cannot seem to find any tut on how to actually use ARB_direct_state_access to make functions work. Thank you!

You have that backwards. You always initialize GLEW; the condition on GLEW_ARB_direct_state_access is whether you use the DSA functions.

Thank you for your reply, Writing it like this:

glewInit();
GLEW_ARB_direct_state_access;

Still gives me access error at CreateBuffers() however, while GenBuffers() works.

I dont think Im implementing GLEW_ARB_direct_state_access The right way at all.

If I could use opengl 4.5 I would; thanks!

[QUOTE=Rockindooodle;1280588]Writing it like this:
glewInit();
GLEW_ARB_direct_state_access;

Still gives me access error at CreateBuffers() however, while GenBuffers() works.
[/QUOTE]


glewInit();
if (GLEW_ARB_direct_state_access) {
    // DSA is supported
}
else
{
    // DSA isn't supported
}

wow thank you! I now know DSA is not supported, I have just one more question, would this be a driver issue? I have opengl 4.3 currently installed. how do I fix this. THANKS!

DSA isn’t in defined in core OpenGL prior to OpenGL 4.5 (link). So if your drivers only support OpenGL 4.3, you’ll be accessing it via the ARB_direct_state_access extension (if supported). It’s possible your current drivers just don’t support it.

You might use glGetString() to print out GL_VENDOR, GL_RENDERER, GL_VERSION, and GL_EXTENSIONS. That’ll give you more information. If your drivers support ARB_direct_state_access, you’ll see it in the GL_EXTENSIONS string.

Alternatively, use glGetStringi( GL_EXTENSIONS, i), with the range of i determined by glGetIntegerv(GL_NUM_EXTENSIONS). It’s possible that a driver might not report all of the extensions via glGetString(GL_EXTENSIONS) in order to keep the length of the result down. Modern code should be using glGetStringi() (in the core profile, GL_EXTENSIONS isn’t a valid argument to glGetString()).

Also, try setting glewExperimental; that causes GLEW to query function pointers regardless of whether the extension is listed in the result of glGetString(GL_EXTENSIONS). I don’t know whether GLEW_ARB_direct_state_access is based upon the extension string or the function pointer, so check whether glCreateBuffers() is non-null.

Considering when 4.3 shipped and when ARB_direct_state_access shipped, it’s highly unlikely to find an implementation that supports only 4.3 (and not 4.4) which also supports ARB_direct_state_access.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.