Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML Network with SDL2  (Read 4589 times)

0 Members and 1 Guest are viewing this topic.

kovacsmarcell99

  • Newbie
  • *
  • Posts: 4
    • View Profile
SFML Network with SDL2
« 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)?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
AW: SFML Network with SDL2
« Reply #1 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. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kovacsmarcell99

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML Network with SDL2
« Reply #2 on: June 19, 2014, 07:49:51 pm »
Does the SFML Network module work with Android and iOS? And if not will it?

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: SFML Network with SDL2
« Reply #3 on: June 19, 2014, 08:21:55 pm »
I think yes, it is working :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML Network with SDL2
« Reply #4 on: June 19, 2014, 09:45:53 pm »
Yes, it should work perfectly.
Laurent Gomila - SFML developer

kovacsmarcell99

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML Network with SDL2
« Reply #5 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?
« Last Edit: June 20, 2014, 10:27:08 am by kovacsmarcell99 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML Network with SDL2
« Reply #6 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?
Laurent Gomila - SFML developer

kovacsmarcell99

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML Network with SDL2
« Reply #7 on: June 20, 2014, 11:49:42 am »
I have a wierd error i use Visual C++
Error message: https://imgur.com/6dSINtG
Minimal code (Source code): 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!
« Last Edit: June 20, 2014, 12:01:42 pm by kovacsmarcell99 »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML Network with SDL2
« Reply #8 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.
Laurent Gomila - SFML developer

 

anything