|
From: <sp...@us...> - 2013-01-29 21:03:01
|
Revision: 3839
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3839&view=rev
Author: spasi
Date: 2013-01-29 21:02:52 +0000 (Tue, 29 Jan 2013)
Log Message:
-----------
Sync with recent Git changes.
Modified Paths:
--------------
trunk/LWJGL/platform_build/windows_ant/build.xml
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java
trunk/LWJGL/src/native/common/common_tools.c
trunk/LWJGL/src/native/common/common_tools.h
trunk/LWJGL/src/native/common/extcl.c
trunk/LWJGL/src/native/common/extcl.h
trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c
trunk/LWJGL/src/native/windows/opengl/context.c
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
Modified: trunk/LWJGL/platform_build/windows_ant/build.xml
===================================================================
--- trunk/LWJGL/platform_build/windows_ant/build.xml 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/platform_build/windows_ant/build.xml 2013-01-29 21:02:52 UTC (rev 3839)
@@ -6,8 +6,8 @@
<property name="sdkhome" location="${env.MSSDK}"/>
<target name="compile_dir">
- <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true">
- <arg line="/Ox /W2 /nologo /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W2 /nologo /c"/>
+ <apply dir="." failonerror="true" executable="cl" dest="." skipemptyfilesets="true"parallel="true">
+ <arg line="/c /W3 /EHsc /Ox /Gy /MT /MP /nologo"/>
<arg value="/I${sdkhome}\include"/>
<arg value="/I${java.home}\..\include"/>
<arg value="/I${java.home}\..\include\win32"/>
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2013-01-29 21:02:52 UTC (rev 3839)
@@ -58,6 +58,7 @@
import java.security.PrivilegedAction;
import java.util.Arrays;
import java.util.HashSet;
+import javax.swing.*;
public final class Display {
@@ -121,6 +122,12 @@
private static float r, g, b;
private static final ComponentListener component_listener = new ComponentAdapter() {
+ public void componentMoved(ComponentEvent e) {
+ synchronized ( GlobalLock.lock ) {
+ parent_resized = true;
+ }
+ }
+
public void componentResized(ComponentEvent e) {
synchronized ( GlobalLock.lock ) {
parent_resized = true;
@@ -298,6 +305,7 @@
throw new LWJGLException("Parent.isDisplayable() must be true");
if ( tmp_parent != null ) {
tmp_parent.addComponentListener(component_listener);
+ SwingUtilities.windowForComponent(parent).addComponentListener(component_listener);
}
DisplayMode mode = getEffectiveMode();
display_impl.createWindow(drawable, mode, tmp_parent, getWindowX(), getWindowY());
@@ -335,6 +343,7 @@
}
if ( parent != null ) {
parent.removeComponentListener(component_listener);
+ SwingUtilities.windowForComponent(parent).removeComponentListener(component_listener);
}
releaseDrawable();
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2013-01-29 21:02:52 UTC (rev 3839)
@@ -38,8 +38,9 @@
* @author elias_naur
*/
+import java.awt.*;
+import java.lang.reflect.Method;
import java.nio.*;
-import java.awt.Canvas;
import org.lwjgl.LWJGLException;
import org.lwjgl.LWJGLUtil;
@@ -49,6 +50,8 @@
import org.lwjgl.input.Mouse;
import org.lwjgl.opengles.EGL;
+import javax.swing.*;
+
final class WindowsDisplay implements DisplayImplementation {
private static final int GAMMA_LENGTH = 256;
@@ -150,9 +153,9 @@
private static final int WS_THICKFRAME = 0x00040000;
private static final int WS_MAXIMIZEBOX = 0x00010000;
-
+
private static final int HTCLIENT = 0x01;
-
+
private static final int MK_XBUTTON1 = 0x0020;
private static final int MK_XBUTTON2 = 0x0040;
private static final int XBUTTON1 = 0x0001;
@@ -199,6 +202,15 @@
private boolean trackingMouse;
private boolean mouseInside;
+ static {
+ try {
+ final Method windowProc = WindowsDisplay.class.getDeclaredMethod("handleMessage", long.class, int.class, long.class, long.class, long.class);
+ setWindowProc(windowProc);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
WindowsDisplay() {
current_display = this;
}
@@ -212,7 +224,7 @@
maximized = false;
this.parent = parent;
hasParent = parent != null;
- long parent_hwnd = parent != null ? getHwnd(parent) : 0;
+ long parent_hwnd = parent != null ? nGetParent(getHwnd(parent)) : 0;
this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd);
this.resizable=false;
if (hwnd == 0) {
@@ -233,6 +245,8 @@
((DrawableGLES)drawable).initialize(hwnd, hdc, EGL.EGL_WINDOW_BIT, (org.lwjgl.opengles.PixelFormat)drawable.getPixelFormat());
}
peer_info.initDC(getHwnd(), getHdc());
+ if ( parent != null )
+ reshape(0, 0, mode.getWidth(), mode.getHeight());
showWindow(getHwnd(), SW_SHOWDEFAULT);
updateWidthAndHeight();
@@ -275,6 +289,8 @@
}
}
+ private static native long nGetParent(long hWnd);
+
public void destroyWindow() {
nReleaseDC(hwnd, hdc);
nDestroyWindow(hwnd);
@@ -496,9 +512,6 @@
public void update() {
nUpdate();
- if (parent != null && parent.isFocusOwner()) {
- setFocus(getHwnd());
- }
if (redoMakeContextCurrent) {
redoMakeContextCurrent = false;
/**
@@ -518,6 +531,15 @@
private static native void nUpdate();
public void reshape(int x, int y, int width, int height) {
+ if ( parent != null ) {
+ // Translate canvas location to screen coordinates
+ Point p = new Point();
+
+ SwingUtilities.convertPointToScreen(p, parent);
+
+ x += p.getX();
+ y += p.getY();
+ }
nReshape(getHwnd(), x, y, width, height, Display.isFullscreen() || isUndecorated(), parent != null);
}
private static native void nReshape(long hwnd, int x, int y, int width, int height, boolean undecorated, boolean child);
@@ -780,10 +802,6 @@
nReleaseCapture();
}
}
-
- if (parent != null && !isFocused) {
- setFocus(getHwnd());
- }
}
private boolean shouldGrab() {
@@ -833,14 +851,16 @@
private static native void clientToScreen(long hwnd, IntBuffer point);
- private static int handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
+ private static native void setWindowProc(Method windowProc);
+
+ private static long handleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
if (current_display != null)
return current_display.doHandleMessage(hwnd, msg, wParam, lParam, millis);
else
return defWindowProc(hwnd, msg, wParam, lParam);
}
- private static native int defWindowProc(long hwnd, int msg, long wParam, long lParam);
+ private static native long defWindowProc(long hwnd, int msg, long wParam, long lParam);
private void checkCursorState() {
updateClipping();
@@ -863,7 +883,12 @@
checkCursorState();
}
- private int doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
+ private long doHandleMessage(long hwnd, int msg, long wParam, long lParam, long millis) {
+ if ( hwnd != getHwnd() ) {
+ // Can happen at start-up
+ return defWindowProc(hwnd, msg, wParam, lParam);
+ }
+
switch (msg) {
// disable screen saver and monitor power down messages which wreak havoc
case WM_ACTIVATE:
@@ -876,7 +901,7 @@
appActivate(false);
break;
}
- return 0;
+ return 0L;
case WM_SIZE:
switch ((int)wParam) {
case SIZE_RESTORED:
@@ -908,13 +933,13 @@
} else {
// let Windows handle cursors outside the client area for resizing, etc.
return defWindowProc(hwnd, msg, wParam, lParam);
- }
+ }
case WM_KILLFOCUS:
appActivate(false);
- return 0;
+ return 0L;
case WM_SETFOCUS:
appActivate(true);
- return 0;
+ return 0L;
case WM_MOUSEMOVE:
int xPos = (int)(short)(lParam & 0xFFFF);
int yPos = transformY(getHwnd(), (int)(short)((lParam >> 16) & 0xFFFF));
@@ -924,29 +949,29 @@
if(!trackingMouse) {
trackingMouse = nTrackMouseEvent(hwnd);
}
- return 0;
+ return 0L;
case WM_MOUSEWHEEL:
int dwheel = (int)(short)((wParam >> 16) & 0xFFFF);
handleMouseScrolled(dwheel, millis);
- return 0;
+ return 0L;
case WM_LBUTTONDOWN:
handleMouseButton(0, 1, millis);
- return 0;
+ return 0L;
case WM_LBUTTONUP:
handleMouseButton(0, 0, millis);
- return 0;
+ return 0L;
case WM_RBUTTONDOWN:
handleMouseButton(1, 1, millis);
- return 0;
+ return 0L;
case WM_RBUTTONUP:
handleMouseButton(1, 0, millis);
- return 0;
+ return 0L;
case WM_MBUTTONDOWN:
handleMouseButton(2, 1, millis);
- return 0;
+ return 0L;
case WM_MBUTTONUP:
handleMouseButton(2, 0, millis);
- return 0;
+ return 0L;
case WM_XBUTTONUP:
if((wParam >> 16) == XBUTTON1) {
handleMouseButton(3, 0, millis);
@@ -964,7 +989,7 @@
case WM_SYSCHAR:
case WM_CHAR:
handleChar(wParam, lParam, millis);
- return 0;
+ return 0L;
case WM_SYSKEYUP:
/* Fall through */
case WM_KEYUP:
@@ -985,17 +1010,17 @@
return defWindowProc(hwnd, msg, wParam, lParam);
case WM_QUIT:
close_requested = true;
- return 0;
+ return 0L;
case WM_SYSCOMMAND:
switch ((int)(wParam & 0xfff0)) {
case SC_KEYMENU:
case SC_MOUSEMENU:
case SC_SCREENSAVE:
case SC_MONITORPOWER:
- return 0;
+ return 0L;
case SC_CLOSE:
close_requested = true;
- return 0;
+ return 0L;
default:
break;
}
@@ -1015,7 +1040,7 @@
handleMouseButton(captureMouse, 0, millis);
captureMouse = -1;
}
- return 0;
+ return 0L;
case WM_WINDOWPOSCHANGED:
if(getWindowRect(hwnd, rect_buffer)) {
rect.copyFromBuffer(rect_buffer);
@@ -1024,12 +1049,12 @@
} else {
LWJGLUtil.log("WM_WINDOWPOSCHANGED: Unable to get window rect");
}
- return defWindowProc(hwnd, msg, wParam, lParam);
+ return defWindowProc(hwnd, msg, wParam, lParam);
default:
return defWindowProc(hwnd, msg, wParam, lParam);
}
}
-
+
private native boolean getWindowRect(long hwnd, IntBuffer rectBuffer);
public int getX() {
@@ -1056,8 +1081,8 @@
public void setResizable(boolean resizable) {
if(this.resizable != resizable) {
- long style = getWindowLongPtr(hwnd, GWL_STYLE);
- long styleex = getWindowLongPtr(hwnd, GWL_EXSTYLE);
+ int style = (int)getWindowLongPtr(hwnd, GWL_STYLE);
+ int styleex = (int)getWindowLongPtr(hwnd, GWL_EXSTYLE);
// update frame style
if(resizable && !Display.isFullscreen()) {
@@ -1082,7 +1107,7 @@
this.resizable = resizable;
}
- private native boolean adjustWindowRectEx(IntBuffer rectBuffer, long style, boolean menu, long styleex);
+ private native boolean adjustWindowRectEx(IntBuffer rectBuffer, int style, boolean menu, int styleex);
public boolean wasResized() {
if(resized) {
Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/java/org/lwjgl/util/generator/NativeMethodStubsGenerator.java 2013-01-29 21:02:52 UTC (rev 3839)
@@ -324,7 +324,7 @@
// Declare loop counters and allocate object array
if ( !ptrLoopDeclared ) {
- writer.println("\tunsigned int " + n + "_i;");
+ writer.println("\tint " + n + "_i;");
writer.println("\tjobject " + n + "_object;");
ptrLoopDeclared = true;
}
@@ -336,7 +336,7 @@
// Declare loop counters and allocate string array
if ( !strLoopDeclared ) {
- writer.println("\tunsigned int " + n + "_i;");
+ writer.println("\tint " + n + "_i;");
writer.println("\t" + arrayType + n + "_address;");
strLoopDeclared = true;
}
Modified: trunk/LWJGL/src/native/common/common_tools.c
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/common_tools.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -227,11 +227,11 @@
const char *str = (const char *)ustr;
if (str == NULL)
return NULL;
- return NewStringNativeWithLength(env, str, strlen(str));
+ return NewStringNativeWithLength(env, str, (jsize)strlen(str));
}
// creates locale specific string
-jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length) {
+jstring NewStringNativeWithLength(JNIEnv *env, const char *str, jsize length) {
jclass jcls_str;
jmethodID jmethod_str;
jstring result;
@@ -330,7 +330,7 @@
}
bool getBooleanProperty(JNIEnv *env, const char* propertyName) {
- jstring property = NewStringNativeWithLength(env, propertyName, strlen(propertyName));
+ jstring property = NewStringNativeWithLength(env, propertyName, (jsize)strlen(propertyName));
jclass org_lwjgl_LWJGLUtil_class;
jmethodID getBoolean;
if (property == NULL)
Modified: trunk/LWJGL/src/native/common/common_tools.h
===================================================================
--- trunk/LWJGL/src/native/common/common_tools.h 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/common_tools.h 2013-01-29 21:02:52 UTC (rev 3839)
@@ -75,18 +75,18 @@
return NULL;
}
-static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) {
+static inline jobject safeNewBuffer(JNIEnv *env, void *p, jlong capacity) {
if (p != NULL) {
#ifdef __cplusplus
- return env->NewDirectByteBuffer(p, size);
+ return env->NewDirectByteBuffer(p, capacity);
#else
- return (*env)->NewDirectByteBuffer(env, p, size);
+ return (*env)->NewDirectByteBuffer(env, p, capacity);
#endif
} else
return NULL;
}
-static inline jobject safeNewBufferCached(JNIEnv *env, void *p, int size, jobject old_buffer) {
+static inline jobject safeNewBufferCached(JNIEnv *env, void *p, jlong size, jobject old_buffer) {
if (old_buffer != NULL) {
void *old_buffer_address = (*env)->GetDirectBufferAddress(env, old_buffer);
jlong capacity = (*env)->GetDirectBufferCapacity(env, old_buffer);
@@ -141,7 +141,7 @@
extern void printfDebug(const char *format, ...);
extern bool getBooleanProperty(JNIEnv *env, const char* propertyName);
extern char * GetStringNativeChars(JNIEnv *env, jstring jstr);
-extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, int length);
+extern jstring NewStringNativeWithLength(JNIEnv *env, const char *str, jsize length);
extern jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str);
extern jobject NewReadOnlyDirectByteBuffer(JNIEnv* env, const void* address, jlong capacity);
extern jobject newJavaManagedByteBuffer(JNIEnv *env, const int size);
Modified: trunk/LWJGL/src/native/common/extcl.c
===================================================================
--- trunk/LWJGL/src/native/common/extcl.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/extcl.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -59,7 +59,7 @@
ext_InitializeClass(env, clazz, &extcl_GetProcAddress, num_functions, functions);
}
-int extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch) {
+size_t extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch) {
if ( slice_pitch == 0 )
return region[1] * row_pitch;
else
Modified: trunk/LWJGL/src/native/common/extcl.h
===================================================================
--- trunk/LWJGL/src/native/common/extcl.h 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/extcl.h 2013-01-29 21:02:52 UTC (rev 3839)
@@ -70,7 +70,7 @@
void* extcl_GetProcAddress(const char* function);
void extcl_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions);
-int extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch);
+size_t extcl_CalculateImageSize(const size_t *region, size_t row_pitch, size_t slice_pitch);
// -----------------[ Platform dependent functions ]-----------------
Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC10.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -83,7 +83,7 @@
*/
static jobject JNICALL Java_org_lwjgl_openal_ALC10_nalcGetString (JNIEnv *env, jclass clazz, jlong deviceaddress, jint token) {
char* alcString = (char*) alcGetString((ALCdevice*)((intptr_t)deviceaddress), (ALenum) token);
- int length;
+ size_t length;
int i=1;
if (alcString == NULL) {
Modified: trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/common/org_lwjgl_opencl_CallbackUtil.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -67,7 +67,7 @@
private_info_buffer = NewReadOnlyDirectByteBuffer(env, private_info, cb);
(*env)->CallVoidMethod(env, (jobject)user_data, contextCallbackJ,
- NewStringNativeWithLength(env, errinfo, strlen(errinfo)),
+ NewStringNativeWithLength(env, errinfo, (jsize)strlen(errinfo)),
private_info_buffer
);
}
Modified: trunk/LWJGL/src/native/windows/opengl/context.c
===================================================================
--- trunk/LWJGL/src/native/windows/opengl/context.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/windows/opengl/context.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -118,7 +118,7 @@
windowflags = WS_POPUP;
} else if (child_window) {
exstyle = 0;
- windowflags = WS_CHILDWINDOW;
+ windowflags = WS_POPUP;
} else {
exstyle = WS_EX_APPWINDOW;
windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU;
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -53,6 +53,9 @@
#define WINDOWCLASSNAME _T("LWJGL")
+static jclass windowsDisplayClass;
+static jmethodID javaWindowProc;
+
/*
* WindowProc for the GL window.
*/
@@ -61,10 +64,12 @@
WPARAM wParam,
LPARAM lParam)
{
+ /*
jclass display_class;
jclass display_class_global;
jmethodID handleMessage_method;
LONG message_time;
+ */
JNIEnv *env = getThreadEnv();
if (env != NULL && !(*env)->ExceptionOccurred(env)) {
/*
@@ -80,6 +85,8 @@
* a window is created, where we are sure that the calling class' classloader has
* LWJGL classes in it.
*/
+
+ /*
display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (display_class_global == NULL) {
display_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsDisplay");
@@ -91,15 +98,27 @@
}
if (display_class_global != NULL) {
message_time = GetMessageTime();
- handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)I");
+ handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)J");
if (handleMessage_method != NULL)
- return (*env)->CallStaticIntMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time);
+ return (*env)->CallStaticLongMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time);
+
}
+ */
+
+ return (*env)->CallStaticLongMethod(
+ env, windowsDisplayClass, javaWindowProc,
+ (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)GetMessageTime()
+ );
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
-JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) {
+JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setWindowProc(JNIEnv *env, jclass clazz, jobject method) {
+ windowsDisplayClass = clazz;
+ javaWindowProc = (*env)->FromReflectedMethod(env, method);
+}
+
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_defWindowProc(JNIEnv *env, jclass unused, jlong hWnd, jint msg, jlong wParam, jlong lParam) {
return DefWindowProc((HWND)(INT_PTR)hWnd, msg, wParam, lParam);
}
@@ -167,6 +186,10 @@
return (INT_PTR)hwnd;
}
+JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nGetParent(JNIEnv *env, jclass clazz, jlong hwnd_ptr) {
+ return (INT_PTR)GetParent((HWND)(INT_PTR)hwnd_ptr);
+}
+
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReleaseDC(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) {
HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
HDC hdc = (HDC)(INT_PTR)hdc_ptr;
@@ -309,6 +332,7 @@
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nReshape(JNIEnv *env, jclass unused, jlong hwnd_ptr, jint x, jint y, jint width, jint height, jboolean undecorated, jboolean child) {
HWND hwnd = (HWND)(INT_PTR)hwnd_ptr;
+ /*
DWORD exstyle, windowflags;
RECT clientSize;
@@ -329,11 +353,11 @@
);
SetWindowPos(hwnd, HWND_TOP, x, y, clientSize.right - clientSize.left, clientSize.bottom - clientSize.top, SWP_NOZORDER);
+ */
+ SetWindowPos(hwnd, HWND_TOP, x, y, width, height, SWP_NOZORDER | SWP_NOACTIVATE);
}
static HICON createWindowIcon(JNIEnv *env, jint *pixels, jint width, jint height) {
- unsigned char col;
- unsigned char mask;
BITMAPV5HEADER bitmapInfo;
HBITMAP cursorMask;
HBITMAP colorBitmap;
@@ -345,8 +369,6 @@
int imageSize;
unsigned char *maskPixels;
int widthInBytes;
- int leftShift;
- int maskPixelsOff;
int scanlineWidth;
HBITMAP colorDIB;
@@ -475,7 +497,7 @@
}
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsDisplay_adjustWindowRectEx
- (JNIEnv *env, jclass unused, jobject rect_buffer, jlong style, jboolean menu, jlong styleex) {
+ (JNIEnv *env, jclass unused, jobject rect_buffer, jint style, jboolean menu, jint styleex) {
jboolean result;
RECT clientRect;
copyBufferToRect(env, rect_buffer, &clientRect);
Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c
===================================================================
--- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2013-01-25 15:39:08 UTC (rev 3838)
+++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsRegistry.c 2013-01-29 21:02:52 UTC (rev 3839)
@@ -93,7 +93,7 @@
return NULL;
}
result[buf_size - 1] = '\0';
- java_result = NewStringNativeWithLength(env, result, strlen(result));
+ java_result = NewStringNativeWithLength(env, result, (jsize)strlen(result));
free(result);
return java_result;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|