Directx Complete

Directx Complete

5.0 1
by Michael D. Root
     
 
With the McGraw-Hill Companies Series, you get 100% of what you need to deliver fully functional applications fast. You get complete coverage of technical issues from experts who understand the problems you must solve. DirectX is the linchpin technology that makes computer games
and multimedia applications run seamlessly on Windows and NT
platforms. Allowing

Overview

With the McGraw-Hill Companies Series, you get 100% of what you need to deliver fully functional applications fast. You get complete coverage of technical issues from experts who understand the problems you must solve. DirectX is the linchpin technology that makes computer games
and multimedia applications run seamlessly on Windows and NT
platforms. Allowing direct access to hardware capabilities, such as sound video, it empowers programmers to spend time building jazzier applications--not fretting over differences among chip sets and device drivers. This guide delivers all the know-how you need to put the Direct X API to work. With DirectX Complete on your side, you'll be
able to: add glitch-free graphics, animation, sound, and network links to applications for Windows or NT on any hardware; Master DirectX development through step-by-step examples; apply the building blocks of DirectX--DirectDraw, DirectSound, DirectPlay, DirectInput, DirectMusic--and link them; develop your own DirectX libraries.

Product Details

ISBN-13:
9780079137807
Publisher:
McGraw-Hill Companies, The
Publication date:
01/28/1999
Pages:
635
Product dimensions:
7.36(w) x 9.17(h) x 1.82(d)

Read an Excerpt

Chapter 13: DirectPlay Overview

In this chapter, the communications aspect of DirectX is explored, along with certain other features of the Win32 API. We discuss the new features of DirectPlay 6, the DirectPlay architecture, the protocols encapsulated by DirectPlay, multithreading, event handling, lobbies, and other related topics. The chapter finishes up with a simple chat program. By the end of this chapter readers should feel comfortable enough with the above mentioned issues to add networking support to an application using the DirectPlay interface.

Why Is Using DirectPlay Desirable?

Those who are going to be writing networking code for the Windows platform, or any platform, will need to decide which protocol to use, whether to use a peer-to-peer or client/server architecture, how data will be packaged, how data will be sent and received, etc. Those who are writing a networked game might also want to provide a user-friendly interface for allowing the host player to select which protocol to use, and any required connection settings needed to begin a multiplayer game. DirectPlay facilitates this communications process by providing a standard interface to the different protocols it encapsulates. This and other benefits of using DirectPlay are fisted below:

  • There is consistent programming interface for providing networking capabilities over a range of protocols/transports-TCP/IP, IPX, Modem (TAPI), or Serial

  • All the functionality provided by DirectPlay is supported, regardless of whether the underlying network supports the functionality. Functionality is emulated by the DirectPlay object if the underlying network does not support a specificmethod.

  • There is client/server or peer-to-peer networking support

  • Creation of players and groups is supported

  • There is session management for ease of connecting to open sessions.

  • Support for secure communications

  • Lobby support provides a more user-friendly interface for launching a multiplayer application

  • Chat message support is built in.

The above list of items is only a subset of the functionality that DirectPlay provides. The following section will detail the new features in DirectPlay 6.

What Is New in DirectPlay 6

DirectPlay 6 addresses some issues especially standardization, that will continue to enhance it as the game networking API of choice. Many of the online gaming networks support DirectPlay, and integrating an application with these networks is simple using the DirectPlay API. Such online gaming networks as Heat and the Microsoft Internet Gaming Zone use the lobby support provided by DirectPlay to integrate a user-friendly interface into a multiplayer application. This integration provides an easy and efficient mechanism for one player to find others who are interested in a multiplayer game.

The new features added to DirectPlay are listed below.

  • Guaranteed messaging is supported via the DirectPlay protocol, which provides guaranteed messaging regardless of the underlying service provider. Under the previous version of DirectPlay, guaranteed messaging was only supported if the underlying service provider supported it. Use the DirectPlay protocol for messaging, even when the underlying protocol supports guaranteed messaging, to help improve the communication channel's efficiency. The DirectPlay protocol does not wait for a message acknowledgement before sending the next message. Messages can be prioritized as well, and dynamic reporting of network latency is provided.

  • Asynchronous messaging is supported to help minimize the delay experienced in work with guaranteed service providers. The application's receive message queue is notified as to the success or failure of a particular message. It is also possible to cancel a message that has been sent asynchronously.

  • Message throttling is provided to help prevent sending out more messages than what the underlying network is supporting. Both the send and receive queues can be checked to see how the application is responding across different types of network connections. During the course of an application, it is possible periodically to check the send queue to see if messages are backing up, and if so, throttle back the number of messages being sent out. In theory this sounds simple, but in practice it may prove to be a hair-pulling experience. Message throttling is dependent on the application's complexity, structure, and network requirements.

  • Firewall support for the TCP/IP protocol is provided. By using a range of pre-defined ports, DirectPlay makes the firewall support transparent to the developer and end-user, requiring only that the network administrator open up these ports in the firewall. The trick is getting the network administrator to agree to open the ports. The end-user may have to specify certain settings via the control panel.

  • Improved lobby support for detecting when the host of a session has migrated allows for new players to join a session already in progress. Rerouting of lobby messages by an external lobby client is no longer required, and the Connect: function has a timeout of one minute.

  • Security has been extended to peer-to-peer network sessions, and secure messages can now be sent to groups.

  • Lobby application registration has been moved from the setup portion of DirectX into the DirectPlay interface.

  • There is improved localization support for applications that may end up being run on machines using multibyte strings instead of single-byte strings.

  • Improved keep-alive support allows the service provider to notify DirectPlay that a player or session has been lost, so the application can take appropriate action.

  • Service providers can specify that they are private, thereby preventing them from being viewed. These providers are only accessible if their GUID is known.

  • There is a wait mode for DirectPlay applications. Instead of the lobby's launching a new instance of the application, it can send the connection settings to a waiting instance of the application. . . .

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >

Directx Complete 5 out of 5 based on 0 ratings. 1 reviews.
Guest More than 1 year ago
A GREAT book to help you learn DirectX. When I first started DirectX it seemed to be one of the most complex programming things I'd ever engaged; mainly because I was moving up from DOS to win32 at the same time. This book goes through each component of DirectX individually and covers how easy it is to use. Now I'm actually writing tutorials on DirectX. I'm not sure of any other literary pieces that teach direcx quite this well, but you definitely should use the directx.chm that comes with the DirectX 7.0a SDK.