Like i said in the subject, this is more C / C++ than OpenGL Shading Language, but i don´t know where i could ask else.
This is i feel like after debugging my code for 3 days and not getting a result:
- :mad: :mad: :mad: -
The problem is: Since i switched from the 3d-Labs-Shaderloadcode to my own :
ifstream file(key.c_str());
if(!file.is_open())
throw string (string("Could not find shaderfile: ") + key);
for (string line; getline(file, line);)
{
if (line != "FragmentShader")
vertex_shader_source.append(line);
else
break;
}
for (string line; getline(file, line); fragment_shader_source.append(line));
const GLcharARB * VSS = vertex_shader_source.c_str();
const GLcharARB * FSS = fragment_shader_source.c_str();
glShaderSourceARB(VS, 1, &VSS, NULL);
glShaderSourceARB(FS, 1, &FSS, NULL);
i get the following compilation error on my Radeon 9800 Pro
“pre-mature eof”
when i load one file as a vertex shader error.
With another file i get same error as a fragment-shader error.
And with a very short and simple shaderfile, there is no error at all.
I tried to erase all tabulators, enters and whitespaces of the shadercode, i tried to add them, i tried to write the code in different editors, i tried to add a “\0” to the strings, i tried to add or substract the last character of the strings, i tried to provide glShaderSourceARB the size of the strings and then to substract last char of the strings, etc. …
i also looked at the char * - strings in the debugger and at my console window, and couldn´t see any curious symbol.
Now i havn´t the slightest point what i do wrong.
I really hope someone (C/C++ expert?) can help me.