CSFML V2

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

CSFML V2

Post by D.J.Peters »

download: csfml2.zip

Joshy

fbc test01.bas -x bin/win32/test01.exe
or
fbc test01.bas -x bin/win64/test01.exe
...

tetsted on Windows XP 32-bit, Windows 10 64-bit and Linux Ubuntu and Slackware 64-bit.
Image
Image
here are how I create the working import libraries for win32:

Code: Select all

d:\FreeBASIC\bin\win32\dlltool.exe -d csfml-audio-2.def -l libcsfml-audio-2.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d csfml-graphics-2.def -l libcsfml-graphics-2.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d csfml-network-2.def -l libcsfml-network-2.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d csfml-system-2.def -l libcsfml-system-2.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d csfml-window-2.def -l libcsfml-window-2.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d libsndfile-1.def -l liblibsndfile-1.dll.a
d:\FreeBASIC\bin\win32\dlltool.exe -d openal32.def -l libopenal32.dll.a
pause
and win64:

Code: Select all

d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d csfml-audio-2.def -l libcsfml-audio-2.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d csfml-graphics-2.def -l libcsfml-graphics-2.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d csfml-network-2.def -l libcsfml-network-2.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d csfml-system-2.def -l libcsfml-system-2.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d csfml-window-2.def -l libcsfml-window-2.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d libsndfile-1.def -l liblibsndfile-1.dll.a
d:\FreeBASIC\bin\win64\dlltool.exe  -m i386:x86-64 --as-flags --64 -d openal32.def -l libopenal32.dll.a
pause
Last edited by D.J.Peters on Oct 12, 2022 18:34, edited 7 times in total.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FB SFML V2

Post by paul doe »

D.J.Peters wrote:...
But I self never test any part of the lib's.
...
Thanks, Joshy. I already pointed the member that asked for it to this thread. If/when I find the time, I'll test that it works and report back.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FB SFML V2

Post by D.J.Peters »

By the way it's Version 2.2 the last with an C interface
Version 2.4 and higher are C++ only ! (so far I know)

I self don't need it, for me it's:
Window.bi is fbgfx.bi
Network is snc.bi
Audio.bi is fbsound.bi
Graphics.bi is fbimage.bi and fbtruetype.bi
System.bi is FreeBASIC mutex, threads and sleep
...

I let you know if it's done, first I need a cool bottle of beer :-)
It was a really warm day with a lot of work here in good old Germany.

Joshy
Last edited by D.J.Peters on May 09, 2018 0:16, edited 2 times in total.
PaulSquires
Posts: 999
Joined: Jul 14, 2005 23:41

Re: FB SFML V2

Post by PaulSquires »

D.J.Peters wrote:I let you know if it's done, first I need a cool bottle of beer :-)
It was a really warm day with a lot of work here in good old Germany.
You deserve that beer - I really appreciate all the code you share.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FB SFML V2

Post by paul doe »

D.J.Peters wrote:By the way it's Version 2.2 the last with an C interface
Version 2.4 and higher are C++ only ! (so far I know)
Nope. Check here: https://www.sfml-dev.org/download/bindings.php. It has all the bindings for all available languages.
D.J.Peters wrote: I self don't need it, for me it's:
...
Me neither, I already have my own framework to work with (and in fact, I find SFML quite limited). However, it could present a more 'sane' alternative to SDL, especially for beginners (don't need to pack a crapton of DLLs)
D.J.Peters wrote:I let you know if it's done, first I need a cool bottle of beer :-)
It was a really warm day with a lot of work here in good old Germany.
By all means, you deserve it. Prost! ;)
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: FB SFML V2

Post by badidea »

Don't drink too much beer, there are still some ";" and "void" and some other c-stuff in the bi-files.
Equal
Posts: 6
Joined: Apr 30, 2018 19:40

Re: FB SFML V2

Post by Equal »

You deserve your beer! ;-) Full ack!!!
Cheeers and Prost!

I'm a beginner with FreeBasic and with gfx coding!

@Paul Doe
and in fact, I find SFML quite limited
Why do you think so?
I thought SFML is the newest, fastest and perhaps one of the best 2D gfx-libs at the time?

Best regards and many thanx for your great work,
Equal
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: FB SFML V2

Post by lizard »

Equal wrote:I thought SFML is the newest, fastest and perhaps one of the best 2D gfx-libs at the time?
Fbgfx, Cairo, Allegro, today they are all faster than a blink of the eye. Best to use FBs own integrated fbgfx, it is very good and has a easy to understand doc.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FB SFML V2

Post by paul doe »

Equal wrote:@Paul Doe
and in fact, I find SFML quite limited
Why do you think so?
I thought SFML is the newest, fastest and perhaps one of the best 2D gfx-libs at the time?
Well, perhaps 'limited' is not really the correct term. 'Barebones' is more like it. Then again, I doubt that the authors meant it to be a complete framework for 2D graphics, only to be a lightweight alternative to the more mainstream SDL.
As for its 'newness': it's been around for some time now. Look at some of the posts that were proposed and you'll see that they are from around 2008 =D
Fastest: I didn't benchmarked it yet, so I can't really comment on this. Since it uses OpenGL, I guess it'll be pretty fast. Not that it means much, since setting an OpenGL context in FreeBasic is trivial:

Code: Select all

#include once "fbgfx.bi" '' Useful constants

'' Sets a 1280x720x32 bit OpenGL context
screenRes( 1280, 720, 32, , fb.gfx_openGL )

'' Use GL code to draw
Best: that's a matter of opinion, of course =D
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FB SFML V2

Post by D.J.Peters »

Dam I moved the wrong zip file FBSFML.zip on my server and deleted the right file csfml2.zip locale on my HDD :-(

I rewrote it complete new in 4 hours and it works :-)

Joshy
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: CSFML V2

Post by D.J.Peters »

I added a data folder with a *.ttf font, *.ogg music *.jpg image
and build test01.exe for win32 and win64 in /bin/win32/test01.exe and bin/win64/test01.exe

Image

Joshy
Last edited by D.J.Peters on Oct 12, 2022 18:34, edited 1 time in total.
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: CSFML V2

Post by paul doe »

Excellent work, Joshy. Congratulations!

Will test it soon, and see what cool thing can I come up with =D
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: CSFML V2

Post by D.J.Peters »

I added many missing libs and links for Linux 64-bit
libGLEW.so.1.10
libGLEW.so.1.13.0
libsfml-audio.so.2.2
libsfml-audio.so.2.2.0
libsfml-graphics.so.2.2
libsfml-graphics.so.2.2.0
libsfml-network.so.2.2.0
libsfml-system.so.2.2
libsfml-system.so.2.2.0
libsfml-window.so.2.2
libsfml-window.so.2.2.0


cd cfsml2
sudo cp ./bin/lin64/*.* /usr/lib/
fbc test01.bas -x ./bin/lin64
cd ./bin/lin64
./test01
Image
Last edited by D.J.Peters on Oct 12, 2022 18:34, edited 1 time in total.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FB SFML V2

Post by D.J.Peters »

paul doe wrote:Nope. Check here: https://www.sfml-dev.org/download/bindings.php. It has all the bindings for all available languages.
CSFML 2.2 was last with working binaries for MAC,Win32,Win64,Lin32,Lin64
CSFML 2.4 binaries are Windows and MAC only.

I don't support Windows only f*** ;-)

Joshy
paul doe
Moderator
Posts: 1730
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: FB SFML V2

Post by paul doe »

D.J.Peters wrote:CSFML 2.2 was last with working binaries for MAC,Win32,Win64,Lin32,Lin64
CSFML 2.4 binaries are Windows and MAC only.
You either had too much sleep deprivation, or too much beer =D

https://www.sfml-dev.org/download/sfml/2.4.2/

And, since the source is provided, you can build it for any platform you want.
Post Reply