Advertisement

Engine DLL Design

Started by April 27, 2001 10:05 AM
15 comments, last by Punika 23 years, 9 months ago
Hi, For a while ago I thought that it could be cool to program my little 3d engine. I thought that many big Projects using dlls for it. So I began to write one for it. A few weeks later it works just fine with some functions like Initializing Stuff. How great it was. Then I thought I could implement functions like Drawing my world over it. Then I got my first problems. How I could implement it ? There were some problems that I had. 1. How could I implement support for Classes which each of the Projects could use? The DLL and the Game must have access to it. 2. Many linking problems because of Classes which need to be shared between them. 3. VC++ Settings, for example the projects, if I am using two Projects I also need to implement much of the DLL files. If not I will become linking errors. So, this is a little part of my problems that I got. At the Moment I am starting a second try with DLLs. Now, my question is, are there any good Information on the net to solve some of the problems ? Or has somebody found some good tricks or has made his own Engine using dlls ? Thanks Lutz Hören P.S. Sorry for my bad English...you know what I mean Edited by - Punika on April 27, 2001 12:10:08 PM
Punika
It seems it`s not my day. Somebody who don`t know what I mean ?

Punika
Advertisement
Create a static project. Put the common code in that. Then list the static lib as a dependency in the DLL''s that need it. My engines works exactly this way.

Creating a class from a dll in your exe is more challenging. You need to create it in the dll and pass a pointer back to the exe.

Let me know if you can''t work it out here email me chris.brodie@macquarie.com.au and I''ll send you some source I have that loads classes from dll''s.

gimp
Chris Brodie
To use a static Library is a great idea. I will try it. I found a good tutorial on the VOID Site (The Void Engine). It discuss the problem how to Implement C++ in DLL. It works just fine. So now I will try that with these Static Library`s. One question:

How do you solve the problem if the Class uses functions or classes from the DLL and the Game. Because for example my Camera Class uses a function from the Game. But I need to implement the Camera Class in my DLL, too. And so I got one Linker Error because I have to implement some classes from the EXE.

But I think I can solve the Problem with making some other structures.

Thanks for your Relpy

Lutz Hören

EDITED: I have just implemented the Static Library and it works great. Thanks

Edited by - Punika on April 28, 2001 6:05:42 AM
Punika
Just an idea, let the COM be with you.!!
It''s very nice but only for Win32.

I use it in my engine and it is really cool.

_______________
Jester, studient programmerThe Jester Home in French
quote:
Original post by jesterlecodeur

Just an idea, let the COM be with you.!!
It''s very nice but only for Win32.

I use it in my engine and it is really cool.




Yeah, COM worked well for me. I can even pass images back and forth between my main program (Scrolling Game Development Kit) and the engine (BMDXCtls), as well as entire map layers.

http://gamedev.sourceforge.net/

"All you need to do to learn circular logic is learn circular logic"
"All you need to do to learn circular logic is learn circular logic"
Advertisement
Punika,
sounds like COM will help resolve your problems. COM will allow you to push object creation behind the DLL boundary so that no class header files are required in the DLL client code, and there will be no need to link to class implementations as this will also be contained in the DLL. If I have understood your problem correctly, this will solve all of the points you have described.
Thanks for your Replys,
someone know where I can find Informations on it ? I know what it is but I haven`t implemented it yet. But seems to work great for Engines.

Bye



Edited by - Punika on April 28, 2001 9:38:03 AM
Punika
I don''t know about COM, and I don''t want to limit myself to win$ platforms, but if you are interested in using classes from a dll, there is an interesting article in the resource section (http://www.gamedev.net/reference/articles/article928.asp)
------------------"Between the time when the oceans drank Atlantis and the rise of the sons of Arius there was an age undreamed of..."
At the Moment I have some linker errors. I have to say that DLL with C++ is a really pain. I know why Carmack loves to programming in C.



Punika
Punika

This topic is closed to new replies.

Advertisement