Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: NevilleKemp

26. May 2012, 03:54:37 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)[SOLVED] Mouse capturing and tabbed view disappearances
Pages: 1 [2]
Print
Author Topic: [SOLVED] Mouse capturing and tabbed view disappearances  (Read 1250 times)
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #15 on: 17. November 2010, 05:32:22 pm »

Attached is the requested test case; I see that pausing/resuming the renderer here seems to work correctly. Next I'll try to make a test case for a tabbed/paned app, much more similar to the one we use, in hopes that that will show the error we're having. In the meantime, this shows pretty clearly the logic we use for setting up Xith in our app.

How well does Xith play with SWT (as opposed to AWT/Swing)?

Sorry for the delay; I'm not a native Java developer and so had overestimated the difficulty of setting up a quick test-case. I'm pretty impressed by the speed of prototyping (esp. GUI apps) compared with my "mother-tongue" (C/C++).
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #16 on: 17. November 2010, 05:43:55 pm »

Ok, I will have a look at it in the next days. I just got a cold today. So I will be in bed for some days.

Marvin
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #17 on: 17. November 2010, 05:52:55 pm »

Eek. Get well soon!
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #18 on: 17. November 2010, 09:50:16 pm »

So, to satisfy my own curiosity, I've been using Canvas3d.setBackgroundColor to confirm each time I set the window active and inactive, under the impression that this is eventually backed by glClearColor or something similar.

How do I go about setting the clear color of Xith for the 3D device?

My reasoning is that if that works, my problem may just be that, while the renderer is n fact fine, perhaps my scenegraph is getting deleted or the viewport is going wonky.
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #19 on: 17. November 2010, 11:33:12 pm »

To add help, I've disabled (in our app) registration of an input handler or creation of an input system, so that the view should be functioning without calls to input. This fixes the NullPointerException crash in AWTMouse.

Our setup is such that Xith exists in a tabbed group, and my current suspicion is that somehow that component is getting orphaned during tabbing from the event queue. This might explain the exception, which only occurs when I tab back and give input focus via clicking to the view. So, maybe becoming an orphaned view is causing Xith to stop drawing?
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #20 on: 18. November 2010, 05:35:24 pm »

Partial victory:

Using JOGL_AWT instead of LWJGL_AWT fixes the tabbing problem. Interesting. Now, back to trying to correctly hide the mouse cursor.
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #21 on: 18. November 2010, 06:24:59 pm »

FULL VICTORY:

The aforementioned fix also allows the cursor to be properly hidden by the setAbsolute method. Huzzah!

Thanks Marvin for all the help!
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #22 on: 18. November 2010, 06:59:36 pm »

You didn't possibly update from SVN? I checked in a fix in JAGaToo, that did the trick for the setAbsolute() in some situations.

Marvin
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #23 on: 18. November 2010, 08:46:04 pm »

I froze at revision 1839 to use for development; simplifies the dependencies for our work. Once the rest of the code that uses this is stable, I'll go back and update to latest--don't want to hit a moving target until then. Wink

Still curious as to why JOGL worked and LWJGL didn't--my guess is that while JOGL is programmed "safe" by Sun and hence pretty reliably works in all kinds of weird edge cases (embedded in tabbed groups, switched on and off, etc.) LWJGL might cut corners to get better performance and to work better in fullscreen mode. Curious either way, though.
Logged
badboyboogey
Enjoying the stay
*
Offline Offline

Posts: 40



View Profile
« Reply #24 on: 19. November 2010, 07:49:54 pm »

Unless LWJGL have fixed it recently 'RUN_IN_SEPARATE_THREAD' has issues with LWJGL (completly locks up on my pc I have to use RUN_IN_SAME_THREAD)
so might have all been something todo with that.
If you search on the LWJGL forums you can find a few unresolved threads about it... Having said that LWJGL works alot better than JOGL if used in same thread (On my system anyway).
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #25 on: 20. November 2010, 03:47:53 pm »

It is a problem on the Windows platform, where the window must be created from within the very same thread, that manipulates it later. So you could solve this by creating the Canvas3D from within the rendering thread.

Marvin
Logged
ChrisE
Becoming dependent
**
Offline Offline

Posts: 104


View Profile
« Reply #26 on: 22. November 2010, 06:25:46 pm »

Ah, glad to know I'm not crazy then. Will try that if JOGL turns out to not work. Thanks again guys!
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic