Need some advice on which path to take....

Started by
5 comments, last by chadsxe 16 years, 3 months ago
First things first - VC++ 2008 Excuse me if I say some things wrong but I am not 100% sure how to verbalize it. I have been building a engine that handles input, graphics, audio, and system work that I can reuse and update as I see fit. I want to be able treat this engine as a completely seprate project then any project that actually uses it. I am not talking about on a code level (I have already figured out how I am going to tie into it) but on a project level. For example in order for me to use the engine it I have to open a project containing all the source files of the engine and then build my independent project code in the same project. Instead I would like to possibley have the engine code in one project and the independent application code in another project that knows to look in the "Engine Project". Like I said I am not sure if I am verbalizing this correct. I am pulling this from left field but would I be wrong in thinking turing my engine in .lib would be an option? Any suggestion will help... Regards Chad
Advertisement
I organize it so that the game is its own project, the engine is its own project, any game plugins or engine plugins are all their own projects. Anything I use in one distributable (the game and its engine dependencies) are organized into a solution.

In this way each game has its own copy of the engine source. If the engine is finished, you might not have it be part of the solution, and just link with a local copy of its distributables (.lib, .dll, .exe, whatever)
Again...sorry if I sound stupid

So if you have two projects under one solution is there anything I need to do to have one project be able to see the the other project. I mean in a sense of setting visual studios up.

Regards

Chad
you might need to adjust the linker options for whatever project is the exe. I don't remember.
Chad, I think I understand precisely what you are asking. If you have an engine that itself doesn’t form an executable, but is really reusable code for other programs, what you want to do is make it a library. There are two forms: static and dynamic (also called shared). So the first thing you want to do is read up on libraries (both static and dynamic) on wikipedia, google, etc., to understand the topic a bit. You might not get the details, but the concept should click in your head.
Quote:
...You might not get the details,...


There are also Walkthroughs that do provide some details:

Creating and Using a Managed Assembly (C++);

Creating and Using a Dynamic Link Library (C++);

Creating and Using a Static Library (C++);

...at your fingertips actually (i.e via your Visual Studio start page)

ala:

http://msdn2.microsoft.com/en-us/library/0x6hy671.aspx

@everyone

I think you all helped me answer my question. I have built a solution with multiple projects. The "Game Project" has to be told it is dependent on the "Engine" project. The "Engine Project" has to be told not to output an .exe but instead a static lib.

On top of that I need to learn a lot about lib's so I am off to my reading.

Regards

Chad

This topic is closed to new replies.

Advertisement