Weekly changes report:
- sf::Window is fully implemented (all events implemented)
- sf::Drawable implemented
- sf::Shape implemented
- sf::RenderWindow in progress (40%)
In next few days I will finish work on sf::RenderWindow and I will start working on sf::Image and sf::Sprite classes.
Sample code:
import SFML.System.*;
import SFML.Window.*;
import SFML.Graphics.*;
public class jSFML
{
static
{
System.loadLibrary("jSFML");
}
public static void main(String[] args)
{
RenderWindow wnd = new RenderWindow(new VideoMode(800, 600), "jSFML", Style.Close|Style.Resize|Style.Titlebar, new ContextSettings());
Shape shape = Shape.CreateCircle(new Vector2f(400, 300), 250, new Color(255,0,0), 8, new Color(0, 255, 0));
Color background = new Color(0, 0, 0);
while(wnd.isOpened())
{
Event event = new Event();
while(wnd.getEvent(event))
{
if( (event.type == EventType.KeyPressed && event.key.code == KeyCode.Escape) || (event.type == EventType.Closed) )
wnd.close();
else if (event.type == EventType.KeyPressed && event.key.code == KeyCode.Space)
System.out.println("fps: " + 1/wnd.getFrameTime());
}
if( wnd.getInput().isKeyDown(KeyCode.Return) )
{
background.r = Randomizer.randomI(0, 255);
background.g = Randomizer.randomI(0, 255);
background.b = Randomizer.randomI(0, 255);
}
wnd.clear(background);
wnd.draw(shape);
wnd.display();
}
}
}