Java Gp2x Runtime (jre)


Fungostar posted on Oct 9 2006 at 07:51 PM said:
Nagelfar posted on Oct 9 2006 at 04:40 PM said:
Ryo posted on Oct 7 2006 at 12:15 PM said:
This jre doesn't include awt/swing so this is why you shouldn't expect for every java app out there to run on the gp2x, but nothing stops you from trying a port. Games using SDLJava should be doable.
Damn, too bad there is no AWT Support yet, any word if that might be done?

Yes, it can be done, depends only on how much effort one spends on this.

The infrastructure at the foundation of Swing/AWT is already present, the missing part is wrapping AWT over SDL. This is not so simple because SWING and AWT are made to be run over a windowing system such as X11 or Windows.
Well, newer Java Versions support Fullscreen but I don't know technical details on how they do it. Anyways, I checked out the Release today, I think the SDL stuff is fine enough for me to do some experiments, they only reason I haven't done SDL yet is because I hate C/C++ :)
 
Last edited by a moderator:
Orkie posted on Oct 9 2006 at 08:42 PM said:
Fungostar posted on Oct 9 2006 at 06:51 PM said:
This is not so simple because SWING and AWT are made to be run over a windowing system such as X11 or Windows.

http://x11.gp2x.de/ :)

Something like this was one of my options... but with X11 and the JRE running I think that the remaining RAM can become too small to do serious stuff...
don't you think so ?


Nagelfar posted on Oct 9 2006 at 10:15 PM said:
Well, newer Java Versions support Fullscreen but I don't know technical details on how they do it. Anyways, I checked out the Release today, I think the SDL stuff is fine enough for me to do some experiments, they only reason I haven't done SDL yet is because I hate C/C++ :)

If you do something it will be all my pleasure... I did this to let people code and enjoy :D
 
Last edited by a moderator:
Fungostar posted on Oct 10 2006 at 12:55 AM said:
Nagelfar posted on Oct 9 2006 at 10:15 PM said:
Well, newer Java Versions support Fullscreen but I don't know technical details on how they do it. Anyways, I checked out the Release today, I think the SDL stuff is fine enough for me to do some experiments, they only reason I haven't done SDL yet is because I hate C/C++ :)

If you do something it will be all my pleasure... I did this to let people code and enjoy :D
Well, seems like it works well enough, we'll see, one Issue I ran into, though, in Java I have a method withing Graphics which is called draws a Rectangle instead of draws AND fills it (as SDL does) is there any way to draw a rectangle in SDL, too? Google couldn't help me out on that unfortunatly :-/
 
Last edited by a moderator:
Make your own method and draw 4 lines using this (some of it is psuedocode, I don't know the real methods but I do know Java =D):

Code:
DrawRectangle(0,0,20,20);//method call

public static boolean DrawRectangle(int ax,int ay,int bx, int by){//method, ax,ay=first point, bx,by=second point to draw rectangle from 2 corners
   DrawLine(ax,ay,bx,ay);
   DrawLine(ax,ay,ax,by);
   DrawLine(bx,ay,bx,by);
   DrawLine(ax,by,bx,by);
}

Add in your own things like color to the thing if you need them, I think you know how to do this ;)
 
Shikaku posted on Oct 10 2006 at 07:02 PM said:
Make your own method and draw 4 lines using this (some of it is psuedocode, I don't know the real methods but I do know Java =D):

Code:
DrawRectangle(0,0,20,20);//method call

public static boolean DrawRectangle(int ax,int ay,int bx, int by){//method, ax,ay=first point, bx,by=second point to draw rectangle from 2 corners
   DrawLine(ax,ay,bx,ay);
   DrawLine(ax,ay,ax,by);
   DrawLine(bx,ay,bx,by);
   DrawLine(ax,by,bx,by);
}

Add in your own things like color to the thing if you need them, I think you know how to do this ;)
Haha well, yeah, that is what I didn't want to do but yeah, I'll probably do it that way.
And btw I couldn't find a DrawLine either. Now I'm asking myself, too stupid to read documentation or too spoilt by Java?!
 
Last edited by a moderator:
For another solution, download the windows SDK that contains all the java source code, including a rewrite of the Graphics J2ME Class that can draw rectangles :)

The Win SDK is here: http://repository.gp2xdev.net/viewfile.php?id=40

Ciao :D

EDIT:
forgot to mention, this is the SDK for the Beta 1.0, a little outdated, the SDk for beta 1.5 is work in progress.
you will find the method
public void drawRect(int x, int y, int w, int h)
inside the class
java-Win32-Devkit/Projects/UIKit/src/com/synclast/Graphics.java

that in turns calls the native API SDL_gfx :D

Ciao Again :D
 
Fungostar posted on Oct 10 2006 at 08:03 PM said:
For another solution, download the windows SDK that contains all the java source code, including a rewrite of the Graphics J2ME Class that can draw rectangles :)

The Win SDK is here: http://repository.gp2xdev.net/viewfile.php?id=40

Ciao :D

EDIT:
forgot to mention, this is the SDK for the Beta 1.0, a little outdated, the SDk for beta 1.5 is work in progress.
you will find the method
public void drawRect(int x, int y, int w, int h)
inside the class
java-Win32-Devkit/Projects/UIKit/src/com/synclast/Graphics.java

that in turns calls the native API SDL_gfx :D

Ciao Again :D
Hey, do you use ICQ? If so, would you mind contacting me at 15794959 I'm having troubles getting my own programs to run, even small HelloWorld Stuff while your samples run fine, perhaps you can give me some pointers. If not ICQ then perhaps at much9remove9AETyahooremove.com
 
Last edited by a moderator:
Just to let you guys know, I just ran my first own program using java + sdl on my gp2x. Took some help from Fungostar and some hours work to set everything up but now everythings works like a charm!
 
Nagelfar, how fast does the program run? Is it comparable in speed to Fenix, or does it approach the heights of C?

- Alex
 
Alex. posted on Oct 11 2006 at 10:13 PM said:
Nagelfar, how fast does the program run? Is it comparable in speed to Fenix, or does it approach the heights of C?

- Alex
To be honest, I can't tell. I have never tried Fenix before and I'm 100% sure it won't reach native C. It loads fast enough and it will easily be fast enough for my game. Give me some more time to play with it or try it out yourself :)
 
Last edited by a moderator:
Great Job Nagelfar and Fungostar!!

I think Java can be a very useful and powerful language on the GP2X.

For speed and tools (like assemble all the files and runtimes in one .gpe file or similar) we seek in the future what the community want...
 
smx posted on Oct 12 2006 at 09:37 AM said:
Great Job Nagelfar and Fungostar!!

I think Java can be a very useful and powerful language on the GP2X.

For speed and tools (like assemble all the files and runtimes in one .gpe file or similar) we seek in the future what the community want...
Well lets not talk about speed as long as we don't have a clue how fast (slow) it really is, I would hate to see all those "Java is slow" Trolls bashing this project before it has even really started. Give me about a week, I think then I will be able to present at least some results :)
 
Last edited by a moderator:
Some update from the front, Fungostar did a really nice job. as soon as you know the framework its all pretty intuitive. There is some bugs now and there but none that can't be worked out. I managed to port a small Java based game I did in under 2 hours, mostly the drawing and button handling stuff had to be rewritten. Only problem right now: that game was in alpha status so the ported game is alpha, too, if I'm motivated I'll do a night session today so you can probably expect a beta release at the end of next week :)
Speed seems fine to me, Fungostar wrote a nice application launcher so you have to load the Java VM only once (takes some seconds but is no problem) and afterwords programs start almost instantly, nice job there, too.
 
OK, if you were wondering why I didn't post, first of all, lack of time, second, lack of time, third, too much partying, last but not least, it is done and in Beta but will not be released because I'd like to enter it in the current competition. Still, I'd like to show you two gameplay videos, first one running in Fungostar's launcher, second one the game running on my GP2x (pardon the quality->cellphone)...

Video 1:
http://www.youtube.com/watch?v=iGQerAlwPA8

Video 2:
http://www.youtube.com/watch?v=0WZ_fNfDD1U

Hope you enjoy it :)
 
Last edited by a moderator:
Back
Top