#include #include extern LPDIRECT3DDEVICE9 gpD3DDevice; /**< The Direct3D Adapter */ extern IDirect3DSurface9 *gpD3DSurface; /**< Offscreen Direct3D Surface. MPlayer renders inside it. Uses colorspace MovieSrcFmt */ void InitD3DState() { } void InitD3DViewPort(int width, int height) { } void PaintProc(HWND hWnd) { D3DLOCKED_RECT rect; IDirect3DSurface9 *pD3DBackBuf; /**< Video card's back buffer (used to display next frame) */ // rendering preamble HDC hDC; PAINTSTRUCT ps; // the actual painting code will go here hDC = BeginPaint(hWnd, &ps); if (FAILED (IDirect3DDevice9_GetBackBuffer (gpD3DDevice, 0, 0, D3DBACKBUFFER_TYPE_MONO, &(pD3DBackBuf)))) { goto out; } if (FAILED (IDirect3DSurface9_LockRect(gpD3DSurface, &rect, NULL, 0))) { goto out; } // memset for now if (FAILED (IDirect3DSurface9_UnlockRect(gpD3DSurface))) { goto out; } /* If the previous if failed, we should draw a packed frame */ if (FAILED (IDirect3DDevice9_BeginScene(gpD3DDevice))) { goto out; } if (FAILED (IDirect3DDevice9_StretchRect (gpD3DDevice, gpD3DSurface, NULL, pD3DBackBuf, NULL, D3DTEXF_LINEAR))) { goto out; } if (FAILED (IDirect3DDevice9_EndScene(gpD3DDevice))) { goto out; } if (FAILED (IDirect3DDevice9_Present (gpD3DDevice, 0, 0, 0, 0))) { goto out; } out: EndPaint(hWnd, &ps); }