Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualKhatharr

Posted 24 April 2013 - 03:05 AM

I'm not convinced that makes things easier in my case. My game is mostly GUI, so I have widgets and screens rather than entities and scenes. And having widgets draw themselves is ubiquitous in UI frameworks.

In UI frameworks the widgets draw themselves using resources that are cached or preloaded by the system. Logical objects should not have ownership over shared data. It's bad design in anything that's non-trivial.

That sounds like my option 2. Can you think of a better way to implement this then what I came up with, the big mapping? I've pondered this quite a bit, but unless I create all widgets upfront, I cannot possibly know which images are going to be required.

Then you can implement your resource manager as a cache and map resources by URI or something. It really sounds like you're making this more complicated than it needs to be. What kind of GUI needs so many distinct resources that you're afraid to pre-load all of them? You said that you're using a lot of large images to get high-res results. Are you overstepping the limitations of the system here? Have you benched this yet? How long does it take to pre-load everything?

#1Khatharr

Posted 24 April 2013 - 03:04 AM

I'm not convinced that makes things easier in my case. My game is mostly GUI, so I have widgets and screens rather than entities and scenes. And having widgets draw themselves is ubiquitous in UI frameworks.

In UI frameworks the widgets draw themselves using resources that are cached or preloaded by the system. Logical objects should not have ownership over shared data. It's bad design in anything that's non-trivial.

That sounds like my option 2. Can you think of a better way to implement this then what I came up with, the big mapping? I've pondered this quite a bit, but unless I create all widgets upfront, I cannot possibly know which images are going to be required.

Then you can implement your resource manager as a cache and map resources by URI or something. It really sounds like you're making this more complicated than it needs to be. What kind of GUI needs so many distinct resources that you're afraid to pre-load all of them? You said that you're using a lot of large images to get high-res results. Have you benched this yet? How long does it take to pre-load everything?

PARTNERS