HaxeFlixel/flixel-demos — pull request #148 by anissen (2014-09-07 20:53:47+00:00)
Title: Ensure that shaders can be compiled on Android

When compiling shaders on Android, I found the following two issues
1) Writing `#version 120` will fail with `GLSL error: #version must occur before any other statement in the program`
2) Attempting to initialize uniforms, e.g. `uniform float amount = 0.2;` - will fail with `'uniform' : cannot initialize this type of qualifier`

The error will be similar to the following:
```
I/trace (23534): Shader.hx:53: Fragment shader compilation failed.
I/trace (23534): ERROR: 0:2: '' : GLSL error: #version must occur before any other statement in the program
I/trace (23534): ERROR: 0:11: 'uniform' : cannot initialize this type of qualifier
I/trace (23534): ERROR: 2 compilation errors. No code generated.
```

So, in the postprocessing demo, the `grayscale` and `invert` fragment shaders will fail with the `#version 120` issue on Android and `scanline` will fail with both `#version 120` and `uniform float scale = 1.0;`. This PR fixes those issues.

--

PS.
* The `scanline` shader doesn't work properly on Android...
* The `grain` shader, although _very_ pretty, absolutely kills the framerate on Android.