Slick Forums

Discuss the Slick 2D Library
It is currently Wed May 22, 2013 7:25 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Aug 07, 2012 12:17 am 
Offline

Joined: Tue Aug 07, 2012 12:13 am
Posts: 2
Hi, Just want to ask some opinions about using TWL in SWT GLCanvas. I am using LWJGL to draw in GLCanvas.
But as you may know, Keyboard and Mouse classes in LWJGL is not working when used in SWT GLCanvas.
So I am wondering whether I can still use TWL in this case. :mrgreen:
Thanks for any input


Top
 Profile  
 
PostPosted: Wed Aug 08, 2012 6:58 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1172
Sure - you just need to either provide another Input implementation. As an alternative you can also call the individual GUI methods instead of calling GUI.update() which allows you to use a push method for events (eg from listeners).

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Thu Aug 09, 2012 11:50 pm 
Offline

Joined: Tue Aug 07, 2012 12:13 am
Posts: 2
Thanks for the reply, but could you give more detail please? As I am a newbie in TWL.
For instance, for a "normal" environment, this is how I setup TWL:
Code:
LWJGLRenderer renderer = new LWJGLRenderer();
Widget root = new Widget();
GUI gui = new GUI(root, renderer);
ThemeManager  themeManager = ThemeManager.createThemeManager(getClass().getResource("xx.xml"),renderer);
gui.applyTheme(themeManager);

So if I understood correctly, all I need to do is to implement my own input and change to
Code:
GUI gui = new GUI(root, renderer, new ownInput());

And that's it, nothing else?


Top
 Profile  
 
PostPosted: Fri Aug 10, 2012 5:12 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1172
Exactly - that is the easiest way when you have a poll-able input event source like LWJGL's Keyboard/Mouse class.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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:  
Powered by phpBB® Forum Software © phpBB Group