Windows: Don't use UpdateWindow after all. Instead, don't use a background brush at all to avoid windows clearing windows with non OpenGL drawing commands. Hopefully this will improve compatibility (The NeHe tutorials also don't specify a background brush).
This commit is contained in:
parent
0234336feb
commit
97db4ca4b2
|
@ -136,7 +136,6 @@ final class WindowsDisplay implements DisplayImplementation {
|
|||
showWindow(getHwnd(), SW_SHOWDEFAULT);
|
||||
setForegroundWindow(getHwnd());
|
||||
setFocus(getHwnd());
|
||||
updateWindow(getHwnd());
|
||||
}
|
||||
private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException;
|
||||
|
||||
|
@ -182,7 +181,6 @@ final class WindowsDisplay implements DisplayImplementation {
|
|||
private static native void showWindow(long hwnd, int mode);
|
||||
private static native void setForegroundWindow(long hwnd);
|
||||
private static native void setFocus(long hwnd);
|
||||
private static native void updateWindow(long hwnd);
|
||||
|
||||
private void restoreDisplayMode() {
|
||||
try {
|
||||
|
|
|
@ -55,6 +55,7 @@ extern HINSTANCE dll_handle; // Handle to the LWJGL dll
|
|||
bool registerWindow(WNDPROC win_proc, LPCTSTR class_name)
|
||||
{
|
||||
WNDCLASS windowClass;
|
||||
memset(&windowClass, 0, sizeof(windowClass));
|
||||
windowClass.style = CS_OWNDC;
|
||||
windowClass.lpfnWndProc = win_proc;
|
||||
windowClass.cbClsExtra = 0;
|
||||
|
@ -62,7 +63,7 @@ bool registerWindow(WNDPROC win_proc, LPCTSTR class_name)
|
|||
windowClass.hInstance = dll_handle;
|
||||
windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||
windowClass.hbrBackground = NULL;
|
||||
windowClass.lpszMenuName = NULL;
|
||||
windowClass.lpszClassName = class_name;
|
||||
|
||||
|
|
|
@ -247,11 +247,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetGammaRamp(JNIEnv
|
|||
setGammaRamp(env, gamma_buffer);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_updateWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr) {
|
||||
HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
|
||||
UpdateWindow(hwnd);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_showWindow(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint mode) {
|
||||
HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
|
||||
ShowWindow(hwnd, mode);
|
||||
|
|
Loading…
Reference in New Issue