Simple triangle using OpenGL and GLFW [duplicate]

感情迁移 提交于 2019-12-02 09:34:12

You're choosing the OpenGL Core Profile for your rendering:

glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

Your code is missing a number of things to be Core Profile compliant:

  • You need to implement shader programs. The Core Profile does not support the old fixed pipeline anymore, and requires you to implement your own shaders in GLSL. Explaining how to do this in detail is beyond the scope of an answer, but you will be using calls like glCreateProgram, glCreateShader, glShaderSource, glCompileShader, glAttachShader, glLinkProgram. You should be able to find material online and in books.
  • You need to use Vertex Array Objects (VAO). Look up glGenVertexArrays and glBindVertexArray.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!