Smaller DLL suggestion

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

zenaku's opinion
I prefer big executables.
Keep it Simple, Stupid
If you don't have anything nice to say, don't say anything at all.
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

well normally you split your dlls according to your module structure. the problem is: irrlicht is ONE module. if you dont want to have irrlicht's gui support for your game, its not really hard to exclude it from source and then compile your own irrlicht.dll... the magic word is: refactoring..
worst programming style ever seen...
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

yeah splittin the engine would be cool. u could get updates on things without exchaging all functions...so i could stay up to date with the meshloaders without redoing the gui everytime.
i did the same with my game engine....i got one big dll which has the core features and then a game.dll a server.dll and a client.dll. that way i can programm every module without taking care of the other ones....
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
anylo
Posts: 71
Joined: Mon Feb 20, 2006 11:14 am

Post by anylo »

It would be really cool if Irrlicht would use proper autoconf/-make tools...

Code: Select all

./configure --disable-gui --disable-dx8 --disable-dx9 --disable-sw --enable-static-lib
Of course, this is just a "nice to have" feature.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

zenaku wrote:
monkeycracks wrote:
zenaku's post
I guess it would be better to have one big, monolithic file called Game.exe, right? Why even have a dll? Static link! No directory structure, no media files. Just bundle it all into one huge Game.exe Lol ;)
Why "Lol"? For a game application it's almost certainly better than linking to a monolothic DLL, as the linker can discard any unused components (if the internal referencing is done correctly), bring the file size and memory footprint down, and avoid thunk overhead.

Not that that's really an issue with desktop machines, but if you're targetting any embedded platfom then static linking (to libraries that are unlikely to be used by any other application) is the way to go.

[UPDATE] Sorry, I meant: "LOLLZORZ D00D!!!!!"
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
zenaku
Posts: 212
Joined: Tue Jun 07, 2005 11:23 pm

Post by zenaku »

Ok, I see your points on static linking, although I disagree with 'thunk overhead'. Once the loader has loaded and relocated the dll, an asm call instruction is still a call instruction. There is zero function call overhead with using dynamic over static linking; only a marginal startup time increase.

You are right though about the linker throwing out unused methods when you statically link. It can't do that with the DLL. Static linking gives you finer granularity with what is included and what is not. Right now, every method is included in the DLL. If it was broken up into DLL modules, you'd still have to use whole DLL modules, not just methods in the modules. With static linking, exactly those methods referenced are included, no more, no less.

And besides, who's targeting embedded? :) If they are, how the hell does their embedded device support irrlicht class 3d graphics but not simple dynamic libraries? :)

I dunno. It just seems cleaner design to me to have separate modules. It would really, really sadden me to find out that irrlicht has not embraced separate modules precisely because ogre has.
-------------------------------------
IrrLua - a Lua binding for Irrlicht
http://irrlua.sourceforge.net/
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I do target embedded devices. And the overhead with dynamic linking can be quite annoying on those systems.
zenaku
Posts: 212
Joined: Tue Jun 07, 2005 11:23 pm

Post by zenaku »

Couldn't we have the best of both worlds? Separate modules and the option to compile the separate modules as static libs as well as dlls?

When you build with gcc, you get libirrlicht.a (static) or if you use sharedlib target you get libirrlicht.so (dynamic). It could just as easily be split up into libirrlicht.core.a and libirrlicht.core.so, etc. Separate modules, dynamic or static linking which is optional to the user.
-------------------------------------
IrrLua - a Lua binding for Irrlicht
http://irrlua.sourceforge.net/
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use the Makefile: 'make sharedlib' or 'make staticlib' for Linux, or the same targets with _win32 postfix (i.e. sharedlib_win32) for Windows. This is currently possible with gcc only, maybe I can add targets for other compilers...
pinballwizard
Posts: 67
Joined: Wed Aug 02, 2006 1:47 am

Compiling Irrlicht into single huge GAME.EXE

Post by pinballwizard »

zenaku wrote:
monkeycracks wrote:
zenaku's post
Then you'd have doodoo loads of .dll's in your main game executable location...That's not exactly nice-looking or anything.
I guess it would be better to have one big, monolithic file called Game.exe, right? Why even have a dll? Static link! No directory structure, no media files. Just bundle it all into one huge Game.exe Lol ;)
Actually that's exactly what I want to do: everything (and I do mean everything) in a single game.exe file.

Why? To understand, first I should say that my target is creating shareware games for download or simple games for my friends.

Then with one monolithic game.exe file, I can tell my (non-geek) friends "just download and run this file". No install, no directory structure, no media files, no DLL's, no NOTHING. Literally just click, and run.

Isn't that cool that you can do this with Irrlicht (and IrrLua)?

Of course, for HUGE games with multiple DVD's of full-motion video, etc, you obviously can't go the single-huge-game.exe route, but for simple download-from-the-web games, I think there's a lot to be said for a single huge no-install game.exe file.
Post Reply