};
its my first time trying to enable multiple vertex attributes at the same time so i can get the gouraud shading thing to work.
it compiles but i get the "Segmentation fault (core dumped)" message when i run it.
is it something wrong with my shaders?
array buffer?
vertex attributes?

};
its my first time trying to enable multiple vertex attributes at the same time so i can get the gouraud shading thing to work.
it compiles but i get the "Segmentation fault (core dumped)" message when i run it.
is it something wrong with my shaders?
array buffer?
vertex attributes?

thanks

first of all gl_Position is a vec4 built-in variable so you are sending a vec2 to a vec4, you need to cast:

Code :

gl_Position = vec4(vPosition, 0.0, 1.0); // z value = 0.0 if you want a 2D mesh, for what i know is better to set w value = 1.0f every time
//all this because gl_Position is like write
out vec4 position;
void main()
{
//... blah blah
position = vec4(vPosition, 0.0, 1.0);
}

about the error you get it seems a core error, honestly i can only immagine what could be: it could be your glutInitContext function, probably your driver can't handle opengl 4.3, or shader version. try to set shader version to 330 core, you don't need 430 core for what you have to do, if the error remain try to set glutInitContext(3,3) too and see what happen

another thing: if nothing of this solutions works, try to replace your glutInitContextProfile() line with this two lines: