diff --git a/dlls/d3dx9_36/Makefile.in b/dlls/d3dx9_36/Makefile.in index c094071836d..f5fa278bc9f 100644 --- a/dlls/d3dx9_36/Makefile.in +++ b/dlls/d3dx9_36/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = d3dx9_36.dll IMPORTLIB = d3dx9 -IMPORTS = d3d9 d3dx8 kernel32 +IMPORTS = d3d9 d3dx8 gdi32 kernel32 C_SRCS = \ d3dx9_36_main.c \ diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index 5d3d329f3e2..4d73e76c5f6 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -43,6 +43,8 @@ typedef struct ID3DXFontImpl /* ID3DXFont fields */ IDirect3DDevice9 *device; D3DXFONT_DESCW desc; + + HDC hdc; } ID3DXFontImpl; diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c index 1de063469ad..034ae933ad1 100644 --- a/dlls/d3dx9_36/font.c +++ b/dlls/d3dx9_36/font.c @@ -55,6 +55,7 @@ static ULONG WINAPI ID3DXFontImpl_Release(LPD3DXFONT iface) TRACE("(%p): ReleaseRef to %d\n", This, ref); if(ref==0) { + DeleteDC(This->hdc); IDirect3DDevice9_Release(This->device); HeapFree(GetProcessHeap(), 0, This); } @@ -113,8 +114,8 @@ static BOOL WINAPI ID3DXFontImpl_GetTextMetricsW(LPD3DXFONT iface, TEXTMETRICW * static HDC WINAPI ID3DXFontImpl_GetDC(LPD3DXFONT iface) { ID3DXFontImpl *This=(ID3DXFontImpl*)iface; - FIXME("(%p): stub\n", This); - return NULL; + TRACE("(%p)\n", This); + return This->hdc; } static HRESULT WINAPI ID3DXFontImpl_GetGlyphData(LPD3DXFONT iface, UINT glyph, LPDIRECT3DTEXTURE9 *texture, RECT *blackbox, POINT *cellinc) @@ -300,6 +301,12 @@ HRESULT WINAPI D3DXCreateFontIndirectW(LPDIRECT3DDEVICE9 device, CONST D3DXFONT_ object->device=device; object->desc=*desc; + object->hdc = CreateCompatibleDC(NULL); + if( !object->hdc ) { + HeapFree(GetProcessHeap(), 0, object); + return D3DXERR_INVALIDDATA; + } + IDirect3DDevice9_AddRef(device); *font=(LPD3DXFONT)object;