Giter Site home page Giter Site logo

jsfml's People

Contributors

eliasrm87 avatar mantognini avatar pdinklag avatar rmaes4 avatar sadolit avatar t-kgd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsfml's Issues

Write tutorials

Write some basic tutorials which should cover:

  • Setting up a basic JSFML application (not specific to an IDE) with a RenderWindow
  • Loading textures, fonts and using drawables
  • Loading and using sounds and music

Complete Javadoc

Complete the Javadoc and add some usage examples for classes that might be hard to understand for newbies.

Bindings for the SFML Window module

Write bindings for the SFML Window module, featuring the following classes:

  • sf::ContextSettingsorg.jsfml.window.ContextSettings
  • sf::Eventorg.jsfml.window.event.*
  • sf::Joystickorg.jsfml.window.Joystick
  • sf::Keyboardorg.jsfml.window.Keyboard
  • sf::Mouseorg.jsfml.window.Mouse
  • sf::VideoModeorg.jsfml.window.VideoMode
  • sf::Windoworg.jsfml.window.Window

Undefined references on Linux

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

API access to JSFML and SFML version

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.

Show the FPS

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?

Implement VertexArray in Java

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)
    }
}

Bindings for the SFML Graphics module

Write bindings for the SFML Graphics module, featuring the following classes / enums:

  • sf::BlendModeorg.jsfml.graphics.BlendMode
  • sf::CircleShapeorg.jsfml.graphics.CircleShape
  • sf::Colororg.jsfml.graphics.Color
  • sf::ConvexShapeorg.jsfml.graphics.ConvexShape
  • sf::Drawableorg.jsfml.graphics.Drawable
  • sf::FloatRectorg.jsfml.graphics.FloatRect
  • sf::Fontorg.jsfml.graphics.Font
  • sf::Glyphorg.jsfml.graphics.Glyph
  • sf::Imageorg.jsfml.graphics.Image
  • sf::IntRectorg.jsfml.graphics.IntRect
  • sf::PrimitiveTypeorg.jsfml.graphics.PrimitiveType
  • sf::RectangleShapeorg.jsfml.graphics.RectangleShape
  • sf::RenderStatesorg.jsfml.graphics.RenderStates
  • sf::RenderTargetorg.jsfml.graphics.RenderTarget
  • sf::RenderTextureorg.jsfml.graphics.RenderTexture
  • sf::RenderWindoworg.jsfml.graphics.RenderWindow
  • sf::Shaderorg.jsfml.graphics.Shader
  • sf::Shapeorg.jsfml.graphics.Shape
  • sf::Spriteorg.jsfml.graphics.Sprite
  • sf::Textorg.jsfml.graphics.Text
  • sf::Textureorg.jsfml.graphics.Texture
  • sf::Transformorg.jsfml.graphics.Transform
  • sf::Transformableorg.jsfml.graphics.Transformable
  • sf::Vertexorg.jsfml.graphics.Vertex
  • sf::VertexArrayorg.jsfml.graphics.VertexArray
  • sf::Vieworg.jsfml.graphics.View

Evaluate collision safety of hash codes

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.

Bindings for the SFML Audio module

Write bindings for the SFML Audio module, featuring the following classes:

  • sf::Listenerorg.jsfml.audio.Listener
  • sf::Musicorg.jsfml.audio.Music
  • sf::Soundorg.jsfml.audio.Sound
  • sf::SoundBufferorg.jsfml.audio.SoundBuffer
  • sf::SoundBufferRecorderorg.jsfml.audio.SoundBufferRecorder
  • sf::SoundRecorderorg.jsfml.audio.SoundRecorder
  • sf::SoundSourceorg.jsfml.audio.SoundSource
  • sf::SoundStreamorg.jsfml.audio.SoundStream

Make SoundRecorder implementable

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...

Channel SFML error messages into Java exception messages

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.

Remove default font

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

Update Logo

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 example application

Write a well commented example application that shows off a good amount of features. It should include:

  • A RenderWindow with event handling
  • Primitive rendering (VertexArray, Shape)
  • Textures and Sprites
  • Fonts and Texts
  • Shaders and Transforms
  • Sounds and Music

Access Violation in Text.setString on Debian Squeeze

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.

Exception when trying to load shader

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)

Audio thread does not terminate

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.

Shader class does not load native libraries in static initializer

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.

Revisit and resolve Linux distribution issues

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.

Add methods to convert between equivalent JSFML and AWT types

Introduce conversion methods between equivalent JSFML and AWT types:

  • org.jsfml.graphics.Colorjava.awt.Color
  • org.jsfml.graphics.FloatRectjava.awt.Rectangle
  • org.jsfml.graphics.Imagejava.awt.image.BufferedImage
  • org.jsfml.graphics.IntRectjava.awt.Rectangle
  • org.jsfml.system.Vector2ijava.awt.Point
  • org.jsfml.system.Vector2fjava.awt.Point

Move to Java 7

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).

Make Window an actual class

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.

Method name error

Hi,
not so important but in the Mouse class, the method to get position is "getPoisition()"
--> getPosition()

;)

Default colors are mutable

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.

Vector3i missing

The integer version of the Vector3 is missing from the library.

Sound plays but can't hear a thing

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:

  • create a SoundBuffer and Sound object (and other necessary things)
  • load a.wav file into the SoundBuffer
  • pass the SoundBuffer to the Sound object
  • assign the .play() method to an event
  • console shows the volume is on maximum and the status goes from STOPPED to PLAYING but can't hear a thing

JRE Crash in RenderWindow.draw() with VertexArray

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.

Bindings for the SFML System module

Write bindings for the SFML System module, featuring the following classes:

  • sf::Clockorg.jsfml.system.Clock
  • sf::Timeorg.jsfml.system.Time
  • sf::Vector2forg.jsfml.system.Vector2f
  • sf::Vector2iorg.jsfml.system.Vector2i

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.