执行test.exe时,没有弹窗出现
launch.json中的"externalConsole"改为true和false都不行
下面是我用到的代码,请问怎么才能出现结果呢?
#include<iostream>
#include<GL/gl.h>
#include "glfw3.h"
int main(){
GLFWwindow* window;
if(!glfwInit())return -1;
window = glfwCreateWindow(470, 320, "TestOpenGL", NULL, NULL);
if(!window){
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
while(!glfwWindowShouldClose(window)){
glBegin(GL_TRIANGLES);
glColor3f(1.0, 0.0, 0.0);
glVertex3f(0.0, 1.0, 0.0);
glColor3f(0.0, 1.0, 0.0);
glVertex3f(-1.0, -1.0, 0.0);
glColor3f(1.0, 0.0, 1.0);
glVertex3f(1.0, -1.0, 0.0);
glEnd();
glfwSwapBuffers(window);
glfwPollEvents();
}
glfwTerminate();
return 0;
}