paroj / gltut

Learning Modern 3D Graphics Programming
https://paroj.github.io/gltut/
MIT License
1.57k stars 377 forks source link

Fixed bug in GammaRamp tutorial #1

Closed Sand3r- closed 8 years ago

Sand3r- commented 8 years ago

...Which caused the lower image to be not displayed.

paroj commented 8 years ago

can you elaborate on the problem at hand? the code seems fine without your changes. (which miss the calls to glDeleteShader BTW)

Sand3r- commented 8 years ago

Calls to glDeleteShader were the main cause of the problem, and were therefore omitted.

Since the Framework::CreateProgram function deletes all the passed shaders after the program linking, the repeated call in InitializeProgram() results in attempt of deleting already deleted shaders.

The program g_gammaProgram attempts to reuse already deleted vertexShader, which results in program linking failure, and prevents any further use of it, which eventually results in the bottom stripe not being rendered.

paroj commented 8 years ago

Since the Framework::CreateProgram function deletes all the passed shaders

missed that. thanks :+1: