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

Author Topic: SFML and Compute Shaders  (Read 3553 times)

0 Members and 1 Guest are viewing this topic.

coder7

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML and Compute Shaders
« 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). 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!
« Last Edit: April 05, 2021, 04:01:21 am by coder7 »

fallahn

  • Hero Member
  • *****
  • Posts: 507
  • Buns.
    • View Profile
    • Trederia
Re: SFML and Compute Shaders
« Reply #1 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

coder7

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML and Compute Shaders
« Reply #2 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.