From 9dd52c655916fb62b327cfc5af4e19e9abea2fb9 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Mon, 12 Jan 2004 16:28:51 +0000 Subject: [PATCH] assert that Direct Input has been created --- src/native/win32/org_lwjgl_input_Mouse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/native/win32/org_lwjgl_input_Mouse.cpp b/src/native/win32/org_lwjgl_input_Mouse.cpp index 6d4f5e34..5f86dc51 100644 --- a/src/native/win32/org_lwjgl_input_Mouse.cpp +++ b/src/native/win32/org_lwjgl_input_Mouse.cpp @@ -108,6 +108,12 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetButtonCount(JNIEnv *, jcla JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { HRESULT hr; + // assert that Direct Input has been created + if(lpdi == NULL) { + throwException(env, "Please create the window before initializing input devices\n"); + return; + } + ShowCursor(FALSE); CacheMouseFields(env, clazz);