Can someone confirm a bug in GapiTools that makes it impossible to initialize a CGapiDisplay a second time after closing it in the same process?
I'm getting GDERR_PRIMARYSURFACEALREADYEXISTS.
Here's the small code snippet that shows the first time initialization of the display for the sake of getting some display caps prior to later opening the display for real:
HRESULT GapiDrawAdapter::FinalConstruct()
{
// Init
m_pSDPrimary = NULL;
// Get display caps
CGapiDisplay display;
HRESULT hr = display.OpenDisplay(::GetDesktopWindow(), 0);
if(FAILED(hr))
return hr;
CGapiSurface backbuffer;
hr = display.GetBackBuffer(&backbuffer);
if(FAILED(hr))
return hr;
GDSURFACEDESC sd;
hr = backbuffer.Lock(NULL, &sd);
if(FAILED(hr))
return hr;
backbuffer.Unlock(NULL);
m_pSDPrimary = new GDSURFACEDESC;
*m_pSDPrimary = sd;
return S_OK;
}
I'm getting GDERR_PRIMARYSURFACEALREADYEXISTS.
Here's the small code snippet that shows the first time initialization of the display for the sake of getting some display caps prior to later opening the display for real:
HRESULT GapiDrawAdapter::FinalConstruct()
{
// Init
m_pSDPrimary = NULL;
// Get display caps
CGapiDisplay display;
HRESULT hr = display.OpenDisplay(::GetDesktopWindow(), 0);
if(FAILED(hr))
return hr;
CGapiSurface backbuffer;
hr = display.GetBackBuffer(&backbuffer);
if(FAILED(hr))
return hr;
GDSURFACEDESC sd;
hr = backbuffer.Lock(NULL, &sd);
if(FAILED(hr))
return hr;
backbuffer.Unlock(NULL);
m_pSDPrimary = new GDSURFACEDESC;
*m_pSDPrimary = sd;
return S_OK;
}