SFML community forums

Help => General => Topic started by: elman2008 on April 02, 2017, 12:50:05 am

Title: OpenGl vbo, vertex arrays with sfml
Post by: elman2008 on April 02, 2017, 12:50:05 am
I'm fairly new to sfml and opengl. I'm stuck with creating vbo and vao with glGenBuffers(). Those functions are undefined until I include glew.h. I read that Sfml include glew by itself and it is not recommended to include it second time. I tried both ways - it is either undefined or linking errors. All examples I found use glBegin, glEnd blocks. Can someone point me at the right direction where I can learn about creating vbo, vao, shaders with Sfml? thank you.
Title: Re: OpenGl vbo, vertex arrays with sfml
Post by: kramitox on April 05, 2017, 01:49:14 pm
These are the headers I have had to use in my projects to get anything up and running correctly.

#include <GL/glew.h>
#include <GL/wglew.h>


#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>

#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
GLM is a math library I use for creating mat4 variables and doing all my vector rotations, translations, etc.

make sure to also call
glewInit();
Title: Re: OpenGl vbo, vertex arrays with sfml
Post by: Qiu3344 on April 05, 2017, 04:53:07 pm
Maybe you have forgotten libs like  -lopengl32  or  -lglew ?