DirectDrawCreateEx( NULL, (void**)&pDirectDraw, IID_IDirectDraw7, NULL );
DWORD dwFlags = DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT;
pDirectDraw->SetCooperativeLevel( hWnd, dwFlags );
pDirectDraw->SetDisplayMode( Width, Height, BPP, 0, 0 );
DDSURFACEDESC2 ddsd;
memset( &ddsd, 0, sizeof(ddsd) );
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
ddsd.dwBackBufferCount = 1;
pDirectDraw->CreateSurface( &ddsd, &pFrontBuffer, NULL );
DDSCAPS2 ddsCaps;
ddsCaps.dwCaps = DDSCAPS_BACKBUFFER;
pFrontBuffer->GetAttachedSurface( &ddsCaps, &pBackBuffer );
So, why doesn''t it work?
Thanks,
Johan Ersvik
back buffer!
Hi, does anyone see what''s wrong with the following setup code.
It works fine until trying to acquire the back buffer.
What error code do you get?
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement