Microsoft DirectX 8.1 (Visual Basic)

SimplePeer

The SimplePeer sample allows players to make funny faces. Players can be either peers or the session host.

Path

Source: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\SimplePeer

Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectPlay\Bin

User's Guide

Double click the SimplePeer icon to start the application. Before you can start the game, you must select the protocol to use and enter your name. When the Create or Join Session dialog box opens, you have three choices.

Once you are connected to a session, click Make Face to make funny faces at other players.

Programming Notes

When the Make Face button is pressed, the cmdMakeFace_Click function:

  1. Fills out a byte array using 1 since this is the only message to send.
  2. Calls DirectPlay8Peer.SendTo with the buffer() parameter set to the byte array. It passes the DPNID_ALL_PLAYERS_GROUP flag in the idSend parameter so that this message goes to everyone.

When the Chat sample receives the DPNMSG_RECEIVE message, the DirectPlay8Event_Receive function gets the name of the person sending the event and updates the user interface (UI). See the DirectPlay8Event objects in the source code for more messages that the SimplePeer sample handles.