error C0501: type name expected at token "<invalid atom -1>"

Started by Eternity, June 28, 2009, 00:29:25

Previous topic - Next topic

Eternity

Hey.

i have a couple of shaders that i load from plain text files that works perfectly fine but now i'm trying to hardcode some of them in the source code of my engine by putting their code into one big String.

Some of these hard coded shaders compile happily while others give the following errors

error C0000: syntax error, unexpected $end at token "<EOF>"
error C0501: type name expected at token "<invalid atom -1>"

any idea what might cause this?

i use ByteBuffer.wrap(vertexShaderCode.getBytes())  and ByteBuffer.wrap(fragmentShaderCode.getBytes())  to get the needed bytebuffers. and thats essentialy the the only piece of code thats different from when i load the shaders from text files.

Thnx in Advance!

Eternity

i found my problem.

in my java class where i declare the huge string i simply concatenate all the lines from the text files together without ever using any newline operator. the problem was that some of my shaders had // comments in them :P meaning that ALL code after that got commeted out (since the entire shader is now on 1 very long line), making it seems that the shader is only partialy loaded.