I’m trying to draw a simple triangle using OpenGL (already done this many times, also on the device I’m using right now) However, when trying to load OpenGL functions, I get an access violation in the NVidia driver. (using an RTX 2060 and Windows 7)
Exception at 0x000007FEB3ED3023 (nvoglv64.dll): Access violation at position 0xFFFFFFFFFFFFFFFF
This makes no sense to me. I triple checkes that my hardware is fine. (Tried other projects of mine using OpenGL, updated graphics drivers …)
I have tried multiple loaders like glad and glew, but they all produce the same error.
Am I missing something?
My code goes like this:
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6);
window = glfwCreateWindow(xRes, yRes, wndTitle.c_str(), NULL, NULL);
if (!window)
{
std::cout << "Can't open window" << std::endl;
Shutdown();
return false;
}
glfwMakeContextCurrent(window);
glfwMakeContextCurrent(window);
if (glewInit() != GLEW_OK)
{
std::cout << "Can't load OpenGL functions" << std::endl;
Shutdown();
return false;
}
This is extremely irritating to me because i pasted code from other