From bc33b3c4d53836b50bffc1a0058c95c0a2fafb13 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 1 Apr 2008 20:45:24 +0000 Subject: [PATCH] Windows: Moved Display.setIcon logic to java --- src/java/org/lwjgl/opengl/WindowsDisplay.java | 22 ++++++++++--------- src/native/windows/org_lwjgl_opengl_Display.c | 12 +++++----- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/java/org/lwjgl/opengl/WindowsDisplay.java b/src/java/org/lwjgl/opengl/WindowsDisplay.java index 29b4a330..964c1f56 100644 --- a/src/java/org/lwjgl/opengl/WindowsDisplay.java +++ b/src/java/org/lwjgl/opengl/WindowsDisplay.java @@ -550,31 +550,33 @@ final class WindowsDisplay implements DisplayImplementation { * @return number of icons used. */ public int setIcon(ByteBuffer[] icons) { - boolean done16 = false; - boolean done32 = false; + boolean done_small = false; + boolean done_large = false; int used = 0; + int small_icon_size = 16; + int large_icon_size = 32; for (int i=0;iGetDirectBufferAddress(env, iconBuffer); freeSmallIcon(); - small_icon = createWindowIcon(env, imgData, 16, 16); + small_icon = createWindowIcon(env, imgData, width, height); if (small_icon != NULL) { if (display_hwnd != NULL) { SendMessage(display_hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon)); @@ -480,13 +480,13 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIcon16 return -1; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIcon32 - (JNIEnv *env, jclass clazz, jobject iconBuffer) +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconLarge + (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) { jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); freeLargeIcon(); - large_icon = createWindowIcon(env, imgData, 32, 32); + large_icon = createWindowIcon(env, imgData, width, height); if (large_icon != NULL) { if (display_hwnd != NULL) { SendMessage(display_hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon));