...no return value is checked. For a sample application where you want to know "is that effect working for me?" not a good solution (in my humble opinion).
Actually, the return value will reflect the fact that :
- The file has been found
- There's no error in the pseudo-GLSL code
- No internal OpenGL call failed, which will be the case if CanUsePostFX() returned true
As I'm sure the files are there, the code contains no error and as I check CanUsePostFX(), there's no really need for checking the return value in this sample.
But anyway you're right, I should add it, that's not a good practice to show people such potentially unsafe code
Failed to compile effect :
ERROR: 0:5: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type 'float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:7: '<' : wrong operand types no operation '<' exists that takes a left-hand operand of type 'float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 2 compilation errors. No code generated.
Ok, so apparently your driver doesn't want to consider "7" and "1" as floats. What if you replace with "7.f" and "1.f", or "7.0" and "1.0" ?
It loads and compiles without any problems but then it simply freezes the whole application - and I don't know why
That's annoying... The problem is that your driver probably doesn't support random/multiple texture lookup in the shader, but there's no way to detect it if it succeeds to compile the effect. Do you have the latest version of your driver ?
With the help of the tool "GPU Caps Viewer v1.4.0" from "oZone3D" (which can be found here) I figured out that my version of GLSL is...
...none?!?
That's right, the GLSL extensions are not exposed by your driver. How can it work ??