|
locking backbuffer when notebook gets closed |
allandy
Member #14,845
January 2013
|
I realized, that this command gives a NULL-pointer as soon as a notebook gets closed: ALLEGRO_LOCKED_REGION* ar = Just looping until a pointer is available again isn't possible. if (d3d_disp->render_target->LockRect(&d3d_bmp->locked_rect, &rect, Flags) != D3D_OK) { I need 'ar' for fast pixel draeings. Is there a solution? It's a self-compiled allegro 5.08 - maybe due to my compilation? |
Trent Gamblin
Member #261
April 2000
|
It's a directx "feature." You need to use al_d3d_set_restore|release_callback. Google for "Direct3D lost device" or similar for background.
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Isn't there a display lost or a switch out event when the notebook gets closed? If so, you can just set a flag and not draw during that period. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
allandy
Member #14,845
January 2013
|
An event-message is too critical. This also can happen between the event-request and the drawing. I have to try Trent's hint. It's my first trial with 5.x. There was never a problem using Allegro 4.2. Think it's worth to post the solution then, because this can happen to almost each program that uses Allegro 5. Will try my very best. |
Peter Wang
Member #23
April 2000
|
I fixed a couple of bugs with respect to device lost handling on the 5.1 branch. These changes are not yet in any released version. 5.1.5 will be released soon. Trent Gamblin said: It's a directx "feature." You need to use al_d3d_set_restore|release_callback. Google for "Direct3D lost device" or similar for background. Do you really need them in the common case? The documentation only mentions "d3d resources you have created yourself". AFAICS, the mechanisms in 5.0 are enough to handle device lost otherwise.
|
|