Skip to content

Instantly share code, notes, and snippets.

@kenpower
Last active December 9, 2015 20:58
Show Gist options
  • Select an option

  • Save kenpower/4327363 to your computer and use it in GitHub Desktop.

Select an option

Save kenpower/4327363 to your computer and use it in GitHub Desktop.
Load & Bind a GLSL shader in SFML
sf::Shader shader; //cretae an SFML shader object
//load, compile, link shader code
if(!shader.loadFromFile("vertex.glsl","fragment.glsl")){
exit(1); //error has occured
}
sf::Shader::bind(&shader); //select this shader for use in the pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment