Sign in to follow this  

Design flaw, help.

This topic is 2546 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
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

This topic is 2546 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.

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

Sign in to follow this