Skip to main content
gamedev.net
🔒 Locked

DirectSound multithreading

Started by Dantez 0 replies 1k views
Original Post
Dantez
Dantez
Can I call the IDirectSoundBuffer object methods from different threads? E.g. : //-------------------------- IDirectSoundBuffer *pDSBuffer; CRITICAL_SECTION CS; Thread1: EnterCriticalSection(&CS); pDSBuffer->Play(...); LeaveCriticalSection(&CS); Thread2: ... while(MsgWaitForMultipleObjects(...)) { if(...) { EnterCriticalSection(&CS); pDSBuffer->Lock(...); // Buf Write pDSBuffer->UnLock(...); LeaveCriticalSection(&CS); } } ... //-------------------------- Who knows which access problems may occur in this case?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.