SFML community forums

Help => Graphics => Topic started by: lmorsino on June 02, 2014, 07:16:01 pm

Title: SFML with vertex array objects
Post by: lmorsino on June 02, 2014, 07:16:01 pm
Trying to get VAOs working, not succeeding, and I'm wondering if it is because of GLEW.

Basically, I try to do this:

glGenVertexArrays(1, &g_vao);
glBindVertexArray(g_vao);

This doesn't compile. I looked into it further and it seems like GLEW 1.5.0 (is this version specifically required by SFML 2.1?) doesn't support vertex arrays. When I tried

if (glewIsSupported("GL_ARB_vertex_array_object"))

...this returns false. If I upgrade to the latest version of GLEW 1.10.0, it returns true but my app crashes during rendering (presumably because SFML doesn't support 1.10.0)

Later I found this page: http://glew.sourceforge.net/log.html
...which seems to indicate vertex arrays weren't added until GLEW 1.5.1

Am I understanding this correctly? Are we simply meant to not use VAOs in SFML?

If it matters, I am on Ubuntu 13.10-64 bit with C::B, and I am not using SFML for drawing - its pure OpenGL calls.
Thanks!
Title: Re: SFML with vertex array objects
Post by: Laurent on June 02, 2014, 08:19:48 pm
Use whatever GLEW you want, what does it have to do with SFML?
Title: Re: SFML with vertex array objects
Post by: lmorsino on June 02, 2014, 09:46:56 pm
Well, when I try to use GLEW 1.10 for example, I get a warning message at compile time that says

"warning: libGLEW.so.1.5, needed by libsfml-graphics.so, not found"

So this is why I think it matters to SFML. Is it needed or is it not needed?
Title: Re: SFML with vertex array objects
Post by: Laurent on June 02, 2014, 10:43:14 pm
Ah, Linux... too bad you can't link to a newer version, although they should be binary compatible. The best solution is to recompile SFML so that it links to your more recent GLEW.