How does OpenAL wrap Directsound (sometimes) without requiring HWND?

Started by
3 comments, last by billybob 20 years, 1 month ago
I have a pluggable system in my game where different APIs can be used to get things done. anyways, when I create an AL device with direct sound, it works, without requiring an HWND. but, when I try to write a directsound plugin, I have to get the HWND from somewhere. I thought of a possible hack around it, by passing GetDesktopWindow() to SetCooperativeLevel, and then using STICKYFOCUS for ALL my buffers, but like I said this seems very shitty. although, this does seem like what openAL does, as the sound behavior is the same... any ideas? [edited by - billybob on March 26, 2004 7:46:35 AM]
Advertisement
Well, there''s GetForegroundWindow in the WinAPI.

Regards,
VizOne
Andre Loker | Personal blog on .NET
I don''t even have my window created yet when I initialize openAL, so its doing something else.
Perhaps it creates its own hidden window and uses that. Just a guess though.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
Don''t forget that OpenAL comes with source code...


Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!

This topic is closed to new replies.

Advertisement