Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » lost device again

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

I have to continue this problem:
https://www.allegro.cc/forums/thread/611811/974446#target

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:

#SelectExpand
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:

#SelectExpand
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.

allandy
Member #14,845
January 2013

http://www.akluwi.de/al/al_lcktest.zip

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: