SFML community forums

Help => General => Topic started by: coder7 on April 05, 2021, 03:57:00 am

Title: SFML and Compute Shaders
Post by: coder7 on April 05, 2021, 03:57:00 am
Hi!

I'm new to SFML and compute shaders. I've done small experiments with both of them (I am in love with SFML, by the way). I am hoping someone could point me out on how to start using them together.

As far as I understand, SFML doesn't have its own functions to use compute shaders, so I need to use raw OpenGL (as per https://en.sfml-dev.org/forums/index.php?topic=20568.0 (https://en.sfml-dev.org/forums/index.php?topic=20568.0)). However, I have noticed that with just the module SFML/OpenGL.hpp I do not have some functions that I need (e.g., glDispatchCompute()). Is that because SFML/OpenGL.hpp only defines functions from and older version of OpenGL?

I've had trouble finding the specifics of what I need, so could someone point me in the right direction to start using compute shaders with SFML?

Thank you in advance!
Title: Re: SFML and Compute Shaders
Post by: fallahn on April 05, 2021, 10:16:51 am
You'll need to create a gl loader with something like https://glad.dav1d.de/ and include the resulting files in your project. Note that these may or may not mix well with sfml's graphic module, so you may need to omit that and use the window module directly with opengl. I believe there's an example in the tutorial section  ;D
Title: Re: SFML and Compute Shaders
Post by: coder7 on April 17, 2021, 12:13:01 am
You'll need to create a gl loader with something like https://glad.dav1d.de/ and include the resulting files in your project. Note that these may or may not mix well with sfml's graphic module, so you may need to omit that and use the window module directly with opengl. I believe there's an example in the tutorial section  ;D

Thank you!! Appreciate the help.