Hi!sbl,forgive me for my ignorance,I build a application with GAPIDRAW1.04.In my code,I create a surface with a 864X864 pixels 24bit colors "PNG" bitmap by its "ResourceID",and used the CGapiApplication's ProcessNextFrame BLT to backbuffer,but after I compiled and linked it with 0 error(s) and 0 warning(s) and download to Pocket PC emulator,I can not see anything on the emulator's screen,for trace it,I put the function backbuffer.FillRect(NULL,RGB(x,x,x),0,NULL) in the body of ProcessNextFrame,and it runs successfully,the color of emulator's screen changes according to "x".I want to know the probable cause,help me!
Help me!
If your BLT goes beyond the boundaries of the display, there will be no image produced. Be sure you are clipping your image to the display size correctly.
A suggestion on tracking these kind of errors down. Catch the return codes from the API call. GapiDraw has well defined error codes. I tend to use the following code to help when debugging.
FAILED is a Win32 MACRO that checks if the return value is less then 0. err = yada captures the error code from CreateSurface and stores it in err. What this does is allows you to actually watch the value of error while tracing through your program in debug mode with out lots of extra err handling code.
- Code:
HRESULT err = S_OK;
//Create Surface
if( FAILED(err = pSurface->CreateSurface( 0, ImageWidth, ImageHeight ) ) )
{
...
//Handle the error
}
FAILED is a Win32 MACRO that checks if the return value is less then 0. err = yada captures the error code from CreateSurface and stores it in err. What this does is allows you to actually watch the value of error while tracing through your program in debug mode with out lots of extra err handling code.
Thanks for your Suggestion,then I'll try to catch the error and analyze it! 