Skip to main content
GameDev.net gamedev.net
🔒 Locked

DLLs and libraries for iso engines

Started by mattd May 28, 2002 at 4:36 AM 0 replies 1.1k views
Original Post
mattd
mattd
yello y''all i''m currently in the process of planning my iso engine, and i''m not sure whether to use static libraries or dynamic DLLs - or something else. it''s going to use classes, obviously, so if i was going to use run-time DLLs i would have to use a system where each class had a function that created the class inside the DLL, and export these to a kernel which had a list of all loaded classes. I know how to do this, but is this just overkill for a iso engine? if i was going to use a static library, should i split the engine into multiple libraries? which way is faster or easier to code for? what other methods have you used that keep the engine code away from the client code? thanks in advance, mattd
Aldacron
Aldacron
If all you want to do is keep the engine code seperate from the client code, you could just put them in seperate folders and compile them both into an EXE

I think the question should not be how to keep them seperate, but rather how to make the engine reusable. Now we can discuss static libs vs dlls.

Ask yourself a few questions.

1) Is this code going to be used in more than 1 project?

2) Will updates be made available for those who have a game that uses the engine?

3) Will the engine be improved/refined over time?

If you answered yes to all 3, I would recommend dlls. This way, you don''t have to rebuild the game everytime you make changes to the engine. If you want your earlier games to take advantage of improvements in the new engine, just replace the DLL and voila! Your old games now have faster blitting speeds/level loading or whatever changes you''ve made.

Two caveats to keep in mind for this approach to work:

1) Any changes you make to the engine should not break backwards
compatibility. Don''t go removing methods or changing method names and expect your older games to work.

2) Do not link to the export lib which is created when the dll is built. Your app will be bound to that specific version of the dll and could possibly break if you try to use a different version. Instead, create your own static lib which loads the dll with LoadLibrary and load any functions you need to expose. Then, provided you''ve followed 1 above, there should be no problems.

With all that said, I typically use static libs myself. All of my development thus far has been for research/recreational purposes. When I finally reach the point where I''m pumping out games for the masses, you can bet I''ll use the dll approach. Then the end user only needs to download 1 file to update the game everytime I change the engine.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.