SFML community forums

General => General discussions => Topic started by: kovacsmarcell99 on June 19, 2014, 06:29:39 pm

Title: SFML Network with SDL2
Post by: kovacsmarcell99 on June 19, 2014, 06:29:39 pm
I have a program using SDL2, SDL2_ttf, SDL2_image and SDL2_mixer!
I thought about using SDL_net for networking but i saw the networking module of SFML and the packet system for TCP and i would like to use ONLY the Network module of SFML from the SFML library.

Is that possible?

Is there a Packet system for SDL_net (the offical hasn't got one)?
Title: AW: SFML Network with SDL2
Post by: eXpl0it3r on June 19, 2014, 06:33:17 pm
Yes, you need to link against the network and system module though.

SDL has its own forum, might want to ask your SDL questions there. ;)
Title: Re: SFML Network with SDL2
Post by: kovacsmarcell99 on June 19, 2014, 07:49:51 pm
Does the SFML Network module work with Android and iOS? And if not will it?
Title: Re: SFML Network with SDL2
Post by: Grimshaw on June 19, 2014, 08:21:55 pm
I think yes, it is working :)
Title: Re: SFML Network with SDL2
Post by: Laurent on June 19, 2014, 09:45:53 pm
Yes, it should work perfectly.
Title: Re: SFML Network with SDL2
Post by: kovacsmarcell99 on June 20, 2014, 10:23:09 am
Is there a planned support of IPv6?
Can i dynamic link SDL2 and static link SFML at the same time?
Title: Re: SFML Network with SDL2
Post by: Laurent on June 20, 2014, 10:28:05 am
Quote
Is there a planned support of IPv6?
Yes, but not for a near future.

Quote
Can i dynamic link SDL2 and static link SFML at the same time?
Why not?
Title: Re: SFML Network with SDL2
Post by: kovacsmarcell99 on June 20, 2014, 11:49:42 am
I have a wierd error i use Visual C++
Error message: https://imgur.com/6dSINtG (https://imgur.com/6dSINtG)
Minimal code (Source code): http://pastebin.com/mtKJewx7 (http://pastebin.com/mtKJewx7)

I get the error then i recive large strings like ~150 characters or more!
The problem can be solved by adding a text.reserve(1) so if the error is not my fault a text.reserve(1) should be added to the recive(Packet& packet) function!

Please check the source!

I tested it on Linux and it works properly it's a Visual C++ problem!
Title: Re: SFML Network with SDL2
Post by: Laurent on June 20, 2014, 02:38:10 pm
Make sure you don't mix debug and release, or different IDE / library versions.

You should post the complete call stack, so that we know what caused this error.