SFML community forums
Help => General => Topic started by: pighead10 on December 22, 2011, 07:24:11 pm
-
dumb question: do I have to download something extra to use OpenGL with SFML? I try to use OpenGL code like
glClearDepth(1.f);
in my project following 1.6 tutorials with 2.0 but I just get 'identifier is undefined'
-
You must include the OpenGL headers.
-
I have SFML/Window.hpp included, which in the tutorial it says includes the opengl headers as well.
-
Well this is not 1.6 now is it? Despite that, it's a bad practice to ignore includes just because you expect another to include it for you.
-
Okay, so i need to include the opengl headers separately now.
-
Um - what are the headers for opengl? I tried
#include <GL/gl.h>
#include <GL/glu.h>
but it came up with a ton of compiler errors.
-
#include <SFML/OpenGL.hpp>
-
I get linker errors with openGL functions when using the opengl code. What library directories do I need to include?
-
On Windows, you have to link OpenGL32.lib.
-
Linking that solves most linker errors except:
main.obj : error LNK2001: unresolved external symbol _gluPerspective@32
-
This one is from GLU (glu32.lib).