move handOffWindow down near start()

This commit is contained in:
RogueLogix 2020-04-26 15:41:53 -07:00
parent 438c969fef
commit 677e2104a0

View file

@ -911,21 +911,6 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
glfwPollEvents(); glfwPollEvents();
} }
@Override
public long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, final LongSupplier monitorSupplier) {
glfwSetWindowTitle(window, title.get());
glfwSetWindowSize(window, width.getAsInt(), height.getAsInt());
if (monitorSupplier.getAsLong()!=0L)
glfwSetWindowMonitor(window, monitorSupplier.getAsLong(),0, 0, width.getAsInt(), height.getAsInt(), GLFW_DONT_CARE);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
renderProgress();
glfwSwapInterval(0);
glfwSwapBuffers(window);
glfwSwapInterval(1);
return window;
}
private static float clamp(float num, float min, float max) { private static float clamp(float num, float min, float max) {
if (num < min) { if (num < min) {
return min; return min;
@ -1042,6 +1027,21 @@ class ClientVisualization implements EarlyProgressVisualization.Visualization {
return this::renderProgress; return this::renderProgress;
} }
@Override
public long handOffWindow(final IntSupplier width, final IntSupplier height, final Supplier<String> title, final LongSupplier monitorSupplier) {
glfwSetWindowTitle(window, title.get());
glfwSetWindowSize(window, width.getAsInt(), height.getAsInt());
if (monitorSupplier.getAsLong()!=0L)
glfwSetWindowMonitor(window, monitorSupplier.getAsLong(),0, 0, width.getAsInt(), height.getAsInt(), GLFW_DONT_CARE);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
renderProgress();
glfwSwapInterval(0);
glfwSwapBuffers(window);
glfwSwapInterval(1);
return window;
}
@Override @Override
public boolean replacedWindow() { public boolean replacedWindow() {
return true; return true;