Slick Forums

Discuss the Slick 2D Library
It is currently Sun Dec 17, 2017 6:15 am

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: TWL and LWJGL 3
PostPosted: Mon Nov 24, 2014 5:02 am 
Offline

Joined: Sat Aug 20, 2011 3:39 pm
Posts: 23
Hi I'm wondering if someone has made any efforts getting TWL to work with LWJGL 3?

LWJGL 3 is using GLFW for display/input handling. When it comes to how TWL interfaces with LWJGL regarding Mouse/Keyboard/Display and Cursors there are some rewriting required.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Tue Nov 25, 2014 1:54 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
obidobi wrote:
Hi I'm wondering if someone has made any efforts getting TWL to work with LWJGL 3?

LWJGL 3 is using GLFW for display/input handling. When it comes to how TWL interfaces with LWJGL regarding Mouse/Keyboard/Display and Cursors there are some rewriting required.


I have not upgraded to version 3 yet (I probably won't for some time) so I am not sure about this. Maybe MatthiasM can chime in.

Did you already do the rewrites, you sort of imply you may have done some :)


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sat Nov 29, 2014 8:15 am 
Offline

Joined: Sat Aug 20, 2011 3:39 pm
Posts: 23
Well I took a look at it. I'm not just sure about the best way to go about it at this time.

The Mouse/Keyboard/Display and Cursor classes with static methods in LWJGL are gone since changing to glfw. Instead you register callback functions.
These callback functions receive a window pointer so you can control multiple windows. I guess one easy way to to get TWL to work with glfw would be to reimplement Mouse and Keyboard have them grab the callbacks and only support one window.

GLFW is certainly a big improvement over what was used in LWJGL 2. Nice API with enough documentation. Great support for multiple monitors and much more.
http://www.glfw.org/docs/latest/modules.html

Cursor handling is much better you can set a cursor to be in Normal, Hidden and Disabled mode. Disabled meaning it is hidden and locked and when you drag you get unlimited x and y coordinates, perfect for free look. Hidden moves the invisible cursor just giving coordinates within the limits of the window or screen resolution in case of fullscreen. I found the grabbed solution in lwjgl 2 always needing some hacky solution with Robot for free look.

One thing lacking LWJGL 3 is a usable GUI library. I like TWL since you can do pretty much anything with it :). With the theme editor as a nice reference implementation of a real application.

I'll let you know if I get somewhere with TWL and GLFW.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Mon Dec 29, 2014 4:07 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
obidobi wrote:
Well I took a look at it. I'm not just sure about the best way to go about it at this time.

The Mouse/Keyboard/Display and Cursor classes with static methods in LWJGL are gone since changing to glfw. Instead you register callback functions.
These callback functions receive a window pointer so you can control multiple windows. I guess one easy way to to get TWL to work with glfw would be to reimplement Mouse and Keyboard have them grab the callbacks and only support one window.

GLFW is certainly a big improvement over what was used in LWJGL 2. Nice API with enough documentation. Great support for multiple monitors and much more.
http://www.glfw.org/docs/latest/modules.html

Cursor handling is much better you can set a cursor to be in Normal, Hidden and Disabled mode. Disabled meaning it is hidden and locked and when you drag you get unlimited x and y coordinates, perfect for free look. Hidden moves the invisible cursor just giving coordinates within the limits of the window or screen resolution in case of fullscreen. I found the grabbed solution in lwjgl 2 always needing some hacky solution with Robot for free look.

One thing lacking LWJGL 3 is a usable GUI library. I like TWL since you can do pretty much anything with it :). With the theme editor as a nice reference implementation of a real application.

I'll let you know if I get somewhere with TWL and GLFW.


Thanks a lot for the post! Were you able to make any more progress?

Did you have an existing game using LWJGL 2 or is this a new one you made? I'm pretty far along and won't be able to do an entire rewrite/start over so having some insight on your experiences would prove to be useful.

Plus, I don't think I ran into anything where I would need to upgrade I'm just making a simplish graphical game - mostly 2D Sprites.

Thanks!


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Fri Sep 30, 2016 7:57 am 
Offline

Joined: Wed Nov 21, 2012 1:10 pm
Posts: 7
I just implemented a port (https://github.com/ClickerMonkey/twl/tree/lwjgl3) - working on creating a separate project and build.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sat Oct 01, 2016 1:59 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
ClickerMonkey wrote:
I just implemented a port (https://github.com/ClickerMonkey/twl/tree/lwjgl3) - working on creating a separate project and build.


You're porting all of TWL to LWJGL 3?

Does this confirm that MatthiasM has officially ended his support for TWL?

I'm still using TWL and overall, I like it a lot so I was sad that it appeared to have ended support.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sat Oct 01, 2016 8:17 pm 
Offline

Joined: Wed Nov 21, 2012 1:10 pm
Posts: 7
All but the custom cursor code is "working" with TWL in my port (works in my games and tools).

I submitted an issue to the Git repo and he responded - he said ideally we would have a TWL-LWJGL2.jar and a TWL-LWJGL3.jar since the LWJGL version specific classes can easily be pulled out. I'm awaiting on him creating some repos so I can do the work. If he doesn't do it anytime soon, I'll probably just do it myself.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sun Oct 02, 2016 3:43 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
ClickerMonkey wrote:
All but the custom cursor code is "working" with TWL in my port (works in my games and tools).

I submitted an issue to the Git repo and he responded - he said ideally we would have a TWL-LWJGL2.jar and a TWL-LWJGL3.jar since the LWJGL version specific classes can easily be pulled out. I'm awaiting on him creating some repos so I can do the work. If he doesn't do it anytime soon, I'll probably just do it myself.


This is great news. Thanks a lot for doing this. I have wanted to stick with TWL long term and felt like that wasn't possible before and I would have to switch to the UI systems in LibGDX. It is also good Matthias responded.

Do you have any release binaries for your port yet? I may be willing to give them a try later this year.

Thanks!


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sun Oct 02, 2016 6:56 pm 
Offline

Joined: Wed Nov 21, 2012 1:10 pm
Posts: 7
I'll work on putting it together later tonight.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Mon Oct 03, 2016 2:16 am 
Offline

Joined: Wed Nov 21, 2012 1:10 pm
Posts: 7
Here are the projects created in the new organization:

https://github.com/ThemableWidgetLibrary/twl
https://github.com/ThemableWidgetLibrary/twl-lwjgl2
https://github.com/ThemableWidgetLibrary/twl-lwjgl3

You can see the README.md on those projects to a link to the built JARs.


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Thu Oct 06, 2016 1:28 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
ClickerMonkey wrote:
Here are the projects created in the new organization:

https://github.com/ThemableWidgetLibrary/twl
https://github.com/ThemableWidgetLibrary/twl-lwjgl2
https://github.com/ThemableWidgetLibrary/twl-lwjgl3

You can see the README.md on those projects to a link to the built JARs.


Great, thanks a lot. This will be really useful for me.

I just want to make sure I understand (since the repo links are different than what you originally posted), these are your repos and not Matthias, or are you two sort of sharing dev responsibilities now? I just want to make sure I know who and how to ask for help now for fixes/features :)

Thanks!


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Thu Oct 06, 2016 5:10 pm 
Offline

Joined: Wed Nov 21, 2012 1:10 pm
Posts: 7
I took the initiative and created the organization and repos. He seemed to be busy!


Top
 Profile  
 
 Post subject: Re: TWL and LWJGL 3
PostPosted: Sat Nov 26, 2016 4:17 pm 
Offline
Oldbie

Joined: Thu Mar 15, 2012 12:38 am
Posts: 290
ClickerMonkey wrote:
I took the initiative and created the organization and repos. He seemed to be busy!


Cool - thanks. I have been busy and haven't been able to make the transition to LWJGL 3 just yet. I hope to do this in the nearish future, in December/January.

Thanks for keeping this alive. It seems LibGDX kinda pushed out all the other libraries/API. But I really like TWL and would like to keep using it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group