Using GLFW to create the main window

Example c++

wS->win->hdl = glfwCreateWindow(wS->win->width, wS->win->height, wS->win->appName, NULL, NULL);

The created window for a moment has a white background, until openGL is setup and rendering the correct color (between glfwCreateWindow and first call to glClear).

In dark mode on a large monitor it is almost painful having a sudden flash of full white.

My current solution is to open the window as small as possible, resizing it when openGL is ready. This is a hack and it would be nice to be able to set the default window background color to match the current display mode of the OS (dark / light modes)


1 Answer 1


A better hack?

After some trial and error I found a solution that is still a hack but much better than resizing.

Immediately after creating the window with wS->win->hdl = glfwCreateWindow((wS->win->width, wS->win->height, wS->win->appName, NULL, NULL); call glfwSwapBuffers(wS->win->hdl);

The default state of the back buffer seams to be black and overwrites the white window content.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .