glsl version syntax problems

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

glsl version syntax problems

Teapot
Why must I comment out the version definition line for this code to compile? Both the official jogl example code and the opengl superbible example code has it.

Reply | Threaded
Open this post in threaded view
|

Re: glsl version syntax problems

jmaasing
Reply | Threaded
Open this post in threaded view
|

Re: glsl version syntax problems

Teapot
The version I use and the version used by the system matches. Notice that 4.00 blah blah at top right? That's my version print out.

However, I've figured out the problem. Apparently, I need to include a carriage return ala "#version 400\n" :< Why they'd demand something that was designed for human consumption to begin with, I cannot tell. Your guess was indeed wild but thanks to that, I found the critical clue in a method comment left by someone for the getGLSLVersionString() method: "including a terminating newline '\n', i.e. for desktop".

Along with the lack of the carriage return (which's mandatory, to emphasize) my version string also get chained into the param init string. That would be parsed as "#version 400 coreout vec4 color;" + ...

Case closed. I now have a hardware-accelerated cyan dot :)
Reply | Threaded
Open this post in threaded view
|

Re: glsl version syntax problems

jmaasing
Great and thanks for sharing your findings, I learned something new :-)