I’m using mingGW in Windows. The basic code as follows colour is {1, 0, 0 , 1} which should be red. However, when I run my code there is no error but the window just show white.
Here is the default color, I think it should be white by default, just the clearColor doesn’t work.
wc.hbrBackground =
(HBRUSH)(COLOR_WINDOW+1);// Default color
Conditions:
I have created two windows(hWnd)
I have created one hRC, the windows will share hRC by GetDC() and the wglMakeCurrent()
I have load a lot of process address, Fonts, programs and shaders.
This is the beginning of the code, I just created two windows, then I want to glClearColor() on one of them.
I have done some experiments on my code, the problem is that when I have only one hRC to share with both hWnd, the second window doesn’t show anything. If I redefine the hRC with hRC = wglCreateContext(hDC) (the hDC is has the same format with previous one) then the second window will do just fine. The order of the code is like below:
I have solved the problem by storing one hDC and hWnd per window and only have one hRC. After createWindow, ShowWindow, I set up hDC pfd, then makecurrent before clearcolor. Also after clearColor() I need glFlush()