Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gimp

Do I need a Listener?

This topic is 6340 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I think i need a Listener pattern but I''m not sure about how to implement it. When my video is resize a number of systems will need to recalculate some things. Like recentering \ offseting things, reloading textures etc. What I''d like to do have Clients register with the video subsystem their interest in change updates by providing a callback. Then when the video subsystem changes, it''ll call all these function pointers on these other objects that it stored and the objects callback will update the necessary details. How would this be accomplished. Should I pass raw function pointer to CVideo or should I inherit from a base class.(In which case I''d need a litte detail on how to do it) Many thanks Chris

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Sounds like the Observer pattern, p293.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!