Hi all,
I'm using a shader that on and off generates an error.
I detect the error at checkErrors(). It's printed in my local language and translates to something like 'illigal counting'Code ://std::ifstream::pos_type mSize; int mSize; std::ifstream ctFile ("F:/Projekter/GLFW3_2/vertShader6.txt", std::ios::in|std::ios::binary|std::ios::ate); if (ctFile.is_open()) { printf("ctFile is_open\n"); mSize = ctFile.tellg(); printf("ctFile mSize : %i \n", mSize ) ; checkErrors() ; char *buffer = new char [mSize]; ctFile.seekg (0, std::ios::beg); ctFile.read (buffer, mSize); ctFile.close(); buffer[mSize] = '\0'; const GLchar *vertexShaderChars[] = { buffer }; ....
The error sometimes generates a faul status:
glGetShaderiv(vertShader, GL_COMPILE_STATUS, &status);
I make a printf() of 'buffer' and it provides a correct visual impression of the shader-code/text.
It 'did' bypass GL_COMPILE_STATUS earlier without the error spawning a faul status, and I would have a functioning program ..
It probably takes a newbie to produce the code above ... any suggestion of a more straightforward code is welcome.