Good day. I'm not expirienced OSX user, so have no idea about it.
I'm getting this error:
Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error
Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error
Failed to compile fragment shader:
ERROR: 0:1: 'f' : syntax error: syntax error
SFML version is 2.5.1
There's no such error on Linux 32/64 nor Windows 32/64
Shaders are:
#define SHADER_INVERT \
"uniform sampler2D texture; " \
" " \
"void main() { " \
" vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
" " \
" pixel.r = 1.0f - pixel.r; " \
" pixel.g = 1.0f - pixel.g; " \
" pixel.b = 1.0f - pixel.b; " \
" " \
" gl_FragColor = pixel; " \
"} "
#define SHADER_WHITE \
"uniform sampler2D texture; " \
" " \
"void main() { " \
" vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
" " \
" pixel.r = 1.0f; " \
" pixel.g = 1.0f; " \
" pixel.b = 1.0f; " \
" " \
" gl_FragColor = pixel; " \
"} "
#define SHADER_GREY \
"uniform sampler2D texture; " \
" " \
"void main() { " \
" vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);" \
" " \
" gl_FragColor.r = (pixel.r+pixel.g+pixel.b) / 3.0f; " \
" gl_FragColor.g = gl_FragColor.r; " \
" gl_FragColor.b = gl_FragColor.r; " \
" gl_FragColor.a = pixel.a; " \
"} "
Loading code:
shaders.white.loadFromMemory (SHADER_WHITE , sf::Shader::Fragment);
shaders.grey.loadFromMemory (SHADER_GREY , sf::Shader::Fragment);
shaders.invert.loadFromMemory(SHADER_INVERT, sf::Shader::Fragment);
Bonus question bonus not related to graphics, but related to Mac OS X:
After app start i got this:
"We got a keyboard without any keys (1)"
I use Mac mini with standart usb keyboard attached