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

Author Topic: gluPerspective not working  (Read 2440 times)

0 Members and 1 Guest are viewing this topic.

kekasaurus

  • Newbie
  • *
  • Posts: 2
    • View Profile
gluPerspective not working
« on: August 29, 2017, 02:02:40 pm »
Hi!

I downloaded SFML2 and created a project template (that links and includes every file needed), however, I came across the issue of "identifier 'gluPerspective' is undefined"

I am using VS15

Any help?
PS: Yes I tried linking to glu32 but it didn't seem to work or help at all.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10989
    • View Profile
    • development blog
    • Email
Re: gluPerspective not working
« Reply #1 on: August 29, 2017, 02:42:03 pm »
Did you include the right header?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kekasaurus

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: gluPerspective not working
« Reply #2 on: August 29, 2017, 03:09:36 pm »
Yes, I included OpenGL.hpp and Graphics.hpp

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: gluPerspective not working
« Reply #3 on: August 29, 2017, 03:19:23 pm »
gluPerspective is a function of the GLU library, it is not part of the core OpenGL library nor SFML. You must include and link the relevant stuff if you want to use it (and don't try random things, Google knows how to use GLU).

You can replace it with glFrustum and a bit of maths, if you want to rely strictly on OpenGL functions -- see how it is done in SFML examples.

But all this stuff (GLU, glFrustum) is deprecated and if you want to learn modern OpenGL, then you'd better not use them. You can either use a dedicated matrix library, like GLM, or write the full maths yourself.
Laurent Gomila - SFML developer

 

anything