Jump to content
  • Advertisement
Sign in to follow this  
Anddos

IDirect3DSurface9::GetDC()

This topic is 3437 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am trying to use win32 GDI buttons on my directx device and having crash problems with getting the hdc HDC hdc; Surface9->GetDC(&hdc); << crash here , this param is HDC *hdc does anyone know the problem , its driving me crazy

Share this post


Link to post
Share on other sites
Advertisement
You can't get the dc from something that doesn't exist ;)
This method allows you to create the surface:

IDirect3DDevice9::CreateOffscreenPlainSurface
HRESULT CreateOffscreenPlainSurface(
UINT Width,
UINT Height,
D3DFORMAT Format,
D3DPOOL Pool,
IDirect3DSurface9** ppSurface,
HANDLE* pSharedHandle
);

Example (found it on google):
m_pDevice->CreateOffscreenPlainSurface(640, 480, D3DFMT_R5G6B5,D3DPOOL_SYSTEMMEM, &pSurface,NULL);

Hope it helps

Cheers

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!