[SDL] Net2: question

Roman Kyrylych roman.kyrylych at gmail.com
Fri Sep 8 01:27:40 PDT 2006


Hi!

2006/9/8, Vassilis Virvilis <vasvir at iit.demokritos.gr>:
> Halo,
>
> I am investigating SDL_Net and I am using the
> excellent Net2 library by Bob Pendleton. Note that
> Net2 is a thin layer around SDL_net and does not perform
> any swaping.
>
> But I think it should do.
>
> The problem:
> ------------
> I am calling
> NET2_UDPAcceptOn(int port) which calls
> SDLNet_UDP_Open(int port)
> which accepts native byte order integer. So far so good.
>
> Now when I am receiving UDP packets on this port, the
> source port number is swapped. OK. let's just accept
> that. This is the network.
>
> Now when I am trying to send using
>
> NET2_UDPSend(IPaddress *ip, char *buf, int len) which calls
> SDLNet_UDP_Send(requires UDPpacket)
> the ip->port member must be jammed again -- unlike the other uses
> of IPaddresses
>
> I believe since NET2_UDPSend requires an IPaddress it should
> be noted with __very__ big letters in the documentation.
> Or
> better hide the swap inside NET2_UDPSend and during the receipt
> of the UDPpacket.

BTW, will SDL_net be improved in SDL 1.3?

-- 
Roman Kyrylych (Роман Кирилич)


More information about the SDL mailing list