Skip to main content
GameDev.net gamedev.net
🔒 Locked

Class Interactivity

Started by hammerstein_02 Aug 10, 2002 at 8:51 AM 4 replies 250+ views
Original Post
hammerstein_02
hammerstein_02
I am designing my small set of classes to wrap my directx stuff, now I know I want to create an Input class and a graphics class. And I want to create a class to manage all the things going on in the screen. But how do I make my classes interact. I kinda guess I need to pass a surface pointer to my manager class for it to draw all that needs drawing, but input I don''t quite get.. How do you guys do this? It is a stumbling point that I can''t seem to wrap my head around.. Please Please help.. Thank-you for your time. PS - Just incase is relevant, I am using DirectX7 (DirectDraw stuff)
IFooBar
IFooBar
check the directX SDK framework it is done really nicely and is good to use as ur basinc framework for now...then when u _need_ to change any functionality, make the changes.
as someone once told me (today infact)

theres really no point in reinventing teh wheel.

later
Al
[size=2]aliak.net
hammerstein_02
hammerstein_02
Thank-you for your reply, however I do want to reinvent the wheel. I don''t want to copy the SDK framework. I am starting from the ground up with the directx initialisation and stuff. I am doing this to learn and to challenge myself. Just could do with some advice on how to link the items within my programs interact. Thank-you for your time.
Waverider
Waverider
Try the component approach: You can make each main class (Graphics, Input, Resources) singletons or global objects.

That way, they can refer back and forth to each other to your heart''s content, and it won''t be hard to add new components when you need them.
It's not what you're taught, it's what you learn.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.