Archived

This topic is now archived and is closed to further replies.

Dirge

Constructing an Interface DLL

Recommended Posts

I have a DLL (Static LIB) for the Graphics Core, the Audio Core, and the Input Core of a project I am woking on. I want to know how I can just make one DLL called Engine.dll that encompasses all of my core components so that instead of me having to link to Graphics.dll and Audio.dll and etc, I can just link to the engine dll. So I include the right header files in the Engine DLL project and link to the libraries I want, and I want them to all meld into my one engine dll. Is this even possible. When I try to do it I keep getting these errors: AREngine warning LNK4001: no object files specified; libraries used AREngine error LNK2001: unresolved external symbol __DllMainCRTStartup@12 AREngine fatal error LNK1120: 1 unresolved externals Can anyone give me any advice? Thanks! "Love all, trust a few. Do wrong to none." - Shakespeare Dirge - Aurelio Reis www.CodeFortress.com Current Causes: Nissan sues Nissan

Share this post


Link to post
Share on other sites
do you have a module that defines DllMain? make one and be sure to compile it for dll (check project settings).

---
Come to #directxdev IRC channel on AfterNET

Share this post


Link to post
Share on other sites
I defined DLLMain() in the header for the Engine dll (Engine.h) but with nothing in it. Nothing changed. What information would I need to put in it? Is that the problem, since the engine DLL project is pretty much empty except for engine.h and the library includes (I just wanted it to be a go between)?

I might just have it all in one file (the engine dll), but the problem is that every component is a module (a seperate class). The solution I suppose might even be to have the engine itself be a class with containted objects representing the engine components:
class CEngine
{
CGraphicsCore m_Graphics;
CAudioCore m_Audio;
};

or maybe even this
class CEngine : public CGraphicsCore, public CAudioCore
{};

The thing though is that I want every module to be created locally in the program that uses the components (so I can use another input mananager if I wanted to). I just want to avoid the hassle of having to do this:
Engine->Graphics->Renderer->ClearScreen();

It''s too much. Maybe I''ll have to though, thanks for your help so far guys.


"Love all, trust a few. Do wrong to none." - Shakespeare

Dirge - Aurelio Reis
www.CodeFortress.com
Current Causes:
Nissan sues Nissan

Share this post


Link to post
Share on other sites

    
inline bool Engine::ClearScreen()
{
return(Graphics->Render->ClearScreen());
}

//then just call this

Engine->ClearScreen();


I use something similar to this in mine. If you have to go this route, it cuts down on typing, but is definetly a messy way to do it.

[edited by - ze_jackal on July 27, 2002 8:53:11 PM]

Share this post


Link to post
Share on other sites
I did something similar (and I now I''m a freak) but I don''t like the extra overhead. You are really calling two functions right there, which sucks, especially since you have to do it every frame. So you get a little extra overhead when you have to do it for the clear, swap buffers, begin and end scene calls, among others. I''d rather avoid this.

"Love all, trust a few. Do wrong to none." - Shakespeare

Dirge - Aurelio Reis
www.CodeFortress.com
Current Causes:
Nissan sues Nissan

Share this post


Link to post
Share on other sites