Windows: Make window visible after pixel format selection and move code from native WindowsDisplay.nCreate to java side.

This commit is contained in:
Elias Naur 2006-12-22 10:45:39 +00:00
parent d2e9a9fb4a
commit d4ea142f89
2 changed files with 4 additions and 4 deletions

View file

@ -96,6 +96,7 @@ final class WindowsDisplay implements DisplayImplementation {
private final static int WA_ACTIVE = 1;
private final static int WA_CLICKACTIVE = 2;
private final static int SW_SHOWMINNOACTIVE = 7;
private final static int SW_SHOWDEFAULT = 10;
private final static int SW_RESTORE = 9;
private static WindowsDisplay current_display;
@ -132,6 +133,9 @@ final class WindowsDisplay implements DisplayImplementation {
did_maximize = false;
nCreateWindow(mode, fullscreen, x, y);
peer_info.initDC();
showWindow(getHwnd(), SW_SHOWDEFAULT);
setForegroundWindow(getHwnd());
setFocus(getHwnd());
}
private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException;

View file

@ -199,10 +199,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv
return;
}
display_hdc = GetDC(display_hwnd);
ShowWindow(display_hwnd, SW_SHOWDEFAULT);
UpdateWindow(display_hwnd);
SetForegroundWindow(display_hwnd);
SetFocus(display_hwnd);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) {