The shader program is valid only as long as it is installed. Only the drawing calls that you make during the installation of the program will use the shader. You have to install the shader, draw your object, and then remove the shader.
Change . By "setting" a shader, I mean using it glUseProgramwith your shader descriptor. By "uninstall" I mean either installing another shader or calling glUseProgramwith an argument 0. See glUseProgram . My terminology "install / uninstall" comes from there.
source
share