Jump to content
  • Advertisement

Archived

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

Sir_Spritely

DirectX 8 Framework in OO style

This topic is 5934 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 am working through the book Real Time Rendering Tricks and Techniques in DirectX. The simple framework which is built in the book is designed in a OO approach. I am also working with the SDK docs alongside this and noticed the docs examples, CreateDevice.cpp does not use an OO approach. I have decided an OO approach is the best option however I am having trouble breaking down the SDK example into an OO style. The framework in the book does not seem the best of approaching a basic framework to me because it uses two message handlers which when looking at M.S''s way of doing this seems an odd way of going about things. I have managed to get a simple window loaded in an OO style without the two message handlers and it works fine but I''m hvaing trouble implementing the actual DX setup. Anyone know where I can get hold of 5-6 different basic frameworks so I can get a better idea of this. Pk

Share this post


Link to post
Share on other sites
Advertisement
On the subject of the two message handlers...

They could easily be one, but...

HandleMessage was meant to be overrideable by the rest of the samples. That way, you could easily encode UI types of things into your class. HandleMessage is only called from within the rendering loop, so it really only handles interactions and can be relatively streamlined.

MessageHandler (perhaps the names could have been clearer...) is not overrideable and it handles things that happen before and after the render loop (window creation, etc.). It also handles important things like clean destruction.

So, they could be lumped together, and in fact you might find that it''s preferable to lump them together, but the current setup makes it slightly easier for someone to change the interactions without affecting lower level functionality. Basically, it''s a little safer to "play with".

If you like, eliminate one of the message handlers. The performance difference should be negligible.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!