I've written a basic OpenGL program in C++ which just opens a window. I'm now trying to draw a triangle, but I'm having some issues calling GLEW functions. This is my code with just OpenGL:
#include "include/glew.h"
#include "include/glfw3.h"
int main()
{
GLFWwindow* window;
if (!glfwInit())
return -1;
window = glfwCreateWindow(800, 600, "HelloWorld", nullptr, nullptr);
if (!window)
{
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
unsigned int buffer;
//glGenBuffers(1, &buffer);
while (!glfwWindowShouldClose(window))
{
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}
Uncommenting glGenBuffers(1, &buffer);
, which is a GLEW function, causes the program to exit with code -1073741515
. No errors were displayed. I've correctly linked with GLEW, as well as opengl32, gdi32, user32, and shell32. What am I doing wrong?
question from:
https://stackoverflow.com/questions/65897845/process-finished-with-exit-code-1073741515-when-calling-glew-functions 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…