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

Posted on 2003-11-18
Medium Priority
Last Modified: 2013-12-08
int SGE_RenderFrame()
      DDBLTFX      ddbltfx;
      RECT      dest_rect;
      //Init structures

      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 |


This function fails, and i checked the return value, it seems to be equal to DD_OK.
Question by:cmaduro
1 Comment

Accepted Solution

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

You should always check the return values with

Otherwise you might not get the expected result.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
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…
Hi, this video explains a free download that you can incorporate into your Access databases, or use stand-alone for contact management. Contacts -- Names, Addresses, Phone Numbers, eMail Addresses, Websites, Lists, Projects, Notes, Attachments…
If you are looking for an automated tool which can generate reports for Outlook emails and other items from PST file, then you can go for Kernel PST Reporter tool. The reports which are created by this tool are helpful to analyze and understand PST …

619 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