PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

gapidraw from dll

HI!
Perhaps anybody can help me...
i´m using evc4.0 and gapidraw 2.04
i wrote an gapidraw application that works really fine. Now i want to display a bmp or something else on the screen (built with gapidraw)from a dll. But i cannot see anything
Code:

CGapisurface m_backbuffer;
CGapiDislay m_display;
m_backbuffer.FillRect(NULL, RGB(255, 255, 255), GDFILLRECT_OPACITY, &rectfx;);
m_display.GetBackBuffer(&m;_backbuffer);

Thanks for your tips
yours Nike
I believe all support for 2.04 ended upon the release of GapiDraw 3, but I might be able to help you out here. Looking at the code snippet you supplied, you have some errors right off the bat:

Code:

CGapisurface m_backbuffer;
CGapiDislay m_display;
m_backbuffer.FillRect(NULL, RGB(255, 255, 255), GDFILLRECT_OPACITY, &rectfx;);
m_display.GetBackBuffer(&m;_backbuffer);


should be:

Code:

HRESULT hr;
CGapisurface m_backbuffer;
CGapiDisplay m_display;
hr = m_display.GetBackBuffer(&m;_backbuffer); if(FAILED(hr)) return hr;
hr = m_backbuffer.FillRect(NULL, RGB(255, 255, 255), GDFILLRECT_OPACITY, &rectfx;); if(FAILED(hr)) return hr;


... because you were not acquiring the backbuffer before using it. You wouldn't have seen anything happen in that case. You would have found this problem easily if you had been checking your return values. This is all dependant on how you have setup the rectfx structure as well.

Please, beginners and advanced users alike, always check the return values! :)
HI!

thank you very much for your help!
I will try it asap!

Thanks a lot
Yours Nike

p.s. i recognized my fault with the help of debugging but i could not solve the problem...