[haiku-3rdparty-dev] Screensaver resources won't load

  • From: David Rawson Couzelis <drcouzelis@xxxxxxxxx>
  • To: haiku-3rdparty-dev@xxxxxxxxxxxxx
  • Date: Fri, 28 Jan 2011 09:19:51 -0500

I'm having trouble loading an image (PNG) from the resources of a screensaver I'm writing. I can see that the resource exists by using the 'xres -l ScreenSaverName' command. This is the code I'm using to load the resource:


  fBitmap = BTranslationUtils::GetBitmap(B_PNG_FORMAT, 1);

I added code to display "Failed" when the bitmap is NULL. When I select my screensaver in the Haiku ScreenSaver preferences, the demo window shows the "Failed" message. When I test the screensaver, nothing appears. (black screen)

But, the same code works in a little example application I have. I get the feeling that screensavers aren't allowed to have and use their own resources. :/

Can screensavers have and use their own resources? How do you recommend loading a bitmap in a screensaver?

Thank you,
Dave

Other related posts: