Hi, I'm creating my first directX application
and I'm having problems blitting. I'm using ddutil.cpp that comes with directx 6.1.
Here is a part of my code:
void Game_Init(void)
{
g_pVaisseau = DDLoadBitmap(g_pDD, "vaisseau.bmp",0,0);
ShowCursor(0);
}
void Game_Main(void)
{
HRESULT hr;
RECT rectSrc, rectDest;
rectSrc.left = rectSrc.top = 0;
rectDest.left = rectSrc.top = 0;
rectSrc.right = rectSrc.bottom = 150;
rectDest.right = rectDest.bottom = 150;
hr = g_pDDS->Blt(&rectDest, g_pVaisseau, &rectSrc, DDBLT_WAIT,NULL);
while(1)
{
hr = g_pDDS->Flip(NULL, 0);
if (hr == DD_OK)
break;
if (hr = DDERR_SURFACELOST)
{
hr= g_pDDS->Restore();
if (FAILED(hr))
break;
}
if (hr != DDERR_WASSTILLDRAWING)
break;
}
}
My program start without problem, but nothing is drawn to the screen. My application quit normally when I press ESC which means the prog isn't freeze.
Know my problem?