Access Violation Exception with glfwSwapBuffers

Hello everyone,
I’m new with Open GL and GLFW and I’m following some tutorials to get started and I’ve got a weird issue.

As the title say, I get a Access Violation Exception on glfwSwapBuffers call.

OS: Windows 10
IDE: Visual Studio 2015 Community Edition
Libraries : GLEW 1.13, GLFW 3.2, GLM (not used anyway)

The issue occures in this class:

Interresting fact:
If we comment the glVertexAttribPointer() and the glDrawArrays() (line 50 -> 59), the issue does not occures.

and there is this class for information:

This is the glfwSwapBuffers(_window) [line 76] that make the crash

Any idea is appreciated.

Thanks to everyone :slight_smile:

Have you tried to use glVertexPointer instead of glVertexAttribPointer? Afaik glVertexAttribPointer makes sense only if you use GLSL shaders where you can specify vertex attribute location or query it after linking.

glVertexPointer(3, GL_FLOAT, 0, (void*)0);

Just tried and still have the same error

Oops, forgot to mention that you also need to replace glEnableVertexAttribArray(0) with glEnableClientState(GL_VERTEX_ARRAY)

Hey ! It doesn’t crash anymore ! Thank you !

But I don’t have any white triangle displayed x). Might it be a black triangle ?