[haiku-3rdparty-dev] Re: Issue with drawing to BBitmap

  • From: Elik Coreighn <elikcoreighn@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Sat, 10 Jul 2010 10:27:46 -0700 (PDT)

This looks like a multithreaded programming issue here. Each window
runs in its own thread. Locking a window stops everything from
happening for a bit while you do something. In this case, you're trying
to draw while a window is not locked, hence the message "debugger():
Looper must be locked" at the top of the backtrace.

When you create a BBitmap which supports adding BViews as children, it
actually creates an off-screen window to do the actual drawing. Calling
BBitmap::Lock locks this window. Call BBitmap::Lock() some time before
you add the BView and both a Sync() call and an Unlock() call (in that
order) after your Draw function and you should be OK. Best of luck!

--DarkWyrm

Fantastic! Thank you, DarkWyrm!


      

Other related posts: