SFML community forums

Help => Graphics => Topic started by: Nafffen on June 10, 2024, 06:07:20 pm

Title: playing with glad/gl.h : undefined symbol: sf_glad_glGetError
Post by: Nafffen on June 10, 2024, 06:07:20 pm
Hey, I am playing a bit with sfml and opengl to learn some stuff. I am trying to use opengl es 2 instead of 1.
I started by regenerating the glad header with the same extentions but with open gl es 2 in addition.
I saw that you added prefix sf_ before almost every symbols and I wondered why ? Was that necessary ?
Also I am getting a linker error on a lot of function pointers. The first one glad_glGetError (I removed "sf_"). I dont really understand as gl.h should be header only and I can't find a big difference with your file.
Can you help me with that ?
Thank you
Title: Re: playing with glad/gl.h : undefined symbol: sf_glad_glGetError
Post by: eXpl0it3r on June 11, 2024, 09:05:32 pm
Note that the graphics module isn't compatible with OpenGL ES 2.
You can use ES 2 with the window module, but can't use texture, shader, sprites, etc.

The prefix is there to ensure no symbol conflicts when someone uses their own GLAD headers

You also can't just replace the headers SFML is using. OpenGL ES 2 has done away with the fixed graphics pipeline which SFML is still relying on. As such you'll have to change quite a few things internally to "make it work".

There are a few ports that have more or less hacked something together, for example: https://github.com/Zombieschannel/SFML/tree/GLES2
Title: Re: playing with glad/gl.h : undefined symbol: sf_glad_glGetError
Post by: Nafffen on June 12, 2024, 04:24:15 pm
I was not aware of that fork, it helped me a lot ! Thank you