Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGl vbo, vertex arrays with sfml  (Read 1988 times)

0 Members and 1 Guest are viewing this topic.

elman2008

  • Newbie
  • *
  • Posts: 2
    • View Profile
OpenGl vbo, vertex arrays with sfml
« 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.

kramitox

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: OpenGl vbo, vertex arrays with sfml
« Reply #1 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();
« Last Edit: April 05, 2017, 01:55:09 pm by kramitox »

Qiu3344

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: OpenGl vbo, vertex arrays with sfml
« Reply #2 on: April 05, 2017, 04:53:07 pm »
Maybe you have forgotten libs like  -lopengl32  or  -lglew ?

 

anything