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

Author Topic: glGenVertexArrays on the Mac  (Read 2412 times)

0 Members and 1 Guest are viewing this topic.

SpacedCowboy

  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Email
glGenVertexArrays on the Mac
« on: September 12, 2020, 12:53:02 am »
Not sure if this is an SFML thing or not, but on the Mac I needed to alter <SFML/OpenGL.hpp> to read as


#elif defined(SFML_SYSTEM_MACOS)

    #include <OpenGL/gl3.h>
 


... note the 'gl3.h' part, not the original 'gl.h'. Without this, Xcode won't find glGenVertexArrays() it gives instead:

Use of undeclared identifier 'glGenVertexArrays'; did you mean 'glGenVertexArraysAPPLE'?
 


This is using the SFML install from homebrew (2.5.1)


[edit: never mind. I hadn't realized that GLEW was pretty much essential for the extensions etc., and GLEW wants to include <OpenGL/gl.h>, and it's not a good idea to include both...

So, once GLEW is included and init'd, the call to glGenVertexArrays works fine.

I tried to delete this post, but I can't, hence the edit]
« Last Edit: September 12, 2020, 03:17:46 am by SpacedCowboy »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: glGenVertexArrays on the Mac
« Reply #1 on: September 16, 2020, 08:04:16 am »
SFML only exposes the OpenGL symbols that it uses itself.
GLEW is a relatively outdated way to get OpenGL symbols and it's probably better to use something like Glad.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/