I'm new to OpenGL and started studying using Anton's OpenGL tutorials.
I finished the "Hello Triangle" tutorial and compiled it without errors with the following g++ command:
g++ -o hello_triangle main.c -lGLEW -lglfw -lGL -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lm
However, the system window shows only a black screen, both in my code and in the code from the book repository.
The output from glGetString(GL_RENDERER) and glGetString(GL_VERSION) is the following:
Renderer: Mesa DRI Intel(R) Sandybridge Mobile
OpenGL version supported 3.0 Mesa 11.0.6
What might be the reason of this black screen?
If you want to check the code just look at the '00_hello_triangle' code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…