Screwing up my desktop.
When leaving my app in fullscreen mode, bits of the desktop remain covered with whatever was there, most noticeably the start/task bar. What am I forgetting to do for this to happen?
Read about my game, project #1
John 3:16
I''ve gotten this problem before... are you running your fullscreen game at the same resolution as your desktop (e.g. game res = 1024x768, desktop res = 1024,768)?
Yeah, same as desktop resolution.
Here is my d3d init code
And this is the method to get rid of everything:
This gets called from my d3dclass'' destructor, the d3d class is deleted last thing before returning from WinMain.
Read about my game, project #1
John 3:16
Here is my d3d init code
BOOL D3DClass::InitD3D(){ // create a Direct3D device Output("Creating a D3D COM object..."); D3D = Direct3DCreate8( D3D_SDK_VERSION ); if(D3D == NULL) { Output("failed\n"); return FALSE; } Output("Succeeded\n"); NumAdapters=D3D->GetAdapterCount(); Devices=new LPDIRECT3DDEVICE8[NumAdapters]; ZeroMemory(Devices,NumAdapters*sizeof(LPDIRECT3DDEVICE8)); Adapters=new D3DADAPTER_IDENTIFIER8[NumAdapters]; Caps=new D3DCAPS8[NumAdapters]; NumModes=new UINT [NumAdapters]; DisplayModes=new D3DDISPLAYMODE *[NumAdapters]; for(unsigned i=0;i<NumAdapters;++i) { D3D->GetAdapterIdentifier(i,D3DENUM_NO_WHQL_LEVEL,&Adapters[i]); D3D->GetDeviceCaps(i,D3DDEVTYPE_HAL,&Caps[i]); NumModes[i]=D3D->GetAdapterModeCount(i); DisplayModes[i]=new D3DDISPLAYMODE[NumModes[i]]; for(unsigned j=0;j<NumModes[i];++j) D3D->EnumAdapterModes(i,j,&DisplayModes[i][j]); } return TRUE;}
And this is the method to get rid of everything:
void D3DClass::ShutD3D(){ // first, release any devices we''ve created. if(Devices != NULL) { for(UINT i=0;i<NumAdapters;++i) if(Devices[i]!=NULL) Devices[i]->Release(); delete [] Devices; Devices = NULL; // just to be safe } Output("Released the d3d device(s)\n"); // next, release the direct3d interface. if(D3D != NULL) { D3D->Release(); D3D = NULL; // just to be safe } Output("Released the d3d interface\n"); for(UINT i=0;i<NumAdapters;++i) { delete [] DisplayModes[i]; } delete [] DisplayModes; DisplayModes=NULL; delete [] NumModes; NumModes=NULL; delete [] Adapters; NumAdapters=0; Adapters=NULL;}
This gets called from my d3dclass'' destructor, the d3d class is deleted last thing before returning from WinMain.
Read about my game, project #1
John 3:16
I''m not. I have an array of pointers to all the adapters present, that list of pointers gets deallocated after releasing all the adapters.
I have Geforce 2MX. Latest drivers, DX 8.1, WinME
Read about my game, project #1
John 3:16
I have Geforce 2MX. Latest drivers, DX 8.1, WinME
Read about my game, project #1
John 3:16
Though I was never able to figure out the problem for myself, I just decided I''d not render the game at my resolution lol
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement