C# Class Tao.Sdl.SdlNet

Mostrar archivo Open project: WolfgangSt/axiom Class Usage Examples

Public Methods

Method Description
SDLNet_GetError ( ) : string

Get the current error string

This is the same as SDL_GetError, which returns the last error set as a string which you may use to tell the user what happened when an error status has been returned from an SDLNet_function.

Binds to C-function call in SDL_error.h: //#define SDLNet_GetError SDL_GetError

SDLNet_Linked_Version ( ) : Tao.Sdl.Sdl.SDL_version

Using this you can compare the runtime version to the version that you compiled with.

Binds to C-function call in SDL_net.h: const SDL_version * SDLNet_Linked_Version(void)

SDLNet_SetError ( string message ) : void

This is the same as SDL_SetError, which sets an SDL error message

Binds to C-function call in SDL_error.h: //#define SDLNet_SetError SDL_SetError

SDLNet_SocketReady ( IntPtr sock ) : int

See if a socket has activity

Check whether a socket has been marked as active. This function should only be used on a socket in a socket set, and that set has to have had SDLNet_CheckSockets (see SDLNet_CheckSockets) called upon it.

Binds to C-function call in SDL_net.h: //#define SDLNet_SocketReady(sock) ((sock != NULL) && ((SDLNet_GenericSocket)sock)->ready)

SDLNet_TCP_AddSocket ( SDLNet_SocketSet set, IntPtr sock ) : int

Add a socket to a socket set

Add a socket to a socket set that will be watched.

Binds to C-function call in SDL_net.h: //#define SDLNet_TCP_AddSocket(set, sock) SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)

SDLNet_TCP_DelSocket ( SDLNet_SocketSet set, IntPtr sock ) : void

Remove a socket from a socket set

Free the socket set from memory. Do not reference the set after this call, except to allocate a new one.

Binds to C-function call in SDL_net.h: //#define SDLNet_TCP_DelSocket(set, sock) SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)

SDLNet_UDP_AddSocket ( SDLNet_SocketSet set, IntPtr sock ) : int

Add a socket to a socket set

Add a socket to a socket set that will be watched.

Binds to C-function call in SDL_net.h: //#define SDLNet_UDP_AddSocket(set, sock) SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)

SDLNet_UDP_DelSocket ( SDLNet_SocketSet set, IntPtr sock ) : void

Remove a socket from a socket set

Free the socket set from memory. Do not reference the set after this call, except to allocate a new one.

Binds to C-function call in SDL_net.h: //#define SDLNet_UDP_DelSocket(set, sock) SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)

SDL_NET_VERSION ( ) : Tao.Sdl.Sdl.SDL_version

This method can be used to fill a version structure with the compile-time version of the SDL_net library.

Binds to C-function call in SDL_net.h: //#define SDL_NET_VERSION(X) { (X)->major = SDL_NET_MAJOR_VERSION; (X)->minor = SDL_NET_MINOR_VERSION; (X)->patch = SDL_NET_PATCHLEVEL; }

Private Methods

Method Description
SDLNet_AddSocket ( SDLNet_SocketSet set, SDLNet_GenericSocket sock ) : int
SDLNet_AllocPacket ( int size ) : IntPtr
SDLNet_AllocPacketV ( int howmany, int size ) : IntPtr
SDLNet_AllocSocketSet ( int maxsockets ) : SDLNet_SocketSet
SDLNet_CheckSockets ( SDLNet_SocketSet set, int timeout ) : int
SDLNet_DelSocket ( SDLNet_SocketSet set, SDLNet_GenericSocket sock ) : void
SDLNet_FreePacket ( IntPtr packet ) : IntPtr
SDLNet_FreePacketV ( IntPtr packetV ) : IntPtr
SDLNet_FreeSocketSet ( SDLNet_SocketSet set ) : void
SDLNet_Init ( ) : int
SDLNet_Linked_VersionInternal ( ) : IntPtr
SDLNet_Quit ( ) : void
SDLNet_Read16 ( IntPtr area ) : short
SDLNet_Read32 ( IntPtr area ) : int
SDLNet_ResizePacket ( IntPtr packet, int newsize ) : IntPtr
SDLNet_ResolveHost ( IPaddress &address, string host, short port ) : int
SDLNet_ResolveIP ( IPaddress &address ) : string
SDLNet_TCP_Accept ( TCPsocket server ) : IntPtr
SDLNet_TCP_Close ( IntPtr sock ) : void
SDLNet_TCP_GetPeerAddress ( TCPsocket sock ) : IntPtr
SDLNet_TCP_Open ( IPaddress &ip ) : IntPtr
SDLNet_TCP_Recv ( TCPsocket sock, IntPtr data, int maxlen ) : int
SDLNet_TCP_Send ( TCPsocket sock, IntPtr data, int len ) : int
SDLNet_UDP_Bind ( IntPtr sock, int channel, IPaddress &address ) : int
SDLNet_UDP_Close ( IntPtr sock ) : void
SDLNet_UDP_GetPeerAddress ( IntPtr sock, int channel ) : IntPtr
SDLNet_UDP_Open ( short port ) : IntPtr
SDLNet_UDP_Recv ( IntPtr sock, IntPtr packet ) : int
SDLNet_UDP_RecvV ( IntPtr sock, IntPtr packets ) : int
SDLNet_UDP_Send ( IntPtr sock, int channel, IntPtr packet ) : int
SDLNet_UDP_SendV ( IntPtr sock, IntPtr packets, int npackets ) : int
SDLNet_UDP_Unbind ( IntPtr sock, int channel ) : void
SDLNet_Write16 ( short value, IntPtr area ) : void
SDLNet_Write32 ( int value, IntPtr area ) : void

Method Details

SDLNet_GetError() public static method

Get the current error string
This is the same as SDL_GetError, which returns the last error set as a string which you may use to tell the user what happened when an error status has been returned from an SDLNet_function.

Binds to C-function call in SDL_error.h: //#define SDLNet_GetError SDL_GetError

public static SDLNet_GetError ( ) : string
return string

SDLNet_Linked_Version() public static method

Using this you can compare the runtime version to the version that you compiled with.

Binds to C-function call in SDL_net.h: const SDL_version * SDLNet_Linked_Version(void)

public static SDLNet_Linked_Version ( ) : Tao.Sdl.Sdl.SDL_version
return Tao.Sdl.Sdl.SDL_version

SDLNet_SetError() public static method

This is the same as SDL_SetError, which sets an SDL error message

Binds to C-function call in SDL_error.h: //#define SDLNet_SetError SDL_SetError

public static SDLNet_SetError ( string message ) : void
message string /// The error message to set. ///
return void

SDLNet_SocketReady() public static method

See if a socket has activity
Check whether a socket has been marked as active. This function should only be used on a socket in a socket set, and that set has to have had SDLNet_CheckSockets (see SDLNet_CheckSockets) called upon it.

Binds to C-function call in SDL_net.h: //#define SDLNet_SocketReady(sock) ((sock != NULL) && ((SDLNet_GenericSocket)sock)->ready)

public static SDLNet_SocketReady ( IntPtr sock ) : int
sock System.IntPtr /// The socket to check for activity. /// Both UDPsocket and TCPsocket can be used with this function. ///
return int

SDLNet_TCP_AddSocket() public static method

Add a socket to a socket set
Add a socket to a socket set that will be watched.

Binds to C-function call in SDL_net.h: //#define SDLNet_TCP_AddSocket(set, sock) SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)

public static SDLNet_TCP_AddSocket ( SDLNet_SocketSet set, IntPtr sock ) : int
set SDLNet_SocketSet /// The socket set to add this socket to ///
sock System.IntPtr /// The socket to add to the socket set ///
return int

SDLNet_TCP_DelSocket() public static method

Remove a socket from a socket set
Free the socket set from memory. Do not reference the set after this call, except to allocate a new one.

Binds to C-function call in SDL_net.h: //#define SDLNet_TCP_DelSocket(set, sock) SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)

public static SDLNet_TCP_DelSocket ( SDLNet_SocketSet set, IntPtr sock ) : void
set SDLNet_SocketSet /// The socket set to remove this socket from ///
sock System.IntPtr /// the socket to remove from the socket set ///
return void

SDLNet_UDP_AddSocket() public static method

Add a socket to a socket set
Add a socket to a socket set that will be watched.

Binds to C-function call in SDL_net.h: //#define SDLNet_UDP_AddSocket(set, sock) SDLNet_AddSocket(set, (SDLNet_GenericSocket)sock)

public static SDLNet_UDP_AddSocket ( SDLNet_SocketSet set, IntPtr sock ) : int
set SDLNet_SocketSet /// The socket set to add this socket to ///
sock System.IntPtr /// The socket to add to the socket set ///
return int

SDLNet_UDP_DelSocket() public static method

Remove a socket from a socket set
Free the socket set from memory. Do not reference the set after this call, except to allocate a new one.

Binds to C-function call in SDL_net.h: //#define SDLNet_UDP_DelSocket(set, sock) SDLNet_DelSocket(set, (SDLNet_GenericSocket)sock)

public static SDLNet_UDP_DelSocket ( SDLNet_SocketSet set, IntPtr sock ) : void
set SDLNet_SocketSet /// The socket set to remove this socket from ///
sock System.IntPtr /// the socket to remove from the socket set ///
return void

SDL_NET_VERSION() public static method

This method can be used to fill a version structure with the compile-time version of the SDL_net library.

Binds to C-function call in SDL_net.h: //#define SDL_NET_VERSION(X) { (X)->major = SDL_NET_MAJOR_VERSION; (X)->minor = SDL_NET_MINOR_VERSION; (X)->patch = SDL_NET_PATCHLEVEL; }

public static SDL_NET_VERSION ( ) : Tao.Sdl.Sdl.SDL_version
return Tao.Sdl.Sdl.SDL_version