GLEW throws this error when the GLContext is invalid. Check the lifecycle of your objects in your initialization to make sure SFML's not being released before your initialize GLEW.
How to add extensions to OpenGL rendering?.– dans3itz at 11:00 it can't be my code, this works 100% on almost every IDE I've tried, and SFML has never done this to me, it usually does it's openGL stuff without me having to worry about it – dans3itz at 11:00 Ĭheck the lifecycle of your objects in your initialization to make sure SFML's not being released before your initialize GLEW. GlfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4) Std::cerr << 'Failed to initialize GLFW.\n' Std::cerr << 'GLFW error ' << error << ': ' << description << std::endl Void glfwErrorCallback(int error, const char *description) I set up a minimal application to open a blank window with glfw3: If glewInit() returns GLEW_OK, the initialization succeeded and you can use the available extensions as well as core OpenGL functionality' 'First you need to create a valid OpenGL rendering context and call glewInit() to initialize the extension entry points. Std::cerr << 'Failed to open GLFW window.\n' Window = glfwCreateWindow(1024, 768, 'GLFW window', NULL, NULL) GlfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE) GlfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3)