TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.1k stars 222 forks source link

Deleting shader! #39

Open ghost opened 9 years ago

ghost commented 9 years ago

When you load the vertex and fragment shader you try to delete them but they never(Until you close the window) are going to be deleted because they need to be detached first from the program.

Source: Stackoverflow

Shimmen commented 8 years ago

This is true, but should be an easy fix. Before this line, simply append:

glDetachShader(program, vertex);
glDetachShader(program, fragment);

This must be done since deleting a shader doesn't automatically detach it from the program (as described here).

I could create a pull request if it would be appreciated.