I have a (still) small game engine in C++ built with Visual Studio. The game engine has support for DirectX and OpenGL, but that's not really of importance. The important part is that I have some specific implementations of abstract base classes (for example, a DXKernel and an OGLKernel as subclasses of the Kernel class). So, the DXKernel and OGLKernel class have a common interface with some platform-specific code. The Kernel class does have some implementations of itself, so it's not a pure interface and these methods should be inherited by the implementations.
Now, from what I understand, it's best to take the specific implementation out of the main project and create static libraries to link the main project with, depending on the platform I'm compiling for. So, if I'm compiling for OS X, I only want to include the OpenGL implementations. If I'm compiling for Windows, I want to include both the DirectX and OpenGL implementations.
The Visual Studio layout now looks like this:
Solution
Project
Header files
Core
DX
DXKernel.h <-- DirectX implementation of abstract methods
...
OGL
OGLKernel.h <-- OpenGL implementation of abstract methods
...
Kernel.h <-- abstract class(es)
...
...
Source files
Core
DX
DXKernel.cpp
...
OGL
OGLKernel.cpp
...
Kernel.cpp
...
...
If I create a new static library project in Visual Studio, and copy over the specific files to the new library, how can I get the library project to find the common headers (so for example Kernel.h)? Should I copy over the header files of the main project to the library (this creates problems as the headers are updated)? Should I change the include path on the library project?
It seems though that this setup creates some kind of a circular dependency between the main project and the libraries, and that shouldn't be the case as far as I know.
I hope you can help me out.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)