Hi, my (PocketPC) app normally used GAPI but I'm now moving it to DirectX to support WM6. (My app is written in VC++) I have a question:
If I wish to clear the screen and draw stuff to it. If I call the below Render function in the OnPaint() function of my dialog everything is fine and dandy:
LPDIRECT3DMOBILEDEVICE g_pd3dmDevice = NULL; // My rendering device
VOID Render()
{
if( NULL == g_pd3dmDevice )
return;
// Clear the backbuffer to a blue color
g_pd3dmDevice->Clear( 0, NULL, D3DMCLEAR_TARGET, D3DMCOLOR_XRGB(0,0,255), 1.0f, 0 );
// Begin the scene
if( SUCCEEDED( g_pd3dmDevice->BeginScene() ) )
{
// do stuff here blah blah
// End the scene
g_pd3dmDevice->EndScene();
}
// Present the backbuffer contents to the display
g_pd3dmDevice->Present( NULL, NULL, NULL, NULL );
}
But the problem I'm having is that I have a class that I normally make full screen and then draw stuff in it, like so:
m_pFullScreen = new CFullView();
m_pFullScreen ->CreateEx(
WS_EX_TOPMOST,
AfxRegisterWndClass(
CS_HREDRAW | CS_VREDRAW,
0,
(HBRUSH)COLOR_WINDOW),
_T("Full View"),
WS_VISIBLE | WS_POPUP,
0,0,
GetSystemMetrics(SM_CXSCREEN),
GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL);
Then I had a function in this class called UpdateDisplay() which used to use GXBeginDraw() etc to draw to screen but now I wish to use the code above in the Render function. It does not work (Nothing is drawn to the screen).
If the Render function is called from OnPaint then it works but if there is not an OnPaint() function(Which my CFullScreen class does not have as it is not a dialog) then it does not work
Does anyone know how to solve my problem
Thanks
Harry