comparison native/OpenHaptics/XYPad/uk_ac_qmul_eecs_depic_jhapticgui_HapticDevice.cpp @ 1:46671fc7d649 tip

fixed "window" message bug and brought the message outside the haptic device monitor
author Fiore Martin <f.martin@qmul.ac.uk>
date Fri, 13 Mar 2015 13:02:16 +0000
parents 011caca7515a
children
comparison
equal deleted inserted replaced
0:011caca7515a 1:46671fc7d649
175 die("Haptic device disposed"); 175 die("Haptic device disposed");
176 #endif 176 #endif
177 177
178 } 178 }
179 179
180 static bool once = false;
181 if (!once){
182 once = true;
183 send(Message("window.display", "", 0));
184 }
185
186 /* check if there is a message ready for the java thread */ 180 /* check if there is a message ready for the java thread */
187 bool messageReady = (env->GetBooleanField(*thisObj,messageReadyFieldID) == JNI_TRUE); 181 bool messageReady = (env->GetBooleanField(*thisObj,messageReadyFieldID) == JNI_TRUE);
188 if(messageReady){ 182 if(messageReady){
189 /* get the id of the field */ 183 /* get the id of the field */
190 jint ID = env->GetIntField(*thisObj, IDFieldID); 184 jint ID = env->GetIntField(*thisObj, IDFieldID);
211 } 205 }
212 206
213 /* release the lock. HapticScene methods from now on can execute commands without deadlock risk */ 207 /* release the lock. HapticScene methods from now on can execute commands without deadlock risk */
214 MonitorExit(thisObj); 208 MonitorExit(thisObj);
215 209
210 static bool once = false;
211 if (!once){
212 once = true;
213 send(Message("window", "", 0));
214 }
215
216 unsigned int messageUpdate = 0; 216 unsigned int messageUpdate = 0;
217 if(messageReady) 217 if(messageReady)
218 messageUpdate = scene->processMessage(message); 218 messageUpdate = scene->processMessage(message);
219 219
220 /* --- start drawing --- */ 220 /* --- start drawing --- */