From b5aed7df3ac9ebd87498247882d0c874891c0ce9 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Fri, 30 May 2008 07:39:06 +0000 Subject: Changes to WindowsWindow.c to compile on Windows CE. Slight changes to config selection to match C code -- no semantic difference, however. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1649 232f8b59-042b-4e1e-8c03-345bb8c30851 --- .../com/sun/opengl/impl/egl/EGLDrawableFactory.java | 2 +- src/native/jogl/WindowsWindow.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index be594ce46..2a8b8fbae 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -197,7 +197,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { EGL.EGL_RED_SIZE, caps.getRedBits(), EGL.EGL_GREEN_SIZE, caps.getGreenBits(), EGL.EGL_BLUE_SIZE, caps.getBlueBits(), - EGL.EGL_ALPHA_SIZE, caps.getAlphaBits(), + EGL.EGL_ALPHA_SIZE, (caps.getAlphaBits() > 0 ? caps.getAlphaBits() : EGL.EGL_DONT_CARE), EGL.EGL_STENCIL_SIZE, (caps.getStencilBits() > 0 ? caps.getStencilBits() : EGL.EGL_DONT_CARE), EGL.EGL_NONE, EGL.EGL_NONE, EGL.EGL_NONE diff --git a/src/native/jogl/WindowsWindow.c b/src/native/jogl/WindowsWindow.c index 157615950..151666ab3 100755 --- a/src/native/jogl/WindowsWindow.c +++ b/src/native/jogl/WindowsWindow.c @@ -33,9 +33,13 @@ #include #include +#ifdef UNDER_CE +#include "aygshell.h" +#endif -/* This typedef is apparently needed for Microsoft compilers before VC8 */ -#if _MSC_VER < 1400 +/* This typedef is apparently needed for Microsoft compilers before VC8, + and on Windows CE */ +#if (_MSC_VER < 1400) || defined(UNDER_CE) #ifdef _WIN64 typedef long long intptr_t; #else @@ -72,7 +76,11 @@ static LRESULT CALLBACK wndProc(HWND wnd, UINT message, int useDefWindowProc = 0; jobject window = NULL; +#ifdef UNDER_CE + window = (jobject) GetWindowLong(wnd, GWL_USERDATA); +#else window = (jobject) GetWindowLongPtr(wnd, GWLP_USERDATA); +#endif if (window == NULL || env == NULL) { // Shouldn't happen return DefWindowProc(wnd, message, wParam, lParam); @@ -212,7 +220,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_windows_WindowsWindow_CreateWin (HINSTANCE) hInstance, NULL); if (window != NULL) { +#ifdef UNDER_CE + SetWindowLong(window, GWL_USERDATA, (intptr_t) (*env)->NewGlobalRef(env, obj)); +#else SetWindowLongPtr(window, GWLP_USERDATA, (intptr_t) (*env)->NewGlobalRef(env, obj)); +#endif ShowWindow(window, SW_SHOWNORMAL); } return (jlong) (intptr_t) window; -- cgit v1.2.3