Valid OpenGL context
问题 How and at what stage is a valid OpenGL context created in my code? I'm getting errors on even simple OpenGL code. 回答1: From the posts on comp.graphics.api.opengl , it seems like most newbies burn their hands on their first OpenGL program. In most cases, the error is caused due to OpenGL functions being called even before a valid OpenGL context is created. OpenGL is a state machine. Only after the machine has been started and humming in the ready state, can it be put to work. Here is some