Slick Forums

Discuss the Slick 2D Library
It is currently Thu Apr 24, 2014 7:19 am

All times are UTC




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Android + Slick
PostPosted: Thu Nov 15, 2007 10:44 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Spent a couple of evenings do a proof of concept hack of using Slick on Google Android with OpenGL ES. Not far in yet, but got the renderer mostly working on the Android SDK:

Image

It's a tiny start, but thats the current build of Slick with a different renderer using our SVG stuff to render the now ubiquitous orc. Game code looks like this:

Code:
public class TestGame extends BasicGame {
   private Shape shape;
   private Diagram diagram;
   
   public TestGame() {
      super("Test Game");
   }
   
   @Override
   public void init(GameContainer container) throws SlickException {
      shape = new Rectangle(0,0,30,30);
      diagram = InkscapeLoader.load("orc.svg");
   }

   @Override
   public void update(GameContainer container, int delta) throws SlickException {
   }

   public void render(GameContainer container, Graphics g) throws SlickException {
      g.translate(70, 5);
      g.scale(0.25f,0.25f);
      for (int i=0;i<diagram.getFigureCount();i++) {
         Figure figure = diagram.getFigure(i);

         if (figure.getData().isColor(NonGeometricData.FILL)) {
            g.setColor(figure.getData().getAsColor(NonGeometricData.FILL));
            g.fill(diagram.getFigure(i).getShape());
            g.setAntiAlias(true);
            g.draw(diagram.getFigure(i).getShape());
            g.setAntiAlias(false);
         }
         
         if (figure.getData().isColor(NonGeometricData.STROKE)) {
            g.setColor(figure.getData().getAsColor(NonGeometricData.STROKE));
            g.setLineWidth(figure.getData().getAsFloat(NonGeometricData.STROKE_WIDTH));
            g.draw(diagram.getFigure(i).getShape());
            g.resetLineWidth();
         }
   
      }
      
      g.resetTransform();
      
      g.setColor(Color.green);
      g.fill(shape);
      g.translate(50,5);
      g.fill(shape);
      
   }
}


So, the same as normal really.

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 15, 2007 11:19 pm 
Online
Oldbie

Joined: Tue Nov 28, 2006 6:18 pm
Posts: 429
Looking terrific so far. Keep us posted!

- Jon


Top
 Profile  
 
 Post subject: Re: Android + Slick
PostPosted: Thu Nov 15, 2007 11:47 pm 
Offline

Joined: Fri Dec 01, 2006 3:56 pm
Posts: 34
Location: The Netherlands
Wow..
If Android takes off, Slick could very well become the number one choice for 2D game developers in the future. I like it! :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 16, 2007 8:39 am 
Offline
Game Developer

Joined: Sun Nov 12, 2006 11:18 pm
Posts: 890
Location: Germany
Hats off!

Hopefully Google bots detect this topic real soon and you'll end up with a Google job offer :lol:

Impressed,
Tommy

_________________
Right Angle Games | Marte Engine
Back to the past | Star Cleaner | SpiderTrap


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 12:38 am 
Offline
Oldbie

Joined: Sat Nov 18, 2006 3:11 pm
Posts: 254
Location: Helsinki
this damn impressive :shock: .


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 17, 2007 12:40 am 
Offline

Joined: Mon Nov 12, 2007 3:52 am
Posts: 7
Outstanding! ... :shock: :D 8)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 19, 2007 12:04 am 
Offline
User avatar

Joined: Mon Nov 12, 2007 1:24 am
Posts: 6
Hi,

Congratulations :D

Regards,
Shadow.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 21, 2007 1:58 am 
Offline
User avatar

Joined: Mon Jul 23, 2007 8:33 pm
Posts: 37
Looks pretty nice. :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 1:00 am 
Offline

Joined: Sun May 13, 2007 10:02 pm
Posts: 9
That looks great, well done :D

keep up the good work.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 08, 2009 12:50 am 
Offline

Joined: Sat Feb 07, 2009 4:34 pm
Posts: 11
Has there been any recent work getting Slick to work with Android?

I know the G1 is more powerful than the emulator you tested back in 2007...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2009 2:51 pm 
Offline
Regular
User avatar

Joined: Thu Dec 18, 2008 6:07 pm
Posts: 238
Location: Bournemouth, UK
I'd like to see where this has gone also; I'm waiting for the open handset boom. :lol:

I'll note this post as it concerns splitting Slick into multiple .jars (maybe one that override certain Slick classes, for the android port? (I have no knowledge of the insides of Slick, so I make only assumptions)).
http://slick.javaunlimited.net/viewtopi ... =8999#8999

_________________
- Gwinnell (irc.freenode.net, irc.chatspike.net)
- Game Jolt Moderator


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 09, 2009 5:30 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
I posted as far as I got here:

http://slick.javaunlimited.net/viewtopi ... ht=android

The emulator was just too painfully slow to work with. It may be much better now, but I don't have the time right now. However, it's on my list (#5 I think).

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 15, 2009 4:54 pm 
Offline

Joined: Sat Feb 07, 2009 4:34 pm
Posts: 11
Hey, i've just spent a few hours trying to get slick working on Android (I believe the SDK must have changed since you last looked at it). I am using an older version of the Slick.jar as the current version caused some compile issues (LWJGL cursor not found issue).
However what is really baffling me is the current error I am getting:

ERROR/AndroidRuntime(274): Uncaught handler: thread main exiting due to uncaught exception
ERROR/AndroidRuntime(274): java.lang.ExceptionInInitializerError
ERROR/AndroidRuntime(274): at org.newdawn.slickdroid.GLView.<init>(SlickDroid.java:123)
ERROR/AndroidRuntime(274): Caused by: java.lang.VerifyError: org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer
ERROR/AndroidRuntime(274): at org.newdawn.slick.opengl.renderer.Renderer.<clinit>(Renderer.java:23)

Do you have any idea why the "java.lang.VerifyError" is being thrown?
According to the docs:

This error is thrown when the VM notices that an attempt is made to load a class which does not pass the class verification phase.

But that means nothing to me!

I was just wondering if anyone (namely kev ;)) has come across this?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 16, 2009 10:40 pm 
Offline

Joined: Sat Feb 07, 2009 4:34 pm
Posts: 11
Just to add to my previous question above...

Is Phys2D likely to work on Android without needing significant modifications? I know the AWT package is not included in Android but does anyone know if the actual engine uses anything which may not be available in Android?

I intend to look through all the source and try and get it working, however I am pushed for time and thought i'd ask in case anyone knew a definitive answer to this question!

Thanks :wink:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2009 7:19 am 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
Should work, but is very GC heavy which won't sit with Android very well.

Kev


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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