Original Post
I'm currently having trouble to get my GLSL vertex shader code to compile within my OpenGL program.
My Vertex shader is pretty basic for testing purposes:
and now I try to set the shader source and compile it with OpenGL:
after that I query the success of the compile with glGetShaderiv( m_uVertexShader, GL_COMPILE_STATUS, &iResult ) which returns GL_FALSE :(
But when I want to retrieve the log information of the shader with glGetShaderInfoLog(m_uVertexShader, 1, &iLength, szInfo) then iLength is 0 - so my log is empty...
what I know for certain is that the file is read correctly with ReadTextFile().
I also tried switching to the ARB-methods - same result...
I hope someone has some hints for me on how to proceed in my error-investigation from here on...
P.S.:
I'm on a MacBook (Late 2008 ) with a GeForce 9400M and OSX 10.6. I use OpenGL with XCode in an SDL-created window.
My Vertex shader is pretty basic for testing purposes:
#version 140 uniform Transformation{ mat4 projection_matrix; mat4 modelview_matrix;}; in vec3 vertex; void main(){ gl_Position = projection_matrix * modelview_matrix * vec4(vertex, 1.0);}and now I try to set the shader source and compile it with OpenGL:
m_uVertexShader = glCreateShader( GL_VERTEX_SHADER );std::string szShaderCode = FileReader::ReadTextFile( szVertexShaderPath );const char* szTemp = szShaderCode.c_str(); glShaderSource(m_uVertexShader, 1, &szTemp, NULL);glCompileShader( m_uVertexShader );after that I query the success of the compile with glGetShaderiv( m_uVertexShader, GL_COMPILE_STATUS, &iResult ) which returns GL_FALSE :(
But when I want to retrieve the log information of the shader with glGetShaderInfoLog(m_uVertexShader, 1, &iLength, szInfo) then iLength is 0 - so my log is empty...
what I know for certain is that the file is read correctly with ReadTextFile().
I also tried switching to the ARB-methods - same result...
I hope someone has some hints for me on how to proceed in my error-investigation from here on...
P.S.:
I'm on a MacBook (Late 2008 ) with a GeForce 9400M and OSX 10.6. I use OpenGL with XCode in an SDL-created window.