Handle-based resources

Published June 12, 2005
Advertisement
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.
Previous Entry Juggling
Next Entry Journal
0 likes 4 comments

Comments

Mushu
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.

:)
June 12, 2005 02:40 PM
evolutional
oh teh snoes
June 12, 2005 02:42 PM
JTippetts
Kick his ass, evolutional! C'mon, you can take him. (journalview++) [grin]

Sorry, Mushu...
June 12, 2005 06:50 PM
Rob Loach
[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].
June 13, 2005 06:59 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement