SDL network everywhere.. is it allowed?

Started by
11 comments, last by Squirm 18 years, 10 months ago
Now i am learning how to use SDL_net for my games. Would it be good to use it everywhere, even in the cases that i don't write games? Because i don't know how to use the win32 sockets.h, is it good to use SDL_net for a program that has nothing to do with graphics and games? like...

#inlude <iostream>    // input - output
#inlcude <vector>  
#inlcude <windows.h>  // some windows functions
#include <SDL_net.h>  // for network
or is it missleading or something? oh and btw can a program written with win32 API be used in Longhorn? thx in advance
Advertisement
Well you can use SDL_net wherever you want just be aware of what dependancies it has (I'm not sure but you may be able to use it without having to use the base SDL library).

Unmanaged applications (such as ones using the Win32 API) will run just fine in Longhorn.
thank you Monder :)

i know i can do it, i am asking if it would be a good idea? Or should i learn other windows specific APIs to do my networking programming in my utility programs, and just use SDL_net in my gmaes(probalby because its cross-platfom)?
So.. if SDL_net is good and cross platform, why not use it everywhere?

thanks :)
To be honest, networking with normal Berkeley sockets/Winsock is not all that hard, and not much easier than SDL_Net really. And the benefit of learning the general way is that you're not dependent on SDL, which will be a good thing if you're writing business software or whatever.
Wait, you can't use SDL in buisness software? I thought it was LGPL, meaning it was kosher in commercial apps as long as you dynamically link. Is that not right?
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
I wasn't referring to the license, more the practicality. Generally you won't want to bundle in the SDL baggage when you're just writing a simple business app.
If you dynamically link to it you can use it in whatever you want.

What I think Kylotan meant was in something such as business software (where you will be likely to be working in a team) you'll want to use winsock for network stuff (if you need low-level networking anyway) as SDL_Net isn't exactly a widely known and used library in business applications. If you understand SDL_Net you should be able to pick up winsock without many problems anyway.

[edit]Beaten to it[/edit]
Ok, good points!
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.
ok thanks :) Are there any other cross platform alternatives to it?
Heaps. Have a look in the multiplayer and network programming FAQ here on gamedev.

This topic is closed to new replies.

Advertisement