Jump to content
  • Advertisement
Sign in to follow this  
Jeremy6996

Design flaw, help.

This topic is 2854 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 may have made a really big mistake in my game engines design and I need a bit of help fixing it. Here's my situation:

What I've done is wrapped XNA in a module called "GraphicsAPI" which would, simply put, wrap the api incase I later decided to switch to OpenGl, DirectX, etc... Overtop of that module I have my graphics engine which provided a child-parent node way of organizing graphics, it also manages loading of graphics models and a couple other functions. All my modules share a math library (Wrapper for that provided by XNA), so that no conversions need to take place when the graphics module needs to send, ie, a vector over to the game engine.

So as it stands, my game engine module does not have any knowledge or access to any XNA components and is using the common math library for vectors and matrices. The problem comes in when:

Most C# physics engines are dependent on XNA, it would be really messy to have the game engine use the XNA framework and continuously convert my Math library vectors to XNA vectors.

I'm thinking maybe I can have the physics engine work closely with the graphics api wrapper, but that too sounds like a pretty messy idea.

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Jeremy6996
Most C# physics engines are dependent on XNA, it would be really messy to have the game engine use the XNA framework and continuously convert my Math library vectors to XNA vectors.

Why is it messy? This is precisely what the adapter pattern is for. Can you post an example of said messiness?

Do not couple the physics and graphics engines as you mention, it really is a bad idea.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!