lost device again

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

Can you provide a test case?

Also, use proper code tags.



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.

Thread #612164. Printed from Allegro.cc