Solved

if(FAILED(IDirectDrawSurface4->Blt(,,,,))), FAILS, but returns DD_OK

Posted on 2003-11-18
3
347 Views
Last Modified: 2013-12-08
int SGE_RenderFrame()
{
      DDBLTFX      ddbltfx;
      RECT      dest_rect;
      
      //Init structures
      _DDRAW_INIT_STRUCT(ddbltfx);

      ddbltfx.dwFillColor = rand()%255;
      
      int x1 = rand()%SCREEN_WIDTH;
      int x2 = rand()%SCREEN_WIDTH;
      int y1 = rand()%SCREEN_HEIGHT;
      int y2 = rand()%SCREEN_HEIGHT;

      dest_rect.left = x1;
      dest_rect.right = x2;
      dest_rect.top = y1;
      dest_rect.bottom = y2;

      if(FAILED(lpddsprimary->Blt(&dest_rect, NULL, NULL, DDBLT_WAIT |
                                                                                             DDBLT_COLORFILL,
                                                                                             &ddbltfx)))
            return(1);
      

      return(0);
}



This function fails, and i checked the return value, it seems to be equal to DD_OK.
0
Comment
Question by:cmaduro
3 Comments
 
LVL 4

Accepted Solution

by:
joachimc earned 500 total points
ID: 9837346
Are you checking with the macros provided by MS ?

You should always check the return values with
if (SUCCEDED) or if(FAILED)

Otherwise you might not get the expected result.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question