On Day 472, Casey separates the win32 message loop from the actual game loop
by moving the game loop to a different thread. This allowed the game
to still render, even when the window is being moved / resized.
I have noticed however that when setting up my window class like Casey did,
1 2 3 4 5 6 7 8 9 | WNDCLASS window_class; Zero_Struct(window_class); { window_class.style = CS_HREDRAW|CS_VREDRAW|CS_OWNDC; window_class.lpfnWndProc = win32_window_callback; window_class.hInstance = instance; window_class.hCursor = LoadCursor(0, IDC_ARROW); window_class.hbrBackground = 0; // /* NOTE(Matyas): Don't redraw! */ window_class.lpszClassName = "openglapp"; } |
I still get blinking when resizing my OpenGL window.
Casey towards the end of the stream said that this issue was mainly because of the
way the rendering engine was architected.
In my case however, I have tried setting up a very bare-bones renderer that just draws
a single triangle and the issue still remains.
I have tried messing with WM_PAINT, WM_ERASEBKGND with no success.
Does anyone know about this issue and how it could be solved?