0

I am trying to write a simple vertex shader and fragment shader. I am using SDL2 as my window manager and I am following this tutorial: https://learnopengl.com/Getting-started/Hello-Triangle

I've gotten to the part after writing the vertex shader to check if the shader had compiled properly. I did not for me, instead I got this output:

ERROR::SHADER::VERTEX::COMPILATION_FAILED
ERROR: 0:1: '' : version '330' is not supported
ERROR: 0:1: '' : syntax error: #version
ERROR: 0:2: 'layout' : syntax error: syntax error

I've tried changing the version but I have to have a version that has a core profile. glGetString(GL_VERSION) outputs: 2.1 Metal - 83

Am I correct in assuming that the 2.1 means that the OpenGL version, and therefore cannot use core profiles and the 330 version?

  • Does this answer your question? [Specify OpenGL version using SDL2](https://stackoverflow.com/questions/22158542/specify-opengl-version-using-sdl2) If you use the core profile, SDL2 should automatically use a higher OpenGL version and you should be able to use GLSL 3.3. – Jan Schultke Jun 09 '23 at 21:09
  • @JanSchultke Thank you so much for this link. I did the recommended changes it it works flawlessly now thank you so much now – Veer Singh Jun 10 '23 at 02:30

0 Answers0