Jump to content
  • Advertisement

Archived

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

Dirge

Constructing an Interface DLL

This topic is 5903 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 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
Advertisement
Can''t you just pull ALL the source for Graphcs, Audio,
and Input Core into the Engine.dll and build it?



Kami no Itte ga ore ni zettai naru!

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!