I have a very simple program:
glfwInit();
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
long w = glfwCreateWindow(400, 400, "test", 0, 0);
glfwMakeContextCurrent(w);
GL.createCapabilities();
// Frame start
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2d(0.3, 0.3);
GL11.glVertex2d(0.7, 0.3);
GL11.glVertex2d(0.5, 0.7);
GL11.glEnd();
// Frame end
glfwSwapBuffers(w); // -- move this after showwindow to make it work, but causes white window to flash white when appearing because it has nothing rendered yet
glfwShowWindow(w);
while (!glfwWindowShouldClose(w)) {
glfwWaitEvents();
glfwPollEvents();
}
glfwDestroyWindow(w);
glfwTerminate();
but after executing I get a white window. I thought you could pre-render a frame so when you show the window you immediately have something drawn onto it instead of having to draw the frame after showing the window which creates a white flash. Basically how can I set the window to have drawn something without showing it because I think it just ignores draw calls when it is invisible