SFML community forums

General => SFML projects => Topic started by: Mj PsykOo on January 23, 2015, 04:42:45 pm

Title: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 23, 2015, 04:42:45 pm
SFML Box2D Light is a very simple library and easy-to-use, this library allows you to add cool lighting effects including shadow casting etc...
here are some pictures:
(http://s16.postimg.org/atzi33r29/bandicam_2015_01_23_15_31_53_324.jpg) (http://postimg.org/image/atzi33r29/)
(http://s17.postimg.org/udbjf7mnv/bandicam_2015_01_23_15_29_54_668.jpg) (http://postimg.org/image/udbjf7mnv/)
(http://s24.postimg.org/4jh19mald/bandicam_2015_01_23_15_36_03_305.jpg) (http://postimg.org/image/4jh19mald/)
Current Features:
- Spotlight
- Conelight
- Pointlight
- Able to change the darkness of scene
to download it please visit this link
https://github.com/MjPsykOo/SFBL
MinGW 4.9.2 static binaries have been already generated
Title: Re: SFBL (SFML Box2D Light)
Post by: select_this on January 23, 2015, 05:20:19 pm
The screenshots look pretty :-) good job.

I've noticed your repo has no license information; you might want to add some so that users know how they can use your library commercially and non-commercially.
Title: Re: SFBL (SFML Box2D Light)
Post by: eXpl0it3r on January 23, 2015, 11:07:54 pm
Split the GPL Discussion (http://en.sfml-dev.org/forums/index.php?topic=17335.0) to keep this thread focused on SFBL instead.
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 23, 2015, 11:15:40 pm
I really don't care about licenses if it was a license that says "do whatever you want with this library" then I would choose it.
if the GPL licence will coz problems then the next versions of library will be released under another license.
so could you advice me with a licence that allows you to use it as you want ?
and Thanks,
Title: Re: SFBL (SFML Box2D Light)
Post by: Ixrec on January 23, 2015, 11:21:13 pm
The zlib/png license that SFML uses (full text here: https://github.com/SFML/SFML/blob/master/license.txt) is my personal favorite. It's super-short, non-lawyers can read it, and it basically just says "don't lie about who wrote this software", which should not be a problem for anybody.

Though I've always been tempted to try the WTFPL (http://www.wtfpl.net/about/)...
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 23, 2015, 11:25:44 pm
so can i just change the license of current version of library ??
Title: Re: SFBL (SFML Box2D Light)
Post by: Ixrec on January 23, 2015, 11:30:36 pm
It's your project.  Changing the license is entirely up to you.
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 23, 2015, 11:35:16 pm
ok the license has been changed to zlib/png license. same as SFML license.
Title: Re: SFBL (SFML Box2D Light)
Post by: Hapax on January 24, 2015, 12:17:43 am
Screenshots look really nice. Good work :)

Though I've always been tempted to try the WTFPL (http://www.wtfpl.net/about/)...
L O L
Title: Re: SFBL (SFML Box2D Light)
Post by: magneonx on January 26, 2015, 04:03:43 am
This is cool. Very inspiring. I am planning to develop one as well. I will be checking on this project from time to time. Thanks for sharing!
Title: Re: SFBL (SFML Box2D Light)
Post by: Spirro on January 27, 2015, 12:44:46 am
to download it please visit this link
https://github.com/MjPsykOo/SFBL
MinGW 4.9.2 static binaries have been already generated

Nice of you to put this out for others to use.  I downloaded the source from github, but ran into a problem.  You include MinGW lib binaries and I'm unsure of the build system.  Trying to get it compiled on linux I have an issue.  Make doesn't recognise the makefile for one.  Another is that there is some hangup with Box2D(uses premake4 build system).  Premake4.3 has a bug in it that premake4.4 fixes, but it's in beta still and I was having difficulty still in compiling it's git version so I can then compile Box2D to then compile your library.....

I think you see where I'm going with this.  Any ability on your end to provide a linux version of the lib binaries, or should I keep at it(which looks like waiting on premake4 to finish 4.4 beta)?
Title: Re: SFBL (SFML Box2D Light)
Post by: dwarfman78 on January 27, 2015, 06:25:05 pm
As far as i have experimented, Box2D compilation works with CMake if you unselect examples.
Title: Re: SFBL (SFML Box2D Light)
Post by: Spirro on January 27, 2015, 07:02:20 pm
As far as i have experimented, Box2D compilation works with CMake if you unselect examples.

Cmake won't work at all for me either.  It tells me I need to add 'cmake_minimum_required(VERSION 2.8)' to the beginning of the cmakelists.txt file, but it has version 2.6 required there already and I've been unsuccessful at editing this file and my $PATH variable correctly to make adjustments.
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 27, 2015, 10:25:17 pm
to download it please visit this link
https://github.com/MjPsykOo/SFBL
MinGW 4.9.2 static binaries have been already generated

Nice of you to put this out for others to use.  I downloaded the source from github, but ran into a problem.  You include MinGW lib binaries and I'm unsure of the build system.  Trying to get it compiled on linux I have an issue.  Make doesn't recognise the makefile for one.  Another is that there is some hangup with Box2D(uses premake4 build system).  Premake4.3 has a bug in it that premake4.4 fixes, but it's in beta still and I was having difficulty still in compiling it's git version so I can then compile Box2D to then compile your library.....

I think you see where I'm going with this.  Any ability on your end to provide a linux version of the lib binaries, or should I keep at it(which looks like waiting on premake4 to finish 4.4 beta)?

I'm very sorry for not providing ready-libraries for linux, because i'm not familiar with linux.
So to solve this problem i made the project open-source to let anyone build his own version under the system that he is working on ;).
But maybe in the next versions of SFBL,I'll try my best to provide ready-libraries for The most used systems ;).
Title: Re: SFBL (SFML Box2D Light)
Post by: Spirro on January 28, 2015, 10:27:59 pm
I'm very sorry for not providing ready-libraries for linux, because i'm not familiar with linux.
So to solve this problem i made the project open-source to let anyone build his own version under the system that he is working on ;).
But maybe in the next versions of SFBL,I'll try my best to provide ready-libraries for The most used systems ;).

Well I've started working on it, but I've never compiled a library without the use of a build system that configured it to compile.  I think I'm close, but still getting an error.  Not sure if I should start a new thread, but I'll post it here for now :

Code: [Select]
/usr/bin/g++   -c  "/home/spirro/C++Work/sfbl/sfbl.cpp" -g -O0 -std=c++11 -Wall  -o ./Debug/sfbl.cpp.o -I. -I/usr/include -I/usr/local/include
/usr/bin/g++ -shared -fPIC -o ./Debug/sfbl.so @"sfbl.txt" -L. -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib  -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
/usr/bin/ld: ./Debug/sfbl.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
./Debug/sfbl.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [Debug/sfbl.so] Error 1
make[1]: Leaving directory `/home/spirro/C++Work/sfbl'

It tells me to recompile with -fPIC, but, as you can see, that -fPIC is in there.  Now whether or not it's in the right place, I'm still unsure and checking.
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 28, 2015, 11:02:44 pm

Well I've started working on it, but I've never compiled a library without the use of a build system that configured it to compile.  I think I'm close, but still getting an error.  Not sure if I should start a new thread, but I'll post it here for now :

Code: [Select]
/usr/bin/g++   -c  "/home/spirro/C++Work/sfbl/sfbl.cpp" -g -O0 -std=c++11 -Wall  -o ./Debug/sfbl.cpp.o -I. -I/usr/include -I/usr/local/include
/usr/bin/g++ -shared -fPIC -o ./Debug/sfbl.so @"sfbl.txt" -L. -L/usr/lib/x86_64-linux-gnu -L/usr/local/lib  -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
/usr/bin/ld: ./Debug/sfbl.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
./Debug/sfbl.cpp.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [Debug/sfbl.so] Error 1
make[1]: Leaving directory `/home/spirro/C++Work/sfbl'

It tells me to recompile with -fPIC, but, as you can see, that -fPIC is in there.  Now whether or not it's in the right place, I'm still unsure and checking.

try this solution:
http://stackoverflow.com/questions/9541609/using-linux-c-shared-and-static-libraries-in-a-same-program
Title: Re: SFBL (SFML Box2D Light)
Post by: Spirro on January 28, 2015, 11:31:11 pm
try this solution:
http://stackoverflow.com/questions/9541609/using-linux-c-shared-and-static-libraries-in-a-same-program

Thanks, but afaik everything is dynamic other than the precompiled libs you provide.  I'm just trying to make dynamic libs.
Title: Re: SFBL (SFML Box2D Light)
Post by: Mj PsykOo on January 29, 2015, 12:51:31 am
try this solution:
http://stackoverflow.com/questions/9541609/using-linux-c-shared-and-static-libraries-in-a-same-program

Thanks, but afaik everything is dynamic other than the precompiled libs you provide.  I'm just trying to make dynamic libs.

I think it's better to link it statically rather than dynamically for avoiding necessity of presence of compiled binary(.so).
Title: Re: SFBL (SFML Box2D Light)
Post by: Spirro on January 29, 2015, 01:37:12 am
I think it's better to link it statically rather than dynamically for avoiding necessity of presence of compiled binary(.so).

For usage under a windows environment I would agree, but to my knowledge linux differs and prefers shared libs over static libs.  I hate to keep diluting your thread for your lib with this discussion, but I think we both would like your lib to be usable by all.  Hence my initial reticence in posting my trouble compiling your lib in a linux environment here.
Title: Re: SFBL (SFML Box2D Light)
Post by: coquinounet on April 14, 2015, 11:23:32 am
Hello, i've found your awesome library and i've integrated it in my game. It's a tile based game, but it's doing weird thing like the image i've attached. Is there a way to fix it ? Thanks
Title: Re: SFBL (SFML Box2D Light)
Post by: ChronicRat on April 14, 2015, 02:01:58 pm
Hello, i've found your awful library and i've integrated it in my game. It's a tile based game, but it's doing weird thing like the image i've attached. Is there a way to fix it ? Thanks
Awful, are you sure?
Title: Re: SFBL (SFML Box2D Light)
Post by: SpeCter on April 14, 2015, 02:13:05 pm
My best guess would be that he meant in in a pretty archaic meaning(like awe-inspriring -> awesome).
Title: Re: SFBL (SFML Box2D Light)
Post by: coquinounet on April 14, 2015, 04:51:03 pm
Awful, are you sure?
Sorry, i was not sure with this word, i edited my post, i'm not english native speaker  ;D