C++에서 OpenGL을 시작, 지금까지 다음과 같은 코드가하기 : 그것은 모두 잘 컴파일,내가 <a href="http://www.swiftless.com/tutorials/opengl/window.html" rel="nofollow">this tutorial</a>을 사용하여 OpenGL을 함께 프로그래밍을 시작하려고했습니다
#include <gl/glut.h> // Include the GLUT header file
void display (void)
{
}
int main(int argc, char **argv)
{
glutInit(&argc, argv); // Initialize GLUT
// Set up a basic display buffer (only single buffered for now)
glutInitDisplayMode (GLUT_SINGLE);
glutInitWindowSize (500, 500); // Set the width and height of the window
glutInitWindowPosition (100, 100); // Set the position of the window
// Set the title for the window
glutCreateWindow("Your first OpenGL Window!");
glutDisplayFunc(display);
glutMainLoop();
glClearColor(1.f, 0.f, 0.f, 1.f); // Clear the background of our window to red
return 0;
}
내가 빌드 이클립스에서 프로젝트를 실행하지만, 아무 일도 일어나지 않습니다 (아무 창이 나올 수 없습니다). 아무도 내가 뭘 잘못하고 있다고 말할 수 있습니까?
코드가 실제로 실행 중인지 확인하려면 print 문을 추가하십시오. – Lalaland