Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

d000hg

Screwing up my desktop.

This topic is 5898 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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)?

Share this post


Link to post
Share on other sites
Yeah, same as desktop resolution.

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!