diff --git a/src/java/org/lwjgl/opengl/Display.java b/src/java/org/lwjgl/opengl/Display.java index c2639d1c..bb2d1a3c 100644 --- a/src/java/org/lwjgl/opengl/Display.java +++ b/src/java/org/lwjgl/opengl/Display.java @@ -202,12 +202,13 @@ public final class Display { */ private static void createWindow() throws LWJGLException { display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y); + makeCurrent(); // if no display location set, center window if(x == -1 && y == -1) { setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2), Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2)); } - + setTitle(title); initControls(); setVSyncEnabled(vsync); diff --git a/src/native/win32/org_lwjgl_opengl_Display.c b/src/native/win32/org_lwjgl_opengl_Display.c index 8cf9654e..49662535 100644 --- a/src/native/win32/org_lwjgl_opengl_Display.c +++ b/src/native/win32/org_lwjgl_opengl_Display.c @@ -662,12 +662,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createWindow(JNIEnv *e return; } - result = wglMakeCurrent(display_hdc, display_hglrc); - if (!result) { - throwException(env, "Could not bind context to window"); - closeWindow(display_hwnd, display_hdc); - return; - } extgl_InitWGL(env); ShowWindow(display_hwnd, SW_SHOW); UpdateWindow(display_hwnd);