• entries
    437
  • comments
    1000
  • views
    335836

Handle-based resources

Sign in to follow this  

92 views

I've never used Handle-based resources before, even though people have preached relentlessly about them in the past. Well after being inspired by the writings of Scott Bilas (of Dungeon Seige fame), I've implemented several handle-based systems into my upcoming game for the 4EC. I must admit, it took me a little while to get used to the paradigm shift of using handles instead of pointers, but now I think it's a pretty nice way of doing it - the main reason is that of encapsulation. As I'm passing handles around for things like textures, I'm not tempted to start breaking my OO-design anywhere, simply because there is *no way* of accessing the texture data outside of the TextureManager. I'm free to pass around handles everywhere and delete pointers in the texture manager without causing a problem anywhere. What's more, if a texture can't be loaded by the game, everything will work as it should - no crashes or issues other than the fact that the texture isn't displayed. It's a far cry from the past issues I've experienced, where systems become so tightly bound around the objects and I lose track of who owns what.

I've already implemented the system in another critical game system and it's working flawlessly [grin]. Suffice to say, I'm pleased with the progress so far.
Sign in to follow this  


4 Comments


Recommended Comments

Quote:
evolving by evolutional
On life, evolution, Zombies and Manta-X

Last Updated June 12, 2005 3:31:35 PM
This journal has been viewed 12,686 times.

Quote:
ACK! There's a Butterfly on my Nose!! by Mushu
The 4 Elements contest is back! Come read my rants and steal my ideas!

Last Updated June 12, 2005 9:59:54 AM
This journal has been viewed 12,908 times.

:)

Share this comment


Link to comment
Kick his ass, evolutional! C'mon, you can take him. (journalview++) [grin]

Sorry, Mushu...

Share this comment


Link to comment
[StarTrek Music] Duh Duh Duh Duh Duh Duh Duh Duh Duh Duh Duh... [/StarTrek Music]


I'm glad to see you're still at GameDev [smile].

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now