Backend for SWT (using LWJGL)

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

Backend for SWT (using LWJGL)

Postby Marc » Sat Nov 19, 2011 6:00 pm

Out of need I started to create a SWT backend for libGDX. Very nice thing to have for some integrated Eclipse-Editor-Action :). It includes two Helloworld samples illustrating the two intended usages. One is the usual Helloworld creating its own slim SWT window and using a single ApplicationListener. The other is handy to create editor previews. Basically it allows for drawing to multiple canvases using a separate ApplicationListener for each. Only one Application (=one mainloop) is used in the back. No API breakages involved ...

Intended special features of this backend:
  • Render to multiple Canvases using independent ApplicationListeners
  • Add and remove Canvases on the fly
  • Put the Canvases where you want them (same window or separate ones)
  • Use your own window or let the Backend handle creation (the usual, set by default)

It is based on the LWJGL backend and I used the libGDX structure for the java packages. I hope this makes it easy and obvious to use for anyone who is familiar with libGDX. SWT is not included for download size reasons (would be 100+MB download for the usual platforms). The source contains Eclipse projects where just the classpaths have to be set correctly. Also it is based of todays SVN version (rev. 3330).

TODO:
- Test :)

It's not tested well so far. I just got it to work properly today. I used the two provided samples for development, expect nothing else anytime soon. I release this now to hopefully get some constructive feedback. We'll see where this leads us ...

happy coding 8-)

Changelog:
v0.3
- updated to current SVN revision (rev. 3330)
v0.2
- added SWTInput to handle Mouse and Keyboard input
v0.1
- initial release (SWTApplication & SWTOpenGLCanvas)
Attachments
gdx-backend-lwjgl-swt-src.zip
(12.26 MiB) Downloaded 470 times
gdx-backend-lwjgl-swt.jar
(69.12 KiB) Downloaded 329 times
Last edited by Marc on Thu Feb 16, 2012 7:29 pm, edited 2 times in total.
Marc
 
Posts: 8
Joined: Sat Mar 12, 2011 2:21 pm
Location: Vienna, Austria

Re: Backend for SWT (using LWJGL)

Postby Marc » Wed Nov 23, 2011 8:06 pm

Added Input handling (v0.2) from SWT. Needs Testing, not sure if I got everything. Now Eclipse editors can not just preview your stuff but be interactive as well :shock: .

:idea: Android Game Development Studio anyone?
Marc
 
Posts: 8
Joined: Sat Mar 12, 2011 2:21 pm
Location: Vienna, Austria

Re: Backend for SWT (using LWJGL)

Postby Obli » Thu Nov 24, 2011 8:30 am

It's always nice to have new backends, thanks, that's a real nice contribution! :o

On a personal note, I once tried to use the Netbeans Platform (equivalent of Eclipse RCP) to build an application, and I quickly went back to old JFrames and panels. :mrgreen:
Actually, I already built many tools (like this and this) using libgdx as a renderer: an LwjglCanvas can be embedded in any Swing gui easily, it's enough for me.
Obli
 
Posts: 616
Joined: Mon Jan 10, 2011 6:18 pm
Location: Bordeaux, France

Re: Backend for SWT (using LWJGL)

Postby Marc » Sat Jan 28, 2012 5:30 pm

updated API to latest SVN revision 3330.
Marc
 
Posts: 8
Joined: Sat Mar 12, 2011 2:21 pm
Location: Vienna, Austria

Re: Backend for SWT (using LWJGL)

Postby mzechner » Thu Feb 02, 2012 1:12 am

Really cool. If you promise to maintain it, we could make it an extension or a separate backend. You'd get commit rights :)
mzechner
Site Admin
 
Posts: 4875
Joined: Sat Jul 10, 2010 3:50 pm

Re: Backend for SWT (using LWJGL)

Postby Marc » Mon Feb 06, 2012 8:01 pm

Right now it's more a prove of concept from my side. Not using it in any projects, but plan to. First need to finish my current ones. If I should use it for a new project I'll be able to keep it up to date fairly easy. Will let you know here if that should happen :)
Marc
 
Posts: 8
Joined: Sat Mar 12, 2011 2:21 pm
Location: Vienna, Austria

Re: Backend for SWT (using LWJGL)

Postby tomas » Thu Feb 16, 2012 1:34 pm

Hey Marc, I followed your link from my Multiple Canvases thread. It's awesome that you have already figured out most of this stuff. I downloaded the zip to check out your code but I could not find the source code of the SWT backend :(
tomas
 
Posts: 13
Joined: Sat Jul 23, 2011 7:15 pm

Re: Backend for SWT (using LWJGL)

Postby Marc » Thu Feb 16, 2012 7:32 pm

sorry, got the wrong source directoy there :o. I've uploaded a new zip file with the right one.
Marc
 
Posts: 8
Joined: Sat Mar 12, 2011 2:21 pm
Location: Vienna, Austria

Re: Backend for SWT (using LWJGL)

Postby Mipada » Mon Oct 10, 2016 5:23 am

I know it's been a while since anyone's posted on this topic but it's just what I'm looking for.
1) Sorry, i've never run anyone's jar file before. I tried java -jar gdx-backend-lwjgl-swt.jar and it couldn't find Main or 'no main manifest attribute'. I'm still trying to get it to work in Netbeans/JME. Can I run this from the command prompt?
2) When Java came out I though that there would be applets on EVERYTHING. Oh, look, a recipe with an applet of someone stirring! Or an applet of the planets orbiting the sun - again! It didn't happen. But, this app sounds simple. Is it possible to put up the applet here so people can just look at what you've done? Then they can spend their time implementing your backend in their programs.
Mipada
 
Posts: 1
Joined: Mon Oct 10, 2016 4:12 am

Re: Backend for SWT (using LWJGL)

Postby evilentity » Mon Oct 10, 2016 8:15 am

And now, applets are dead. This thing was updated 4 years ago, odds are it wont work no matter what you do.
Need a freelancer? PM me!
evilentity
 
Posts: 3582
Joined: Wed Aug 24, 2011 11:37 am


Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 2 guests