pdinklag / jsfml Goto Github PK
View Code? Open in Web Editor NEW⛔️ DEPRECATED: No longer maintained!
License: Other
⛔️ DEPRECATED: No longer maintained!
License: Other
Write some basic tutorials which should cover:
Complete the Javadoc and add some usage examples for classes that might be hard to understand for newbies.
Write bindings for the SFML Window module, featuring the following classes:
sf::ContextSettings
→ org.jsfml.window.ContextSettings
sf::Event
→ org.jsfml.window.event.*
sf::Joystick
→ org.jsfml.window.Joystick
sf::Keyboard
→ org.jsfml.window.Keyboard
sf::Mouse
→ org.jsfml.window.Mouse
sf::VideoMode
→ org.jsfml.window.VideoMode
sf::Window
→ org.jsfml.window.Window
Hi! Tried this both with linux32
and linux64
and I am getting undefined reference to the new sf::RenderTarget::map* functions. I know it worked on Windows so I am just guessing you have forgotten to update these binaries.
I'm attaching the output just in case if it is something else but doesn't look like it:
linux.build:
[mkdir] Created dir: /home/groogy/Projects/JSFML/out/obj/linux_x86
[mkdir] Created dir: /home/groogy/Projects/JSFML/out/bin/linux_x86
[exec] /tmp/ccTohQXH.o: In function `Java_org_jsfml_graphics_RenderTexture_nativeMapPixelToCoords':
[exec] org_jsfml_graphics_RenderTexture.cpp:(.text+0x43f): undefined reference to `sf::RenderTarget::mapPixelToCoords(sf::Vector2<int> const&) const'
[exec] org_jsfml_graphics_RenderTexture.cpp:(.text+0x4b3): undefined reference to `sf::RenderTarget::mapPixelToCoords(sf::Vector2<int> const&, sf::View const&) const'
[exec] /tmp/ccTohQXH.o: In function `Java_org_jsfml_graphics_RenderTexture_nativeMapCoordsToPixel':
[exec] org_jsfml_graphics_RenderTexture.cpp:(.text+0x552): undefined reference to `sf::RenderTarget::mapCoordsToPixel(sf::Vector2<float> const&) const'
[exec] org_jsfml_graphics_RenderTexture.cpp:(.text+0x5c6): undefined reference to `sf::RenderTarget::mapCoordsToPixel(sf::Vector2<float> const&, sf::View const&) const'
[exec] /tmp/ccodTrcY.o: In function `Java_org_jsfml_graphics_RenderWindow_nativeMapPixelToCoords':
[exec] org_jsfml_graphics_RenderWindow.cpp:(.text+0x2c6): undefined reference to `sf::RenderTarget::mapPixelToCoords(sf::Vector2<int> const&) const'
[exec] org_jsfml_graphics_RenderWindow.cpp:(.text+0x33e): undefined reference to `sf::RenderTarget::mapPixelToCoords(sf::Vector2<int> const&, sf::View const&) const'
[exec] /tmp/ccodTrcY.o: In function `Java_org_jsfml_graphics_RenderWindow_nativeMapCoordsToPixel':
[exec] org_jsfml_graphics_RenderWindow.cpp:(.text+0x3e1): undefined reference to `sf::RenderTarget::mapCoordsToPixel(sf::Vector2<float> const&) const'
[exec] org_jsfml_graphics_RenderWindow.cpp:(.text+0x459): undefined reference to `sf::RenderTarget::mapCoordsToPixel(sf::Vector2<float> const&, sf::View const&) const'
[exec] collect2: error: ld returned 1 exit status
There is currently no way to tell, from inside a JSFML application, which JSFML version is in use. SFML defines the macros SFML_VERSION_MAJOR
and SFML_VERSION_MINOR
for this, JSFML should probably define similar constants in a class like org.jsfml.JSFML
.
Provide a way to implement a custom SFML SoundStream in Java (e.g. for MP3 decoders).
I browsed the javadoc and wiki but I couldn't find how to show FPS on the screen. Dóe JSFML have the fps showing feature?
The VertexArray class currently uses the same method names as its C++ counterpart. Java developers are used to different names and might get confused by this naming scheme. On top of that, VertexArray is basically a custom implementation of a collection.
To integrate with Java better, it should implement the List interface and serve as a wrapper around an ArrayList.
Since drawables are now implementable in Java and the only "logic" left in the C++ class would be drawing and calculating the vertex array's bounds in a really simple manner, this can all be done in Java directly.
The resulting class would be extremely simple:
public class VertexArray extends ArrayList<Vertex> implements Drawable {
// ... (constructors)
private PrimitiveType primitiveType;
// ... (getter and setter)
@Override
public void draw(RenderTarget target, RenderStates states) {
if(!isEmpty())
target.draw(toArray(new Vertex[size()]), primitiveType, states);
}
public FloatRect getBounds() {
// ... (simple calculation by iterating over the vertices)
}
}
Write bindings for the SFML Graphics module, featuring the following classes / enums:
sf::BlendMode
→ org.jsfml.graphics.BlendMode
sf::CircleShape
→ org.jsfml.graphics.CircleShape
sf::Color
→ org.jsfml.graphics.Color
sf::ConvexShape
→ org.jsfml.graphics.ConvexShape
sf::Drawable
→ org.jsfml.graphics.Drawable
sf::FloatRect
→ org.jsfml.graphics.FloatRect
sf::Font
→ org.jsfml.graphics.Font
sf::Glyph
→ org.jsfml.graphics.Glyph
sf::Image
→ org.jsfml.graphics.Image
sf::IntRect
→ org.jsfml.graphics.IntRect
sf::PrimitiveType
→ org.jsfml.graphics.PrimitiveType
sf::RectangleShape
→ org.jsfml.graphics.RectangleShape
sf::RenderStates
→ org.jsfml.graphics.RenderStates
sf::RenderTarget
→ org.jsfml.graphics.RenderTarget
sf::RenderTexture
→ org.jsfml.graphics.RenderTexture
sf::RenderWindow
→ org.jsfml.graphics.RenderWindow
sf::Shader
→ org.jsfml.graphics.Shader
sf::Shape
→ org.jsfml.graphics.Shape
sf::Sprite
→ org.jsfml.graphics.Sprite
sf::Text
→ org.jsfml.graphics.Text
sf::Texture
→ org.jsfml.graphics.Texture
sf::Transform
→ org.jsfml.graphics.Transform
sf::Transformable
→ org.jsfml.graphics.Transformable
sf::Vertex
→ org.jsfml.graphics.Vertex
sf::VertexArray
→ org.jsfml.graphics.VertexArray
sf::View
→ org.jsfml.graphics.View
This is most notable when using shader scripts that are larger than 1 KB. The reason is the string buffer size in the JavaString intercom type, which should be enlarged significantly.
When you press the right arrow key, JSFML reports LEFT, etc. This has most likely to do with the recent addition of Key.UNKNOWN.
This is probably related to texts sharing a common static buffer for their strings.
Both the X and Y coordinates are set to the X coordinate.
Several JSFML types are designed with hashing in mind, explicitly providing hashCode()
and equals()
implementations that consider the type's member variables.
At the moment, the implementations of hashCode()
were automatically generated by my IDE; it is not clear whether they are collision safe in productive environments. This has to be revised and, if necessary, improved.
Write bindings for the SFML Audio module, featuring the following classes:
sf::Listener
→ org.jsfml.audio.Listener
sf::Music
→ org.jsfml.audio.Music
sf::Sound
→ org.jsfml.audio.Sound
sf::SoundBuffer
→ org.jsfml.audio.SoundBuffer
sf::SoundBufferRecorder
→ org.jsfml.audio.SoundBufferRecorder
sf::SoundRecorder
→ org.jsfml.audio.SoundRecorder
sf::SoundSource
→ org.jsfml.audio.SoundSource
sf::SoundStream
→ org.jsfml.audio.SoundStream
The SoundRecorder
class is currently a simple abstract class to create the correct hierarchy for SoundBufferRecorder
. However, it cannot be implemented yet like SoundStream
.
I need to get a mic...
This message seems to be written into stderr everytime a window is created, it should be investigated.
See SFML/SFML@dd51b3d
This change should be reflected in JSFML.
SFML methods that return a bool
to indicate success or failure are realized using excetpions in JSFML (for instance: [Shader.loadFromFile](http://jsfml.org/javadoc/org/jsfml/graphics/Shader.html#loadFromFile%28java.io.File, org.jsfml.graphics.Shader.Type%29%29).
The problem here is that the exception thrown will not provide a description as to what went wrong. Instead, SFML will write into the error stream independently, possibly totally out of context because native error stream flushing is currently not being controlled.
JSFML should solve this issue by capturing SFML's error output and place it in the exception's description. The capture should start immediately before the respective native method is invoked and stop immediately after it's done. The native method must call fflush(stderr);
to ensure that the error stream is flushed while it is being captured.
Using simple parsing on a Java level, a proper exception type can be determined as well.
The default font ("Arial") has been removed from SFML for legal reasons. There is no longer a default font. This change has to be reflected in JSFML.
SFML/SFML@a0c1f5f
Now that SFML 2 is released and its logo is final, JSFML's logo should be updated as well.
The idea is to use SFML's pentagon icon in red, which is the color Oracle has picked for Java after taking it over, as opposed to SFML's green.
Write a well commented example application that shows off a good amount of features. It should include:
On Debian Squeeze (and possibly Linux in general), under yet to be analyzed circumstances, Text.setString
causes an access violation in SFML's sf::String(const wchar_t*)
constructor.
It is not yet clear whether this is an SFML problem or a bug in JSFML's native code.
sf::Texture::getMaximumSize()
has no JSFML binding.
When I'm trying to load a shader I get this exception from Java:
Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: org.jsfml.graphics.Shader.nativeLoadFromSource(Ljava/lang/String;Lorg/jsfml/graphics/Shader$Type;)Z
at org.jsfml.graphics.Shader.nativeLoadFromSource(Native Method)
at org.jsfml.graphics.Shader.loadFromSource(Unknown Source)
at org.jsfml.graphics.Shader.loadFromFile(Unknown Source)
Provide a way to implement a custom SFML Drawable in Java.
Moving the mouse over a RenderWindow extensively seems to cause slowdowns.
Whenever an audio class is used, the OpenAL thread will stay alive even if the JVM wants to exit, making it roam in memory until it is killed forcibly.
This requires SFML Issue #30 to be fixed so there is a way for JSFML to explicitly close the audio device upon exit.
SFML allows explicit conversion between int and float-based structures (see SFML/SFML@eac841e). This is currently not possible in JSFML, but should be added for convenience.
The Shader
class currently lacks a static initializer that loads the native libraries:
static {
SFMLNative.loadNativeLibraries();
}
This can result in an UnsatisfiedLinkError
when trying to call isAvailable
before a shader instance has been created.
More classes than just Shader
might be affected.
While distribution on Windows and Mac OS X will probably go seamlessly, a final plan about how to distribute JSFML for Linux systems is still required. Packaging the binaries into the JAR seems to be problematic because of SFML dependencies.
At the moment, GLEW 1.6 and libjpeg v8d are linked statically into the contained SFML binaries, because many different versions of GLEW exist around various Linux distributions, and libjpeg does not even exist on Fedora, for instance, which has libjpeg-turbo instead.
There also seem to be libc
related critical issues like #36 and possibly others which have not yet been found.
A decision has to be made about how JSFML will be distributed for Linux systems in a developer and end user friendly way. Preferably, JSFML will consist of one single JAR file for easy redistribution and cross-platform compatibility, but other methods will have to be considered as needed.
Introduce conversion methods between equivalent JSFML and AWT types:
org.jsfml.graphics.Color
↔ java.awt.Color
org.jsfml.graphics.FloatRect
↔ java.awt.Rectangle
org.jsfml.graphics.Image
↔ java.awt.image.BufferedImage
org.jsfml.graphics.IntRect
↔ java.awt.Rectangle
org.jsfml.system.Vector2i
↔ java.awt.Point
org.jsfml.system.Vector2f
↔ java.awt.Point
According to Oracle's EOL Policy, the "End of Public Updates" for Java 6 is scheduled for February, 2013.
Since there is no scheduled release date for SFML 2 yet and 2013 is clearly coming, it should be taken into consideration to refactor JSFML to take advantage of new APIs provided by Java 7.
Doing so will make JSFML require Java 7 at least, however, not doing so will cause several methods to become deprecated shortly after the initial release of JSFML (e.g. those which use Java's "old" file API).
org.jsfml.window.Window
is currently merely an interface and not a usable class. Therefore, it is not really a binding to the sf::Window
class. This should be changed so it can be used to create a simple OpenGL-ready window. The RenderWindow
class should be unaffected by this.
For some reason, RenderWindow::capture is missing.
Hi,
not so important but in the Mouse class, the method to get position is "getPoisition()"
--> getPosition()
;)
The default colors (such as Color.RED) are currently mutable, ie they can be altered by code using them. According to the workaround conventions for JSFML, an invisible immutable color type should be introduced for these.
See the following forum thread for the discussion:
http://en.sfml-dev.org/forums/index.php?topic=10242.0
Provide an AWT / Swing component that can host a RenderWindow so it can be used in AWT / Swing UIs, including browser applets.
Apply the following SFML API changes to JSFML:
The integer version of the Vector3 is missing from the library.
Support Mac OS X as a targeted system.
See SFML/SFML@7faf585
This change has to be reflected in JSFML properly and might require changes in the JSFML::Event intercom class (key mapping to Java enum).
For some reason, any texture created before one created a window or a context (explicitly), textures will result in white squares as if there was no context.
Fonts and render textures work fine.
A simple workaround is forcing the creation of an sf::Context
before using any load operation.
Forum discussion here: http://en.sfml-dev.org/forums/index.php?topic=10895.msg75276
As recently fixed in SFML: SFML/SFML@11837e9
I am running the Linux 64 bit version.
Tested this so far on my own and a friend's PC but on both ends we couldn't hear a thing.
Project was a clean project:
I'm using JSFML for drawing a simple L-System with Scala. I just tried increasing the size of the L-System and the JRE crashed with an access violation. Interestingly enough, it worked as long as I had it set to 4 iterations, but increasing it to anything higher than that crashes the JRE. I'm using IntelliJ as the IDE, if that helps in any way. Oh, and I'm running Windows 7 x64 with Scala 2.10.1
Log of the JRE after crashing: (hs_err_something.log) https://gist.github.com/GyrosOfWar/5680890
Source of my Scala application: https://gist.github.com/GyrosOfWar/5680942
edit After some testing, it appears to be related to the number of vertices in the VertexArray, if there are more than 1024 vertices in the VertexArray, it crashes.
Write bindings for the SFML System module, featuring the following classes:
sf::Clock
→ org.jsfml.system.Clock
sf::Time
→ org.jsfml.system.Time
sf::Vector2f
→ org.jsfml.system.Vector2f
sf::Vector2i
→ org.jsfml.system.Vector2i
Make it possible to render AWT / Swing components in a SFML RenderWindow and delegate input events to them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.