Original Post
I opened a thread originally on OpenGL section and here due to no one can give me an answer of what is wrong. However, after a couple more days of debugging, I believe the problem should be somewhere related to the multi-threading problem rather than OpenGL. I'm on VS 2005 (C program). Again, I am used the main thread, start with WinMain function, to create 2 child threads. The first one creates the actual MAIN window, and the 2nd one runs the OpenGL render function. Also, these 2 thread header file don't see one of another, only the main thread source code points to both header file. As a result, the main thread has to call the child, main window, thread to get the HWND and HDC. I've found that due to timing issue sometimes the HWND and HDC aren't yet initialized! I fixed that problem, and the situation still remain -- the background is still null. So, I tried to move the SwapBuffers inside the main window thread instead of the render thread. And I do see some messy thing are shown on the window this time, which made me think that probably it's the synchronisation issue instead. Anyway, I know OpenGL calls is not thread safe, but that's probably an old thing and I'm not calling OpenGL function from all the threads, but just 1. So, it shouldn't be an OpenGL issue at all. And again, if the window thread is not a child thread, but a main thread instead; the graphic works completely fine. However, just not working under that 2 child threads situation. So, I think it's something to do with either synchronisation or some with the window programming issue. The source code is pretty long to post here, so I just explain instead. Thanks for help.