SDL-net's dependencies on SDL

I was briefly scanning through the code of SDL-net, and noticed that the
SDL_net.h file indicates that SDL must be initialized before using SDL-net,
because it uses utility functions from the SDL library.

I’m working on a project that will be using some older "resource challenged"
machines running Linux that aren’t capable of running X. My hope is that I
could still use SDL and SDL-net for platform-independent networking.

SDL very newbie question:

Does SDL require X, or can I compile and run SDL-based programs on machines
that don’t even have X installed? For instance, if writing a
platform-independent server without X, could I write an SDL-based program
and init SDL without video, audio, and all the other bells and whistles just
for the core functionality in order to work with SDL-net, or would I even be
able to compile it?

Mike

could I write an SDL-based program and init SDL without video, audio,
and all the other bells and whistles just for the core functionality
in order to work with SDL-net, or would I even be
able to compile it?

I’m not sure if this is possible or not, but can somebody explain to me what
the “core” functionality of SDL is when you take away audio and video? :slight_smile:
I think you may want to look for a different package, Mike.

Shawn

Well, it’s not much, but I’m presuming SDL_SwapBE32() and SDL_GetTicks() for
two.

I appreciate your response; I hope my question isn’t too annoyingly newbie.

Another reason that I post my question (as opposed to spending the effort to
try this before posting) is to get opinions like yours, on whether or not
it’s conceivable or practical. If SDL-net won’t work for this, perhaps
someone has worked with another GNU’d platform-independent networking
library that does the job? I’d prefer to stay with SDL/SDL-net if possible,
but…

Mike> -----Original Message-----

From: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org]On Behalf Of
Shawn Wheatley
Sent: Tuesday, October 23, 2001 11:42 AM
To: 'sdl at libsdl.org
Subject: RE: [SDL] SDL-net’s dependencies on SDL

could I write an SDL-based program and init SDL without
video, audio,
and all the other bells and whistles just for the core functionality
in order to work with SDL-net, or would I even be
able to compile it?

I’m not sure if this is possible or not, but can somebody
explain to me what
the “core” functionality of SDL is when you take away audio
and video? :slight_smile:
I think you may want to look for a different package, Mike.

Shawn


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

OS independend threading, networking, image manipulation, …

Yes.
It’s possible to compile SDL without X support.
For a complete listing of options do a "./configure --help"
It’s also possible to initialize standalone subsystems (audio, video, …).
Please refer to the SDL Documentation for a detailed description.

AlexOn Tuesday 23 October 2001 19:42, you wrote:

could I write an SDL-based program and init SDL without video, audio,
and all the other bells and whistles just for the core functionality
in order to work with SDL-net, or would I even be
able to compile it?

I’m not sure if this is possible or not, but can somebody explain to me
what the “core” functionality of SDL is when you take away audio and video?
:slight_smile: I think you may want to look for a different package, Mike.

could I write an SDL-based program and init SDL without video, audio,
and all the other bells and whistles just for the core functionality
in order to work with SDL-net, or would I even be
able to compile it?

I’m not sure if this is possible or not, but can somebody explain to me
what the “core” functionality of SDL is when you take away audio and
video? :slight_smile:

Well, I find the software blitting code and SDL_Surfaces very handy for
various comand line image processing tools - especially in combination
with SDL_image. (Beind able to save in all those formats would have been
great…)

Anyway, the biggest advantage is probably that you can move that kind of
code back and forth between your “design time tools” and the game
engines. For example, “Kobo Deluxe” has most of the “tools” built right
in. (Various scaling filters, alpha dynamics/level, colorkey->alpha w/
“fuzziness factor”, alpha cleaning filter etc.) If I’d want to edit the
processed result in GIMP, would it make sense to port the code to another
API?

And of course, you don’t need to learn yet another API. :slight_smile:

I think you may want to look for a different package, Mike.

Possibly - but then again, many networked games these days have a
built-in, in-process server. (Partly because of the poor multitasking of
some platforms, I guess…) Obviously, firing up the full client+server
combo on a (possibly headless) game server won’t work, so they usually
come with a dedicated server executable - which should obviously be
identical to the integrated server!

It will also need to share a great deal of stuff with the game engine;
perhaps even to the extent that the dedicated server contains a version
of the game engine, with the graphics and sound code stripped off. (At
least, that will be the case with “Kobo Deluxe” when I get around to add
network multiplayer support.)

At this point, the question is “should SDL_net be used at all”, rather
than “should SDL_net be used only in SDL applications”.

IMHO, if SDL_net is too simple, or broken, it should be fixed - not
ignored. Who wants to port networking code to various platforms with
silly non-Unix networking APIs over and over again? (Ok, hackers enjoy
different kinds of hacking - I prefer engines, API design and low level
audio processing. :slight_smile:

As to the original subject; if there’s any technical reason not to link
network-only applications with SDL, how about adding a “stand-alone
library” build target to SDL_net, dragging in what it needs from the SDL
code?

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Tuesday 23 October 2001 19:42, Shawn Wheatley wrote:

Project Twilight’s dedicated server uses SDL for timer and utility
functions. We don’t use SDL_net, but that is a possibility at some point
I guess. Granted it’s not what SDL was designed for but our clients use
it and it’s simpler than writing our own stuff for the dedicated server.On Tue, Oct 23, 2001 at 01:42:29PM -0400, Shawn Wheatley wrote:

could I write an SDL-based program and init SDL without video, audio,
and all the other bells and whistles just for the core functionality
in order to work with SDL-net, or would I even be
able to compile it?

I’m not sure if this is possible or not, but can somebody explain to me what
the “core” functionality of SDL is when you take away audio and video? :slight_smile:
I think you may want to look for a different package, Mike.


Joseph Carter Free software developer

I’m a gnus person myself. It’s an editor! It’s a floorwax!
It’s a dessert topping!

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20011023/0fa0012a/attachment.pgp

one solution could be to comment the 2 lines in ‘SDL_net.h’ :

#include “SDL/SDL.h”
#include “SDL/SDL_endian.h”

and see what are the missing definitions.
I think it helps mostly to define
Uint32
and Uint16
that you can define yourself.

Jocelyn.> ----- Original Message -----

From: mike@elecdata.com (Mike Duppong)
Newsgroups: loki.open-source.sdl
To:
Sent: Tuesday, October 23, 2001 6:26 PM
Subject: [SDL] SDL-net’s dependencies on SDL

I was briefly scanning through the code of SDL-net, and noticed that the
SDL_net.h file indicates that SDL must be initialized before using
SDL-net,
because it uses utility functions from the SDL library.

I’m working on a project that will be using some older "resource
challenged"
machines running Linux that aren’t capable of running X. My hope is that
I
could still use SDL and SDL-net for platform-independent networking.

SDL very newbie question:

Does SDL require X, or can I compile and run SDL-based programs on
machines
that don’t even have X installed? For instance, if writing a
platform-independent server without X, could I write an SDL-based program
and init SDL without video, audio, and all the other bells and whistles
just
for the core functionality in order to work with SDL-net, or would I even
be
able to compile it?

Mike