I want to compile the vertex shader:
#version 430
layout(location = 0)in vec3 vertexPosition;
layout(location = 1)in vec3 vertexNormal;
layout(location = 2)in vec2 vertexUV;
out Vertex{
vec2 uv;
vec4 normal;
}vertexOut;
void main(){
gl_Position = vec4(
vertexPosition.x,
vertexPosition.y,
vertexPosition.z,
1.0f);
vertexOut.uv = vertexUV;
vertexOut.normal = vec4(vertexNormal, 0.0f);
}
like this
pShader.ID = glCreateShader(GL_VERTEX_SHADER);
std::ifstream shaderFile;
shaderFile.open(pShader.path);
if (shaderFile.fail()) {
printf("!!!
Cannot open Shader File %s ! Shader compilation cancelled!", pShader.path.c_str());
}
else {
std::string line;
while (getline(shaderFile, line)) {
pShader.content += line + '
';
++pShader.lines;
}
const char* shaderContent = pShader.content.c_str();
glShaderSource(pShader.ID, 1, &shaderContent, &pShader.lines);
glCompileShader(pShader.ID);
GLint success = 0;
glGetShaderiv(pShader.ID, GL_COMPILE_STATUS, &success);
if (success == GL_FALSE) {
//errror checking
}
but i am getting the compilation error
Vertex Shader failed to compile with the following errors:
ERROR: 0:3: error(#132) Syntax error "layou" parse error
ERROR: errror(#273) 1 compilation errors. No code generated
In my fragment shader i am also getting a “/” parse error, but i can find it.
I am using glew for extension loading and glfw for input and context.
When i run the glewinfo.exe there are some extensions marked as missing, but my AMD Radeon HD 7800 Drivers are up to date… What is the problem and what am i supposed to do?
these are the glewinfo.exe results: Welcome m.uploadedit.com - Hostmonster.com