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

Author Topic: Linking OpenGL to SFML projects  (Read 2040 times)

0 Members and 1 Guest are viewing this topic.

Guni

  • Newbie
  • *
  • Posts: 20
    • View Profile
Linking OpenGL to SFML projects
« on: February 13, 2012, 08:40:52 am »
I am using Visual Studio 2010 on Windows 7 Ultimate and I installed the latest snapshot of SFML 2.0 using CMake.

I did not use CMake to build the example projects, to see if I can do this myself. Pong compiles fine, but when I try building the OpenGL example, the linker complains:

1>Source.obj : error LNK2001: unresolved external symbol _gluPerspective@32
1>Source.obj : error LNK2001: unresolved external symbol _gluBuild2DMipmaps@28

Do I need to have GLUT or freeglut installed in order to use OpenGL with SFML? I was under the impression that SFML eliminate the need for those utilities. But if not, are both compatible with SFML?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Linking OpenGL to SFML projects
« Reply #1 on: February 13, 2012, 08:51:00 am »
Quote
Do I need to have GLUT or freeglut installed in order to use OpenGL with SFML?

No, it is only needed for the example.
Laurent Gomila - SFML developer

Guni

  • Newbie
  • *
  • Posts: 20
    • View Profile
Linking OpenGL to SFML projects
« Reply #2 on: February 13, 2012, 08:57:27 am »
Thanks for the reply,

How would I initialize an OpenGL context without freeglut or GLUT otherwise, but purely using SFML?

Edit: Is it through the Window packages, after which I initialize OpenGL, I can code in OpenGL as I would if I had used another utility like freeglut or GLUT?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Linking OpenGL to SFML projects
« Reply #3 on: February 13, 2012, 09:47:09 am »
Quote
Is it through the Window packages, after which I initialize OpenGL, I can code in OpenGL as I would if I had used another utility like freeglut or GLUT?

Yes. Create a sf::Window and you get a valid OpenGL context.
Laurent Gomila - SFML developer