directx in console?

Started by
4 comments, last by Oluseyi 18 years, 6 months ago
hi! is it possible to write a directx-app for the console? i only need direct sound. thx, dave
Advertisement
It should be possible to use DirectSound in a console application.
the problem is that I need HWND to set Cooperative Level.
how do i get this from my console app or can i skip it?

if(FAILED(DirectSoundCreate8(NULL, &g_pDSound, NULL))) return false;
g_pDSound->SetCooperativeLevel(hWnd, DSSCL_PRIORITY);
Quote:Original post by davethebrave
the problem is that I need HWND to set Cooperative Level.
how do i get this from my console app or can i skip it?

if(FAILED(DirectSoundCreate8(NULL, &g_pDSound, NULL))) return false;
g_pDSound->SetCooperativeLevel(hWnd, DSSCL_PRIORITY);

You can always create a window, but just not show it. This will give you an HWND, but the window still won't appear. I do this for D3D console applications where I am only processing data using the GPU.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
thx for your help
dave
Quote:Original post by davethebrave
the problem is that I need HWND to set Cooperative Level.
how do i get this from my console app or can i skip it?

GetConsoleWindow.

This topic is closed to new replies.

Advertisement