the mfc sample works fine.(also if i turn off an on my ipaq).but if i use my own created surface in the ThreadCallback() everything works until i turn off and on my ipaq, because then the "gapi" display is not in the front.
here my code:
- Code:
void CGapiThread::ThreadCallback()
{
if (m_bFirstGfxUpdate)
{
DWORD dwDispCaps;
bDirectDisplay = FALSE;
if (m_display.GetDisplayCaps(&dwDispCaps;) == GD_OK)
{
bDirectDisplay = ((dwDispCaps & GDDISPCAPS_DIRECT) == GDDISPCAPS_DIRECT);
}
dwScreenWidth = m_display.GetWidth();
dwScreenHeight = m_display.GetHeight();
m_display.SetDisplayMode(m_dwScreenOrientation);
m_display.GetBackBuffer(&m;_backbuffer);
SurfaceInit(); // Menu and titlebar blit in backbuffer
// background init
m_background.CreateSurface(0, 240,320);
m_background.FillRect(NULL, RGB(255, 255, 255), 0, NULL);
// background blit
m_backbuffer.BltFast(0, m_titlebar.GetHeight(), &m;_background, CRect(0, 0, dwScreenWidth, dwScreenHeight-m_titlebar.GetHeight()-m_menubar.GetHeight()), 0, NULL);
m_display.Flip();
m_bFirstGfxUpdate = FALSE;
}
}