Discussion:
Direct3D and Directplay in a single Thread
(too old to reply)
Philip Taylor [ATI]
22 years ago
Permalink
look at the DPlay Maze sample, it mixes D3D and DPlay.
Hi.
The program I'm working on uses Direct3D for its display and some other
libs
that needs to be compiled with the single thread flags in visual studio
.NET
2003 (/MLd /ML)
Everything worked fine until I added network code with DirectPlay. As soon
as I intanciate a IDirectplay8Server my dilplay goes completely mad...
everything is messed up.
Is it a problem with threads?
Com interfaces maybe?
Any hint would be very appreciated.
Tony Cox [MS]
22 years ago
Permalink
The program I'm working on uses Direct3D for its display and some other
libs
that needs to be compiled with the single thread flags in visual studio
.NET
2003 (/MLd /ML)
Everything worked fine until I added network code with DirectPlay. As soon
as I intanciate a IDirectplay8Server my dilplay goes completely mad...
everything is messed up.
Is it a problem with threads?
Com interfaces maybe?
DirectPlay is intrinsically a multi-threaded API. You'll get called back on
DirectPlay's thread pool, and you really want to compile your application
with the multithreaded flags.

As Phil mentioned, the Maze sample in the SDK (written by yours truly) shows
using Direct3D and DirectPlay in the same application, and shows you how to
handle the DirectPlay callbacks in a threadsafe fashion.

Tony Cox - Lead Engineer
Microsoft Games Studios - Sports
Philippe Desgranges
22 years ago
Permalink
Hi... After a long struggle I managed to get all my libs to compile with the
MT (or MTd) flags. Now everything is multithreadded thoug my problem still
persist.

As soon as I run IDirectPlay8Server::host everything refuses to render... or
should I say... to load correctly because if I run host after loading my 3D
world structure (which is not what I want) everything performs fine.
It is as if Directplay was perturbating everything... though my handler just
returns S_OK so it can't come from a shared memory problem.

I read the Maze sample but couldn't find a clue to my problem that seems
mystical.
I really need a hand on this...

Thanks for your help.

--
Philippe Desgranges aka Tsunami
3ie Team Member www.3ie.org
...
Sean White[MS]
22 years ago
Permalink
One other option that you could try in DirectPlay 9 is the
IDirectPlay8ThreadPool. This allows you to define a number of threads that
DirectPlay may create, including 0 to run on the same thread as your game
engine. This way, your game is in total control of the resources which are
consumed by DirectPlay.
--
Sean White[MS]-
Program Manager
DirectPlay/DirectInput
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi.
The program I'm working on uses Direct3D for its display and some other
libs
that needs to be compiled with the single thread flags in visual studio
.NET
2003 (/MLd /ML)
Everything worked fine until I added network code with DirectPlay. As soon
as I intanciate a IDirectplay8Server my dilplay goes completely mad...
everything is messed up.
Is it a problem with threads?
Com interfaces maybe?
Any hint would be very appreciated.
Loading...