Archived

This topic is now archived and is closed to further replies.

Remnex

Major slowdown with DirectDraw in windowed mode

Recommended Posts

I have been banging my head against the wall for the past day or so because I cannot figure out why DirectDraw slows down my system so bad that even the mouse lags. I am sure my setup for running DirectDraw in a window is correct. I create a window in normal mode, create a primary surface, then great a backsurface but as a normal surface, set a clipper to the window and then attach it to the primary surface. From there I do a simple 32bit color fill on the surface, then display it. When I do this the system eats it BIG time. Slow mouse, 100% CPU utilization. It''s a simple window in 320x240 at a color depth of 32. My desktop is in 1024x768x32. Here is the function I use to fill the surface*:
  
void Fill(int nRed, int nGreen, int nBlue )
{
  UINT = nBlue + (nGreen << 8) + (nRed << 16);

  RECT test;
  SetRect(&test,0,0,320,240);

// Blit fx

DDBLTFX ddbltfx;
memset(&ddbltfx, 0, sizeof(ddbltfx));
ddbltfx.dwSize = sizeof(ddbltfx);
ddbltfx.dwFillColor = color;

m_pBackSurface->Blt(&test, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx );
}
  
*For testing. What is weird is that regardless if I use this function or not, whenever I call the display function the system slows to a halt. The display function is simply:
  
m_pPrimarySurface->Blt(NULL, m_lpBackSurface, NULL, DDBLT_WAIT, NULL);
  
Fullscreen doesn''t seem to have any problems though. Anyone got any ideas? I can send the source to someone if the need be. ------------------------------ "I''m a decorated astronaut, I don''t make those kind of mistakes." "Oh now wait a minute. Look I''ll show ya. I''ll enter the same calculations using what we like to call ''The Right Way''." -Rem Zirem Software

Share this post


Link to post
Share on other sites