Author Topic: JAPI 2.0  (Read 12387 times)

John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
JAPI 2.0
« on: 25. May 2013, 18:47:17 »
I don't know if you guys remember JAPI or not but I think it's a cool extension to any language now that Java is so popular on Android. It was abandoned it seems back in 2003 with the binaries compiled for AWT. After looking over the source, I noticed a Swing version of the Java code. I compiled the Swing version of the Java code building JAPI.jar and used that as the japiserver. Everything seems to work fine and I'm blown away how fast it is. I posted the ScriptBasic version of JAPI on the SB forum and I attached the japi.dll & japi.h (generic version) to this post. It would be interesting to see how this would work as a 2D game engine.


Marcus

  • Globaler Moderator
  • Full Member
  • *****
  • Posts: 245
    • View Profile
    • NaaLaa
Re: JAPI 2.0
« Reply #1 on: 25. May 2013, 19:46:47 »
I think I'll have a look at this, thanks :) Should work fine as a naalaa extension.

Marcus

  • Globaler Moderator
  • Full Member
  • *****
  • Posts: 245
    • View Profile
    • NaaLaa
Re: JAPI 2.0
« Reply #2 on: 25. May 2013, 20:08:40 »
Could you make a static library of it instead? I'll have to create a dll for the naalaa extension, and one dll looks better than two. I'm using MS VC2010.

John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #3 on: 25. May 2013, 21:56:31 »
The JAPI 2.0 japi.lib is attached.




Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: JAPI 2.0
« Reply #4 on: 25. May 2013, 22:43:43 »
Don't we also need the JAPI.jar? Or did I miss anything?
Best regards,
Cybermonkey

John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #5 on: 25. May 2013, 22:55:31 »
Quote
Don't we also need the JAPI.jar?

Nope.

It's embedded in the DLL/lib.


John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #6 on: 25. May 2013, 23:04:03 »
FYI

I registered JAPI2.com and plan a forum or blog to help bring this project back alive. At this point we have a ScriptBasic extension module, a C DLL (VC10) and a LIB (VC10) that seem to be working based on the test programs that came with the distribution. It would be nice to bring someone into the fold that has a Java background. I'm stumbling along the best I can with it. Maybe when the japi2.com site opens it's doors, more of an interest in an alternative Java programming paradigm might unfold.


Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: JAPI 2.0
« Reply #7 on: 25. May 2013, 23:13:28 »
Quote
Don't we also need the JAPI.jar?

Nope.

It's embedded in the DLL/lib.

Ah, okay. I just tested the japi.pas from the original page with your extension. At least it works on Windows, but I think for Linux I have to do some work on the unit. Anyway, I have no SWING user interface. See attached screenshot. Although it should look like this, right?



Another annoying thing is that Windows always asks if the firewall should block the program or not ... Well, not always but once a program is compiled and started.
« Last Edit: 25. May 2013, 23:21:49 by Cybermonkey »
Best regards,
Cybermonkey

Marcus

  • Globaler Moderator
  • Full Member
  • *****
  • Posts: 245
    • View Profile
    • NaaLaa
Re: JAPI 2.0
« Reply #8 on: 25. May 2013, 23:20:57 »
The JAPI 2.0 japi.lib is attached.

Thanks! Let's see what fun I can make out of it. I need more extensions before I can feel good about releasing another naalaa version, and this one'll be good :)

John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #9 on: 25. May 2013, 23:27:50 »
The binaries from the old site are based on awt. The 2.0 series is based on swing. I used mingw32 to process the Makefile that compiles the Java code (javac) and builds the C compiled helper programs that generates the appropriate binding code. I then use MS VC10 to create the final DLL/LIB.

« Last Edit: 25. May 2013, 23:33:48 by ScriptBasic »

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: JAPI 2.0
« Reply #10 on: 25. May 2013, 23:40:11 »
The binaries from the old site are based on awt. The 2.0 series is based on swing. I used mingw32 to process the Makefile that compiles the Java code (javac) and builds the C compiled helper programs that generates the appropriate binding code. I then use MS VC10 to create the final DLL/LIB.
Erm, then you posted here the AWT version? Could you also post the SWING version?
Best regards,
Cybermonkey

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 573
    • View Profile
    • Home of EGSL
Re: JAPI 2.0
« Reply #11 on: 25. May 2013, 23:43:09 »
Okay, I downloaded the SWING version from your forum, but now I have the problem that the procedure j_button isn't found in the DLL.
Best regards,
Cybermonkey

Marcus

  • Globaler Moderator
  • Full Member
  • *****
  • Posts: 245
    • View Profile
    • NaaLaa
Re: JAPI 2.0
« Reply #12 on: 25. May 2013, 23:48:38 »
I did use java a lot for gui programs many years ago, always liked awt better than swing because of the native look. That's the good thing about iup too. People want your programs to look and feel the way they're used to. But I'll focus on the render speed for now, as that's my area of expertise.
« Last Edit: 25. May 2013, 23:50:19 by Mopz »

John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #13 on: 25. May 2013, 23:55:43 »
Does the demos that came with the SBJAPI2_RC1.zip  run? (use the SB JAPI script code as an example)

Both Charles and I were able to use the generic japi.dll with the Mandelbrot example.




John

  • Sr. Member
  • ****
  • Posts: 362
    • View Profile
Re: JAPI 2.0
« Reply #14 on: 25. May 2013, 23:59:49 »
Quote
I did use java a lot for gui programs many years ago, always liked awt better than swing because of the native look.

AWT is ugly like Motif. I see no performance hit using swing. The UI that swing brings to the table is awesome and consistent across the board.