Sign in to follow this  
valla2

SDL network everywhere.. is it allowed?

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
Quote:

Q8) What are some other networking libraries that often get mentioned in the forum?
A8) Low-level "sockets portability" libraries include: Enet, HawkNL, PLib/Medusa and SDL_net.

High-level "we give you structure" libraries include: ClanLib, Net-Z/Eterna, Nevrax/NEL, OpenSkies, OpenTNL, RakNet and ReplicaNet.
Mention (or the absense of mention) of a specific library does not mean gamedev.net or the moderator endorses (or counter-endorses) that library.


I use raknet under linux, and I rather like it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this