Game Development Reference
In-Depth Information
sf::Shader and OpenGL
If we were to draw things directly in OpenGL, but still wanted to use the Shader class to
load and manage our shaders, we could do that without much difficulty—we just need to
bind the shader. OpenGL uses the currently bound shader for its draw calls. The code struc-
ture for such a scenario looks like this:
And that is it for shaders. We will finish the chapter with one final example, which uses
both render textures and shaders to create a pixelation effect.
Search WWH ::




Custom Search