Original Post
Hello everyone, I am using D3DXCreateTexture to create textures for a 2D Game I am writing. when the game starts for the first time I try to allocate as much memory as I can in the Default Pool to determine the memory size, and set the default settings for the game. (i.e. high, medium, or low graphics details depending on the local video memory size). Now the code is working perfectly on all my machines. but when Tested on a laptop (having this video card: Intel(R) 82852/82855 GM/GME Graphics Controller 64MB, 8MB local and the others are non local AGP memory), in the test phase it allows me to allocate up to 37MB of textures. Code for that: --------------------------------------------------------- LPDIRECT3DTEXTURE8 pTexturesArray[1024]; // test to 1 GB video memory ZeroMemory(pTexturesArray,sizeof(pTexturesArray)); DWORD dwMemSize = 0,dwVerifiedMemSize = 0; for(int iIndex = 0; iIndex < 1024; iIndex++) { HRESULT hr = D3DXCreateTexture( pD3DDevice, 512, 512, 1, 0,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT ,&pTexturesArray[iIndex]); if(hr != D3D_OK) break; D3DSURFACE_DESC d3dSurfaceDesc; pTexturesArray[iIndex]->GetLevelDesc(0,&d3dSurfaceDesc); dwMemSize += d3dSurfaceDesc.Size; } for(int i = 0; i < iIndex; i++) SafeRelease(pTexturesArray); --------------------------------------------------------- But when I run the game it fails to create the textures when I am above 18MB.(in the game I am Using Managed pool instead of Default pool, so I've added the managed pool to the test too). I even tried a code that fills those created textures while testing. and nothing changed. What do you think? anybody faced a similar problem? Thanks in advance for your help George Younes.