Recent

Author Topic: [Announcement] New SFML / CSFML headers binding for FPC  (Read 8310 times)

DJMaster

  • New Member
  • *
  • Posts: 44
    • DJMaster on GitHub
[Announcement] New SFML / CSFML headers binding for FPC
« on: August 31, 2016, 08:54:53 am »
We proudly present a fresh new binding of the SFML/CSFML "Simple and Fast Multimedia Library":

https://github.com/DJMaster/csfml-fpc

Strongly tested under Windows. Linux and other OSs will be available asap.

For more info about SFML/CSFML:

http://www.sfml-dev.org/
« Last Edit: August 31, 2016, 08:57:15 am by DJMaster »

airpas

  • Full Member
  • ***
  • Posts: 179
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #1 on: August 31, 2016, 12:59:09 pm »
nice , but with your binding i've to ship 30 dll's with the exe , that is quite alot .

DJMaster

  • New Member
  • *
  • Posts: 44
    • DJMaster on GitHub
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #2 on: August 31, 2016, 08:17:27 pm »
nice , but with your binding i've to ship 30 dll's with the exe , that is quite alot .

Thank you airpas for your feedback! Really appreciated.

You can use original DLLs available from the CSFML website (http://www.sfml-dev.org/download/csfml/), currently version 2.3.

Our bindings and binaries are related to the upcoming CSFML version 2.4, which includes Geometry shaders support and latest enhancements/bugfixes (https://github.com/SFML/CSFML/issues/100).
« Last Edit: August 31, 2016, 08:23:32 pm by DJMaster »

Thaddy

  • Hero Member
  • *****
  • Posts: 16145
  • Censorship about opinions does not belong here.
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #3 on: August 31, 2016, 09:08:31 pm »
I see examples but no example sourcecode?
I have SFML installed on my raspberrypi, so I want to see if it works on the Pi too ;)
If I smell bad code it usually is bad code and that includes my own code.

DJMaster

  • New Member
  • *
  • Posts: 44
    • DJMaster on GitHub
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #4 on: August 31, 2016, 10:54:49 pm »
I see examples but no example sourcecode?
I have SFML installed on my raspberrypi, so I want to see if it works on the Pi too ;)

GitHub repository is not yet structured... stay tuned!

You can try to compile the attached Basic demo source code in the meanwhile.

Pay attention that you need CSFML installed (and you have to provide the required font file).

Paul_

  • Full Member
  • ***
  • Posts: 143
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #5 on: November 08, 2016, 01:11:25 pm »
This framework looks interesting, although use C++ libraries in Pascal is always a bit cumbersome in contrast to pure Pascal libraries like ZenGL.
Unfortunately, ZenGL development stopped before cca 2 years, no support and community is also dead. Which is a pity because code is really great, easy to use and modify.

Btw. is there any possibility to render SFML OpenGL content inside LCL Form, e.g. in TPanel?


Paul_

  • Full Member
  • ***
  • Posts: 143
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #6 on: November 09, 2016, 05:50:59 pm »
I did small benchmark (maybe not entirely accurate) and here is result.

ZenGL:
20 000 sprites = 55 FPS
30 000 sprites = 38 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

with 5-7% CPU load (VSync on)

SFML (bindings from here):
20 000 sprites = 59 FPS
30 000 sprites = 40 FPS
40 000 sprites = 30 FPS
50 000 sprites = 23 FPS

with 7,5 - 12,2% CPU load (VSync on) or 14 - 17% with limiter( sfRenderWindow_setFramerateLimit( Window, 60 );

CPU Xeon 1231v3 (i7) 3.4GHz
GPU - old AMD 6950

Code: Pascal  [Select][+][-]
  1. ZenGL:
  2. ZenGL is more little more sophisticated, there is a game loop, timers and so. But anyway you must modify it for your own need.
  3. + simple code, easy to use and modify (Pascal)
  4. + LCL integration, you can create a map editor without any problems
  5. - abandoned project
  6. - no shaders support etc.
  7. - use extern C++ libraries for file format support png, ogg, zip..

Code: Pascal  [Select][+][-]
  1. SFML:
  2. Its library with basic functions, not a game engine.
  3. + still under development, live community
  4. + can do more, sharders support
  5. - relatively easy to use, but the code is not so clear and with long syntaxes. Pascal and C++ mixing is confusing. You must know at least C++ basics because cummunity is C++

For simple games are both fine, they have similiar functions. I think with ZenGL you can finish it much faster and easier because Pascal.
For more serious project is SFML better choise, but C++ version.

DJMaster

  • New Member
  • *
  • Posts: 44
    • DJMaster on GitHub
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #7 on: November 09, 2016, 08:53:59 pm »
Thank you PaulG for your feedback. Your comparison of SFML and ZenGL is very interesting.

Take a look at the attached demos source code (resources not included) to see how to create a RenderWindow anywhere.


This framework looks interesting, although use C++ libraries in Pascal is always a bit cumbersome in contrast to pure Pascal libraries like ZenGL.
Unfortunately, ZenGL development stopped before cca 2 years, no support and community is also dead. Which is a pity because code is really great, easy to use and modify.

Btw. is there any possibility to render SFML OpenGL content inside LCL Form, e.g. in TPanel?

Paul_

  • Full Member
  • ***
  • Posts: 143
Re: [Announcement] New SFML / CSFML headers binding for FPC
« Reply #8 on: November 09, 2016, 09:14:59 pm »
Ok and thanks, I will look at it.

 

TinyPortal © 2005-2018