Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: JSFML - A Java binding for SFML  (Read 46866 times)

0 Members and 1 Guest are viewing this topic.

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
JSFML - A Java binding for SFML
« Reply #60 on: December 29, 2011, 12:55:24 am »
Just wondering what Java Compilers are you setting up JSFML for.

I'm using BlueJ and was wondering if what JSFML would be usable on it. :?:
I have many ideas but need the help of others to find way to make use of them.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #61 on: January 14, 2012, 09:24:17 am »
BlueJ is simply the IDE you use, the compiler is (carefully saying this) always the same. Any compiler in JDK 1.6 or higher will work, that should include the latest versions of BlueJ.

I started re-setting up the project for github-driven development.
You can follow up on the project here: https://github.com/pdinklag/JSFML

I'm refactoring and revisiting most of the code, as the previous version was quite a mess (all stuffed into one cpp file and that sort of thing). :roll: In the process, I'm also documenting it properly. Watch it grow slowly from here. :)
JSFML - The Java binding to SFML.

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #62 on: January 20, 2012, 09:27:51 pm »
I uploaded a first test package for everyone to try out. :)

This is what I call a "self-contained" package. It contains the compiled SFML and JSFML binaries (dll / so) for all supported systems and extracts whatever is needed to the directory ".jsfml" in the user directory. I'm not entirely sure about this kind of distribution yet, but it has clear advantages. People will not have to tinker with packaging them all up properly or set the java library path, but JSFML does all that automatically, at the cost of a larger file (jsfml.jar).

The test package contains binaries for Windows 32-bit and Linux 32-bit. However, it should also work for 64 bit systems as long as a 32-bit Java is installed (which is the case most of the time ;) ). I tested it on Windows 7 Professional and Ubuntu 10.04 LTS.

If all goes well, you should see something like this:


It would be cool if some people could give this a try. It's available on github:
https://github.com/pdinklag/JSFML/downloads

Quote from: "Laurent"
Another question: do you plan to maintain this binding in the long term? I'm asking because if it's serious enough, I can make it the "official" Java binding -- with packages on the download page of the website, and a forum here. Tell me what you think about it.

I believe we can go with that. :)

If this test works out well, JSFML can probably be released very soon after SFML 2.0. The Swing integration feature might not make it into the first release, but it's definitely a top-priority goal once everything else is stable. I will start writing tutorials on how to use JSFML soon and update the website ( http://jsfml.pdinklag.de/ ).
JSFML - The Java binding to SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
JSFML - A Java binding for SFML
« Reply #63 on: January 21, 2012, 09:23:11 am »
Great job! :)

I've created the Java sub-forum so that people can post their feedback there directly.
Laurent Gomila - SFML developer

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #64 on: January 21, 2012, 10:03:30 am »
OK, thanks :) I'll post an info thread later, since the main post in here is pretty much outdates.

I added another example that allows you to add shapes floating around, sort of a little benchmark test and demonstrating shapes:
https://github.com/pdinklag/JSFML/downloads

I'm experiencing something weird here. I set the max FPS to 60, but the FPS (and I'm actually counting every frame until a second passes) stays at 32 until I add a whole bunch of shapes to the scene. Does SFML automagically hold down  the frame rate for some reason? I don't really get it.
JSFML - The Java binding to SFML.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
JSFML - A Java binding for SFML
« Reply #65 on: January 21, 2012, 10:40:30 am »
Quote
Does SFML automagically hold down the frame rate for some reason?

No. But since I recently changed the sf::Clock implementation, as well as the time API, there might be new bugs there.
Laurent Gomila - SFML developer

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #66 on: January 21, 2012, 12:21:35 pm »
Well, I didn't update to the new Time API yet, will do that now.
JSFML - The Java binding to SFML.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
JSFML - A Java binding for SFML
« Reply #67 on: January 21, 2012, 12:51:21 pm »
Is there an online documentation (JavaDoc or something) available? I always like to browse through APIs to get an overview :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #68 on: January 21, 2012, 12:58:40 pm »
Yup: http://jsfml.pdinklag.de/javadoc/
The new Time API is not in there yet, working on it at this moment (and wondering where the hell sf::Window::GetFrameTime has gone  :shock: )
JSFML - The Java binding to SFML.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
JSFML - A Java binding for SFML
« Reply #69 on: January 21, 2012, 01:13:50 pm »
Thanks! Concerning sf::Window::GetFrameTime(), I just wondered the same thing, it has been removed.

For the C++ operators, is there a class with static methods?
Code: [Select]
Vector2f a   = new Vector2f(2.f, 4.f);
Vector2f b   = new Vector2f(3.f, 5.f);
Vector2f sum = Op.add(a, b);
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #70 on: January 21, 2012, 01:43:59 pm »
Quote from: "Nexus"
For the C++ operators, is there a class with static methods?
Code: [Select]
Vector2f a   = new Vector2f(2.f, 4.f);
Vector2f b   = new Vector2f(3.f, 5.f);
Vector2f sum = Op.add(a, b);

I plan on starting a discussion thread on that soon. ;)
Something like that will be needed for vectors, times and colors.
JSFML - The Java binding to SFML.

Masthiks

  • Newbie
  • *
  • Posts: 10
    • View Profile
JSFML - A Java binding for SFML
« Reply #71 on: January 21, 2012, 11:26:45 pm »
Hello!

There is a way to use JSFML for x64 architecture? I tried to modify SFMLNative.java but I have an error when I launch my test program: "libsndfile-1.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform", and  change "${env.SFML_HOME}/extlibs/bin/x86" by "${env.SFML_HOME}/extlibs/bin/x64" at line 125 of the ant file does not work.
It's a bit annoying :/

(By the way, sorry for my english)

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #72 on: January 22, 2012, 07:00:52 am »
Not yet, sorry.
You would have to provide an actual 64-bit libsndfile (SFML should include one in the extlib folder). You cannot mix a 32-bit DLL into a 64-bit application.

Are you building JSFML yourself? If so, you might be a good test subject for a win64 ant build target. :) I have no 64-bit system here (yet), so it's not easy for me to test those things.

EDIT:
I'm switching to x64 myself now. Had it planned for quite a while, better now on a lazy sunday than never. :D
JSFML - The Java binding to SFML.

Masthiks

  • Newbie
  • *
  • Posts: 10
    • View Profile
JSFML - A Java binding for SFML
« Reply #73 on: January 22, 2012, 09:58:36 am »
Quote from: "pdinklag"
Are you building JSFML yourself?


Yes, otherwise it's not very interesting to modify the ant file and SFMLNative.java (of JSFML) :)

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
JSFML - A Java binding for SFML
« Reply #74 on: January 22, 2012, 11:54:14 am »
How did you link SFML on your 64-bit system? Because I can't (using mingw-64).
JSFML - The Java binding to SFML.