I don’t want network support in SDL.
I want to use the berkeley socket library. My code already has a nice,
working mechanic using the berkeley socket library. I look at the network
sample code you’ve put in one of the demos, the netlib stuff. It is a probably
convenient library built on top of berkeley sockets library. No one wants
that or needs it built into SDL.
My code, using the berkeley sockets library, compiles and works without
changes, on win32–providing I do that single mysterious
#if defined (WIN32)
and on shutdown
#if defined (WIN32)
All I’m saying is move those two single calls into SDL_Init, and add a
new flag to invoke them, SDL_INIT_NET. No compatibility issue as no one
is using that anyway. No bloat because it is just 2 routines which are
OS specific and thus should be abstracted, IE put in the library so the
code base is the same.
The reason I want this is because I don’t want to have to sprinkle lots
of #if/endif things in the code. To me those are very ugly. And the whole
point of using SDL is to avoid stuff like that. The sound, video and
user input stuff works perfectly, without knowing what OS it is running
on (ie no #if/endif’s). I just would like the network stuff to enjoy that
same beauty. And the only thing marring that is 2 simple routine calls
which can be put into the win32 DLL.
Maybe I’m not understanding it all. It seems to me to be a no-brainer–
I can’t see any downside to it.>From my email archive:
To: David Ashley
Cc: sdl at surfnetcity.com.au
Subject: Re: New documentation for SDL
From: firstname.lastname@example.org (slouken)
Date: Tue, 23 Jun 1998 18:47:16 -0700
Reply-To: sdl at surfnetcity.com.au
What of network support for SDL? I didn’t see anything about that in the
online docs. Online multiplayer games, each player on Win95, linux or BeOs,
all compatible—the idea gives me a woody :^).
Each of those operating systems support the Berkeley sockets interface.
You can write your own network support, and it will be compatible with
Just for grins, the Win95 and UNIX versions of networked Maelstrom
are compatible (though not available for general release.)
-Sam Lantinga (slouken at devolution.com)
Author of Simple DirectMedia Layer -
I’d have not been able to find out why my working berkeley sockets code
didn’t work under win32 unless I’d dug into the network example you had in
the demos. But the implication of that email is that the code would have
worked without modification. The implication of the library is that one
must learn how to program the library to do what one wants, and thus need
never bother learning the specific OS issues. In this case that isn’t true,
I had to somehow find out that the win32 version required an init library
call to unlock the berkeley sockets stuff. Then the idea of including
windows.h in my code…Ugh. Dirty! That’s not the right path.
PS I’ll put up the sdlbomber code shortly and give you a link to it. I
need to clean up a few things first.