I am compleatly new to both SFML and OpenGL. Following the holy LearnOpenGl tutorial I managed to make a triangle, but now I have used SFML for a lot of a project already and I need to do something in 3d, thus (I think) I need glfw and glad but when I try to glad gives me the following error: OpenGL header already included, remove this include, glad already provides it
. If I have made a big mistake I dont understand why so could someone please explain how to use them both or why only one can be used?
Asked
Active
Viewed 306 times
0

Thomas Bourne
- 66
- 6
-
What includes do you have before glad? – HolyBlackCat Sep 03 '21 at 19:22
-
just sfml/OpenGL.hpp – Thomas Bourne Sep 04 '21 at 20:41
-
You have to choose between SFML and GLFW (both can be used with OpenGL). If you choose the former, it seems you don't need glad. If you choose the latter, you do need it (or a similar library). – HolyBlackCat Sep 04 '21 at 20:47
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 05 '21 at 14:26
1 Answers
1
From what I understand glad already includes the necessary GL headers. So just do what the error message tells you and remove your own "include" of OpenGL. Only include the glad headers.
Also from my experience you do NOT need GLFW when using SMFL, as SFML provides a valid OpenGL context for you when creating a window.

Sunbeam
- 26
- 3