PDA

View Full Version : SFML bindings



JC_
07-06-2017, 10:18 AM
Hello,

can you please add SFML section into "Game Libraries and Components" ?

Pascal bindings:
1) PasSFML
https://github.com/CWBudde/PasSFML

2) DJMaster
https://github.com/DJMaster/csfml-fpc
http://www.djmaster.com/freepascal/bindings/sfml-csfml.php
http://www.djmaster.com/freepascal/demos/sfml-csfml.php

SFML is only framework (https://www.sfml-dev.org/faq.php#grl-whatis) but I can share my "engine".

My engine:
- based on DJMaster bindings
- 2 templates, one is for standard game and second is for editors (uses LCL components).
- structure is inspired by ZenGL, but much much lighter. Some parts are from ZenGL.
- gameloop, texture, sprite and texture atlas managers, logging, ini, basic functions for drawing sprites, primitives, text etc.,
- it's not perfect but I'm using it for my project so there will be new things + fixes

turrican
08-06-2017, 03:03 PM
Great! I'm interested on your engine. Where can I find it?

And how perfomance is? Comparable with ZenGL?

AthenaOfDelphi
09-06-2017, 06:22 AM
I'll get it sorted later :)

For anyone else that's looking to make suggestions, comments etc. we have a dedicated forum for this purpose:-

http://www.pascalgamedevelopment.com/forumdisplay.php?15-Site-News-and-Feedback

JC_
09-06-2017, 09:01 AM
Great! I'm interested on your engine. Where can I find it?

And how perfomance is? Comparable with ZenGL?

It's rather gameloop with some features :) I will post it later.

Benchmark with similar scene (maybe not entirely accurate) with VSync off:
ZenGL:
20 000 sprites = 55 FPS
30 000 sprites = 38 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

SFML:
20 000 sprites = 59 FPS
30 000 sprites = 40 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

So rendering is +- same but SFML doesn't use sprite batching.

CPU (1 Core) with 20 000 sprites:
with 5-7% CPU load (VSync on)
with 7,5 - 12,2% CPU load (VSync on) or 14 - 17% with limiter( sfRenderWindow_setFramerateLimit( Window, 60 );

Hardware: CPU Xeon 1231v3 (i7) 3.4GHz, GPU old AMD 6950

I don't know what causes bigger CPU load in SFML test. Maybe using external dll?

turrican
10-06-2017, 10:21 AM
It's rather gameloop with some features :) I will post it later.

Benchmark with similar scene (maybe not entirely accurate) with VSync off:
ZenGL:
20 000 sprites = 55 FPS
30 000 sprites = 38 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

SFML:
20 000 sprites = 59 FPS
30 000 sprites = 40 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

So rendering is +- same but SFML doesn't use sprite batching.

CPU (1 Core) with 20 000 sprites:
with 5-7% CPU load (VSync on)
with 7,5 - 12,2% CPU load (VSync on) or 14 - 17% with limiter( sfRenderWindow_setFramerateLimit( Window, 60 );

Hardware: CPU Xeon 1231v3 (i7) 3.4GHz, GPU old AMD 6950

I don't know what causes bigger CPU load in SFML test. Maybe using external dll?

Cool perfomance! Is your Wrapper multi-os-arch?

High CPU usage In most of cases is OpenGL driver implementation (FullScreen for example).