My code above (which is in the main.cpp file) works very fine. Try it yourself if you have time.

Now, I want two things from you guys.

Criticize my code. Do you see any flaw? Would it work in all cases (except for the problem I stated in (2))?

I feel that this code won't work when I use two objects of this class under the same process. And I feel that every GLWindow object must check if they are the "current", if not, they must make themselves the "current" by somehow using the function wglMakeCurrent(). But I don't know how to do it, because I don't know much about OpenGL at all. How do I do it?