Original Post
I am attempting to make a bitmap show on top of another game. Here is the code I am using but all it does is crash the game.
if(Menu) {
LPDIRECT3DSURFACE8 g_pBackSurface = 0;
LPDIRECT3DSURFACE8 g_pD3DBitmapSurf = 0;
f_pDirect3DDevice->CreateImageSurface( 128, 128, D3DFMT_X8R8G8B8, &g_pD3DBitmapSurf );
D3DXLoadSurfaceFromFile( g_pD3DBitmapSurf, NULL, NULL, "Pic.bmp", NULL, D3DX_FILTER_NONE, 0, NULL );
RECT D3DSrcRect = { 0, 0, 128, 128 };
POINT D3DDestPoint = { rand() % (g_DeviceWidth - 128), rand() % (g_DeviceHeight - 128 ) };
pD3DDevice->CopyRects( g_pD3DBitmapSurf, &D3DSrcRect, 1, g_pBackSurface, &D3DDestPoint );
}
Any ideas on what I am doing wrong?