Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 01:47:33 pm
Xith3D CommunityGeneral CategoryNews (Moderators: Marvin Fröhlich, 'n ddrylliog)My recent changes (mostly SWT)
Pages: [1] 2
Print
Author Topic: My recent changes (mostly SWT)  (Read 3224 times)
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« on: 13. February 2007, 05:03:20 pm »

My recent changes have been committed to the trunk.

Fixes
  • SWT threading issues in rendering (xith3d)
  • SWT threading issues in input handling (xith-tk)
  • accidental assignments inside if tests
  • removed methods from ImageUtility that now exist in Integer and boosted roundUpPower2 performance by 60%
  • updated Xith3DTestLauncher with more robust test searching capabilities
Outstanding Issues
  • SWT threading works fine as an Eclipse plug-in and mostly works from the command line; however, when initiated from the command line, there is a focus listener somewhere that I wasn't able to easily track down that still causes stack traces and failure to deliver focus events.  Since I am only concerned with Eclipse view functionality and wasn't able to easily find/fix this one, it's still there.
« Last Edit: 13. February 2007, 05:05:55 pm by horati » Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 13. February 2007, 07:10:49 pm »

What a great contribution. Thanks you so much. I will now have a look at the changes.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 13. February 2007, 07:24:21 pm »

btw. Please download the latest version of HIAL at http://input.jtank.net/
It is the version we're using in Xith3D. The project doesn't have an official version control server, but I can upload any change, that you made. Just contact me by eMail. Maybe there's the input mishadling, that you wrote about.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 13. February 2007, 07:59:07 pm »

I had a closer look at the changes. Everything looks really cool from the coding side. But SWT doesn't render at all now.

One other thing: There cannot be references to underlying APIs in the Toolkit. So there must not be any reference to "Composite". So the SWTKeyboard and mouse classes need to be merged into HIAL ones. Could you please do this and send the results to me via mail? I will then release a new HIAL version.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #4 on: 13. February 2007, 08:10:20 pm »

OK, now I had another even closer look at your SWTMouse and SWTKeyboard extensions. Don't get me wrong, but they are simply useless. The update() methods of net.jtank.hial.swt.SWTMouse and SWTKeyboard are empty. So your extendsions don't do anything. Or did I misunderstand anything?

Marvin
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #5 on: 13. February 2007, 08:12:46 pm »

I noticed some missing keycodes in TerrainTest3 as well and changed them back to awt KeyEvent, since I didn't thought of this. Have you already added KeyCode.VK_ADD and KeyCode.VK_SUBSTRACT and do you plan to include the full set of keycodes from KeyEvent?
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 13. February 2007, 08:38:22 pm »

I noticed some missing keycodes in TerrainTest3 as well and changed them back to awt KeyEvent, since I didn't thought of this. Have you already added KeyCode.VK_ADD and KeyCode.VK_SUBSTRACT and do you plan to include the full set of keycodes from KeyEvent?

Well, the full set of keycodes from keyevents doesn't make sense. But all, that do make sense are there including ADD and SUBTRACT. Aren't they available on your system? Do you use the latest hial.jar from SVN or from the latest beta2?

Marvin
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #7 on: 13. February 2007, 09:19:06 pm »

btw. Please download the latest version of HIAL at http://input.jtank.net/
It is the version we're using in Xith3D. The project doesn't have an official version control server, but I can upload any change, that you made. Just contact me by eMail. Maybe there's the input mishadling, that you wrote about.
I'm using xith-tk/trunk/third-party/hial/hial.jar.  Is this the wrong library?

I had a closer look at the changes. Everything looks really cool from the coding side. But SWT doesn't render at all now.
I only used HUD3DTest which seems to render fine.  When I saw this comment, I tried a few others and they definitely don't any more Sad

One other thing: There cannot be references to underlying APIs in the Toolkit. So there must not be any reference to "Composite". So the SWTKeyboard and mouse classes need to be merged into HIAL ones. Could you please do this and send the results to me via mail? I will then release a new HIAL version.
I guess I don't know anything about HIAL.  I wouldn't say that HIAL mismanaged the threads; however, it was much easier to use SWT's thread synchronization API than to find a superior way to fix the problem.

OK, now I had another even closer look at your SWTMouse and SWTKeyboard extensions. Don't get me wrong, but they are simply useless. The update() methods of net.jtank.hial.swt.SWTMouse and SWTKeyboard are empty. So your extendsions don't do anything. Or did I misunderstand anything?
Hmm... I didn't look at HIAL directly at all.  As I stated above, I simply used hial.jar from the xith-tk project.  The presence or absence of that code definitely made the program succeed or fail as an Eclipse view.  Not sure if I entirely understand your comment.  Did you see that whatever is executed in super.update() is either executed in the current thread if it is safe or in the thread SWT likes if it is not safe?
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #8 on: 13. February 2007, 09:26:51 pm »

I'm using xith-tk/trunk/third-party/hial/hial.jar.  Is this the wrong library?

No, this is exactly the right version. I just wanted to say, that you should download the lates HIAL release, which includes the source. It is exactly the one, that is in the current xith-tk/trunk.

Hmm... I didn't look at HIAL directly at all.  As I stated above, I simply used hial.jar from the xith-tk project.  The presence or absence of that code definitely made the program succeed or fail as an Eclipse view.  Not sure if I entirely understand your comment.  Did you see that whatever is executed in super.update() is either executed in the current thread if it is safe or in the thread SWT likes if it is not safe?

Yes, I noticed that. What I wanted to say is, that the suprt.update() method inside of HIAL is just empty. So I cannot see, why this should make any difference. When you've downloaded the HIAL source (1.6.2), you'll see it. The source isn't too big and should be understandable straigh forwardly.

Marvin
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #9 on: 13. February 2007, 09:57:54 pm »

Yes, I noticed that. What I wanted to say is, that the suprt.update() method inside of HIAL is just empty. So I cannot see, why this should make any difference. When you've downloaded the HIAL source (1.6.2), you'll see it. The source isn't too big and should be understandable straigh forwardly.

Ok, I thought that's what you were saying.  I just wanted to make sure we were on the same page.  Sometimes forum communication can be incomplete.

I went back to net.jtank.input.swt.SWTMouse/Keyboard and of course it worked fine.  I must have gotten over-zealous late last night.  I made that change before some later changes that fixed other things.  Apparently, I did not go back to remove the dead code I created.  Sorry, I'll remove it now.  If those methods ever do anything, just remember that they need to take the threading into account in the same fashion.

I think the inconsistent lack of SWT rendering in the tests may be because now it must run in a separate thread.  I can't seem to find the place in the tests where the SWT special case is that uses RUN_IN_SAME_THREAD.  All the tests appear to extend BaseTest whose constructor calls this.begin() which appears to always RUN_IN_SEPARATE_THREAD.

On a different note, I think calling this.begin() in a super-class constructor is an error.  Shouldn't begin() be called after construction because some resources may not yet exist?
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #10 on: 13. February 2007, 10:20:36 pm »

Well, the full set of keycodes from keyevents doesn't make sense. But all, that do make sense are there including ADD and SUBTRACT. Aren't they available on your system? Do you use the latest hial.jar from SVN or from the latest beta2?
Well, it seems I updated somewhere in the middle, where the TerrainTest3 was already changed and the hial.jar was not. After another update all compiles well with only KeyCodes  (I am using the SVN version)
Logged

Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #11 on: 13. February 2007, 10:22:56 pm »

I went back to net.jtank.input.swt.SWTMouse/Keyboard and of course it worked fine.  I must have gotten over-zealous late last night.  I made that change before some later changes that fixed other things.  Apparently, I did not go back to remove the dead code I created.  Sorry, I'll remove it now.  If those methods ever do anything, just remember that they need to take the threading into account in the same fashion.

Hey, that's no problem. Things can happen. I just love, that you're contributing to the project.

I think the inconsistent lack of SWT rendering in the tests may be because now it must run in a separate thread.  I can't seem to find the place in the tests where the SWT special case is that uses RUN_IN_SAME_THREAD.  All the tests appear to extend BaseTest whose constructor calls this.begin() which appears to always RUN_IN_SEPARATE_THREAD.

Only a few test cases extend BaseTest. In most cases I want to have everything needed for the test in one class. Thst's why the HUD3DTest might seem a bit bloated. But I don't want to users to browse through several classes to understand, what is needed for this test.

The begin() call is always at the end of the constructor. The constructor is always at the end if the class (right above the main() method). So it should be really easy to find it.

On a different note, I think calling this.begin() in a super-class constructor is an error.  Shouldn't begin() be called after construction because some resources may not yet exist?

The BaseTest has two init methods called initBeforeCanvas() and initAfterCanvas(). They're called by the constructor and are used in extensions to initialize the scene. So it matches your idea.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #12 on: 13. February 2007, 10:24:14 pm »

Well, it seems I updated somewhere in the middle, where the TerrainTest3 was already changed and the hial.jar was not. After another update all compiles well with only KeyCodes  (I am using the SVN version)

Cool, that it works now Smiley. You must have updated just in the second between my commits. Wow, what an accident Grin.

Marvin
Logged
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #13 on: 13. February 2007, 11:48:19 pm »

The BaseTest has two init methods called initBeforeCanvas() and initAfterCanvas(). They're called by the constructor and are used in extensions to initialize the scene. So it matches your idea.

Yup, I saw those; however, I have seen issues when overridden methods attempt to access things from the child class that have not yet been constructed.  Of course, that was full systems and this is only the test harness after all Smiley
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #14 on: 14. February 2007, 12:10:39 am »

Yup, I saw those; however, I have seen issues when overridden methods attempt to access things from the child class that have not yet been constructed.  Of course, that was full systems and this is only the test harness after all Smiley

Well, if there's any parameter missing, that you need, we simply need to extend the signature.

Marvin
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic