aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/scripts/tests.sh8
-rw-r--r--src/newt/native/WindowsWindow.c31
2 files changed, 28 insertions, 11 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index eef519d78..65d9bf3a0 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -138,7 +138,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.TraceGL"
#D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.DebugGL"
#D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.JAWT -Dnewt.debug.Window"
- D_ARGS="-Dnativewindow.debug.JAWT -Djogl.debug.GLCanvas"
+ #D_ARGS="-Dnativewindow.debug.JAWT -Djogl.debug.GLCanvas"
#D_ARGS="-Dnativewindow.debug.JAWT -Djogamp.debug.TaskBase.TraceSource"
#D_ARGS="-Dnativewindow.debug.JAWT"
#D_ARGS="-Djogl.debug.GLContext.TraceSwitch"
@@ -310,7 +310,7 @@ function jrun() {
#D_ARGS="-Djogl.debug.AudioSink -Djoal.openal.lib=system"
#D_ARGS="-Djogl.debug.AudioSink -Djogl.debug.AudioSink.trace"
#D_ARGS="-Djogl.debug.AudioSink -Djogl.debug.GLMediaPlayer"
- #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
+ D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
#D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLSLCode"
#D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
#D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
@@ -424,7 +424,7 @@ function testawtswt() {
#
# HiDPI
#
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2SimpleNEWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $*
@@ -621,7 +621,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.test.junit.newt.TestRemoteGLWindows01NEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestWindows01NEWT $*
-testnoawt com.jogamp.opengl.test.junit.newt.TestWindows02NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.newt.TestWindows02NEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestWindowClosingProtocol02NEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestWindowAndPointerIconNEWT $*
#testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindows01NEWT $*
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index c004f48a1..882559551 100644
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -936,6 +936,7 @@ static void sendTouchScreenEvent(JNIEnv *env, jobject window,
jNames, jX, jY, jPressure, (jfloat)maxPressure);
}
+// #define DO_ERASEBKGND 1
static LRESULT CALLBACK wndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lParam) {
LRESULT res = 0;
@@ -1077,9 +1078,15 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lP
case WM_PAINT: {
if( wud->isInCreation ) {
+ #ifdef DO_ERASEBKGND
if (GetUpdateRect(wnd, NULL, TRUE /* erase background */)) {
DBG_PRINT("*** WindowsWindow: WM_PAINT.0 (dirty)\n");
// WM_ERASEBKGND sent!
+ #else
+ if (GetUpdateRect(wnd, NULL, FALSE /* do not erase background */)) {
+ DBG_PRINT("*** WindowsWindow: WM_PAINT.0 (dirty)\n");
+ ValidateRect(wnd, NULL); // clear all!
+ #endif
} else {
DBG_PRINT("*** WindowsWindow: WM_PAINT.0 (clean)\n");
}
@@ -1100,13 +1107,23 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, WPARAM wParam, LPARAM lP
}
case WM_ERASEBKGND:
if( wud->isInCreation ) {
- PAINTSTRUCT ps;
- HDC hdc;
- hdc = BeginPaint(wnd, &ps);
- DBG_PRINT("*** WindowsWindow: WM_ERASEBKGND.0 (erasure) l/b %d/%d r/t %d/%d\n",
- ps.rcPaint.left, ps.rcPaint.bottom, ps.rcPaint.right, ps.rcPaint.top);
- FillRect(hdc, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW+1));
- EndPaint(wnd, &ps);
+ #ifdef DO_ERASEBKGND
+ // On Windows the initial window is clean?!
+ // This fill destroys translucency on Windows 10
+ // (which only seem to work on undecorated windows)
+ PAINTSTRUCT ps;
+ HDC hdc;
+ hdc = BeginPaint(wnd, &ps);
+ DBG_PRINT("*** WindowsWindow: WM_ERASEBKGND.0 (erasure) l/b %d/%d r/t %d/%d\n",
+ ps.rcPaint.left, ps.rcPaint.bottom, ps.rcPaint.right, ps.rcPaint.top);
+ // FillRect(hdc, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW+1));
+ // FillRect(hdc, &ps.rcPaint, (HBRUSH)(COLOR_APPWORKSPACE+1));
+ // A black color also sets alpha to zero for translucency!
+ FillRect(hdc, &ps.rcPaint, (HBRUSH)GetStockObject(BLACK_PEN));
+ EndPaint(wnd, &ps);
+ #else
+ ValidateRect(wnd, NULL); // clear all!
+ #endif
res = 1; // return 1 == done
} else {
// ignore erase background, but let NEWT render the whole client area