C
Colin Goudie
Hi,
I'm hacking around coding a 3D Engine and I'm stumped with a concept.
Currently my engine is in a dll and it contains interfaces such as
IRenderSystem, IRenderDriver etc.. that are extended by other dll's
depending on the Rendering API. (Such as OpenGL or Directx)
The engine has main classes such as HoogeEngine, LogManager etc.. that are
used by client code to operate the engine.
The client app is in an .exe. It basically statically links the dll by
linking to the Hooge.lib file and then instantates the engine like this
//Create the engine
Hooge::HoogeEngine engine;
//Create the test task
TestApplicationTask task;
engine.registerApplicationTask(task);
engine.go();
And we are away. This is all working perfectly. HOWEVER, I now would like to
change the structure so that the Engine is an .exe and the game is just
another plugin such as the rendering dll's. However, I now have issues with
incorrect dll usage and all the __desclspec(dllexport) __declspec(dllimport)
associated with my interfaces.
At the moment, the Interfaces in the engine and most of all the classes in
the engine including the engine class itself (HoogeEngine), are prefixed
with HOOGE_API which
is defined as __declspec(dllexport) in the Hooge.dll, but defined as
__declspec(dllimport) if included in the client app (.exe) or the rendering
dll's (.dll's).
I can see why as my engine is a dll and it needs to export stuff out, which
is imported into the exe!
What do I need to change though to change the engine to an .exe?? and the
client app to a dll??
Do I remove all the HOOGE_API prefixes off the engine classes as they are
now in the .exe? How does the dll's such as the rendering API's and the
Application dll extend from the
interfaces defined in the exe??
I'm lost
Thanks
I'm hacking around coding a 3D Engine and I'm stumped with a concept.
Currently my engine is in a dll and it contains interfaces such as
IRenderSystem, IRenderDriver etc.. that are extended by other dll's
depending on the Rendering API. (Such as OpenGL or Directx)
The engine has main classes such as HoogeEngine, LogManager etc.. that are
used by client code to operate the engine.
The client app is in an .exe. It basically statically links the dll by
linking to the Hooge.lib file and then instantates the engine like this
//Create the engine
Hooge::HoogeEngine engine;
//Create the test task
TestApplicationTask task;
engine.registerApplicationTask(task);
engine.go();
And we are away. This is all working perfectly. HOWEVER, I now would like to
change the structure so that the Engine is an .exe and the game is just
another plugin such as the rendering dll's. However, I now have issues with
incorrect dll usage and all the __desclspec(dllexport) __declspec(dllimport)
associated with my interfaces.
At the moment, the Interfaces in the engine and most of all the classes in
the engine including the engine class itself (HoogeEngine), are prefixed
with HOOGE_API which
is defined as __declspec(dllexport) in the Hooge.dll, but defined as
__declspec(dllimport) if included in the client app (.exe) or the rendering
dll's (.dll's).
I can see why as my engine is a dll and it needs to export stuff out, which
is imported into the exe!
What do I need to change though to change the engine to an .exe?? and the
client app to a dll??
Do I remove all the HOOGE_API prefixes off the engine classes as they are
now in the .exe? How does the dll's such as the rendering API's and the
Application dll extend from the
interfaces defined in the exe??
I'm lost
Thanks