- Online Community Forums » Allegro Development » lost device again

This thread is locked; no one can reply to it. rss feed Print
lost device again
Member #14,845
January 2013

I have to continue this problem:

I haven't looked yet into the 5.1.5-branch, but tested Allegro 5.0.9 with my
problem. So, for your information:

With Allegro 5.0.9 a combination like this handles the problem in most cases:

1 ALLEGRO_LOCKED_REGION* ar; 2 3 while (al_is_d3d_device_lost(al5_display)); 4 5 ar = al_lock_bitmap(al_get_backbuffer(al5_display), ALLEGRO_PIXEL_FORMAT_ANY, 0);

...but there is still a little timing glitch that may slip through to:

1 ALLEGRO_DISPLAY_D3D *d3d_disp = (ALLEGRO_DISPLAY_D3D *)bitmap->display; 2 if (d3d_disp->render_target->LockRect(&d3d_bmp->locked_rect, &rect, Flags) != D3D_OK) { 3 ALLEGRO_ERROR("LockRect failed in d3d_lock_region.\n"); 4 5line 769 in d3d_bmp.cpp

and throws an exception.

Peter Wang
Member #23
April 2000

Can you provide a test case?

Also, use proper code tags.

Member #14,845
January 2013

This is even more mysterious.
The device exists until the routine 'stretchblit' is reached - then it's lost...
It's cutted and reduced from the original program which uses to run fine.
I'm really confused at the moment.

Go to: