PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

GDERR_PRIMARYSURFACEALREADYEXISTS

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 reported this problem both in the forum and directly to the author several days ago.

On the second time you try to initialize the display, GapiDraw returns with the error you mentionned.

Tested on iPaq 3850.

I'm glad I wasn't hallucinating. GapiDraw is great, and I hope this can be fixed soon.

Eric Fortier
Tech Logic, Inc.
This is fixed in GD1.02. Thanks for the feedback!

/Johan
sbl wrote:
This is fixed in GD1.02. Thanks for the feedback!

/Johan


Thanks for the info.
What a great product!!