SFML community forums
Help => Graphics => Topic started by: Strobe on August 19, 2011, 02:50:55 am
-
Hi,
I'm trying to implement a simple function in my GLSL shader program, but am met with errors. The version of SFML I am using is 1.6, with Code::Blocks 10.05 for Windows (MinGW).
Here's the offending code:
// shader.sfx
texture Img1
float foo(in float fubar)
{
return(fubar);
}
effect
{
_out = Img1(_in);
}
and here are the errors:
Post-effect error : invalid declaration (should be "[type][name]")
> {
Failed to compile post-effect :
(0) : error C0000: syntax error, unexpected $end at token "<EOF>"
(0) : error C0501: type name expected at token "<null atom>"
I suspect SFML isn't properly parsing the shader source. One reason for my belief is that it won't accept the ';' terminator at the end of variable declarations. Another is how this will work:
effect
{
_out = Img1(_in);
}
but this will not:
effect {
_out = Img1(_in);
}
I've tried not adding ';' at the end of the return line, and also removing 'in,' among other things.
Should I be using SFML 2.0?
thx,
~Strobe
-
I suspect SFML isn't properly parsing the shader source
I think so.
Should I be using SFML 2.0?
Definitely!
-
Alright, I'll give it a try.
BTW, I tried wrapping code and quote tags around text in my post, but they didn't do anything. But now, there they are. Thanks, if that was your doing :)
-
Yeah... you had the "Disable BBCode" box checked ;)
-
Gah! Thank you :oops:
-
Yes! Got 2.0 compiled (which was a surprisingly painless process), and everything is as it should be. Had a difficult patch while trying to compile a program, but I played Tower of Hanoi with the linked libraries until I found the right order.
GLSL shaders now seem to be working as they should 8) Thanks again for everything, Laurent!