Request an OpenGL 4.1 core context with glfwWindowHint
Request an OpenGL 4.1 core context with glfwWindowHint before glfwCreateWindow so the profile and version are fixed at creation in GLFW 3.4.
Short posts that solve one thing: the code, the output we got, and why it works.
Request an OpenGL 4.1 core context with glfwWindowHint before glfwCreateWindow so the profile and version are fixed at creation in GLFW 3.4.
Fetch exact texels with texelFetch, which takes integer coordinates and a mip level and skips filtering, in GLSL 1.30 and later.
Declare vertex inputs with layout(location = 0) in so the shader fixes attribute locations itself, available in GLSL 3.30 and OpenGL 3.3.
Upload vertex data once with glBufferData and the GL_STATIC_DRAW usage hint, and know when GL_DYNAMIC_DRAW fits better in OpenGL 3.3 core.
Create a VAO and VBO with glGenVertexArrays and glGenBuffers in OpenGL 3.3 core, bind the VAO first, then fill the buffer with a triangle.
We send one email when a new post is published. No spam.