?/TD>
Microsoft DirectX 9.0

IDirect3DSurface9::GetDC Method


Retrieves a device context.

Syntax

HRESULT GetDC(      

    HDC* phdc );

Parameters

phdc
[out] Pointer to the device context for the surface.

Return Value

If the method succeeds, the return value is D3D_OK.

D3DERR_INVALIDCALL is returned if the argument is invalid.



Remarks

The following restrictions apply.

When a device context is outstanding on a surface, the application may not call these methods:

IDirect3DCubeTexture9IDirect3DCubeTexture9::LockRect
IDirect3DDevice9IDirect3DDevice9::ColorFill
IDirect3DDevice9::StretchRect
IDirect3DDevice9::UpdateSurface
IDirect3DDevice9::UpdateTexture
IDirect3DSurface9IDirect3DSurface9::LockRect
IDirect3DSwapChain9IDirect3DSwapChain9::Present *
IDirect3DTexture9IDirect3DTexture9::LockRect

* (on a swap chain that contains the surface)

IDirect3DSurface9::GetDC causes an implicit lock; do not retain the device context for later use. Call IDirect3DSurface9::ReleaseDC to release it.

It is valid to call IDirect3DSurface9::GetDC/IDirect3DSurface9::ReleaseDC on levels of a mipmap or cubemap, however, these calls will be slow to all miplevels except the topmost level, and GDI operations to these miplevels will not be accelerated.

The handle to a device context (HDC) provides access to Microsoft Win32?and GDI functionality.

See Also

IDirect3DSurface9::ReleaseDC, D3DUSAGE, D3DPOOL, D3DPRESENT_PARAMETERS


© 2002 Microsoft Corporation. All rights reserved.