Irrlicht source question

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Irrlicht source question

Post by Halifax »

I have looked at tutorials on how to build DLLs etc. and they all say you need to have __declspec(etc.) before every class/function you want exported.

I have run grep *.* through the Irrlicht directory and it returns only 3 finds for __declspec()

How can Irrlicht work as a DLL if it doesn't have these?
TheQuestion = 2B || !2B
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

All exporting does is tell the linker that the function needs to be callable from outside the DLL. Everything else is either inline or accessable from the object returned from the exported function.

Travis
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

But still there isn't __declspec(...) before every class exported..?
I see only createDevice/Ex has it.

Code: Select all

00158 #ifdef _IRR_WINDOWS_API_
00159 
00160 #ifndef _IRR_STATIC_LIB_
00161 #ifdef IRRLICHT_EXPORTS
00162 #define IRRLICHT_API __declspec(dllexport)
00163 #else
00164 #define IRRLICHT_API __declspec(dllimport)
00165 #endif // IRRLICHT_EXPORT
00166 #else
00167 #define IRRLICHT_API
00168 #endif // _IRR_STATIC_LIB_

Code: Select all

IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(
00278                 video::E_DRIVER_TYPE deviceType = video::EDT_SOFTWARE,
00279                 const core::dimension2d<s32>& windowSize = (core::dimension2d<s32>(640,480)), // paranthese are necessary for some compilers
00280                 u32 bits = 16,
00281                 bool fullscreen = false,
00282                 bool stencilbuffer = false,
00283                 bool vsync = false,
00284                 IEventReceiver* receiver = 0,
00285                 const c8* sdk_version_do_not_use = IRRLICHT_SDK_VERSION);
00286 
00288 
00295         IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(
00296                 const SIrrlichtCreationParameters& parameters);

Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Because that's the only function which can be called from outside. All other methods need to go via the device.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Yup. (On Windows) run depends on any of the DirectX Dlls and see how few symbols they actually export.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Oh I get it now, so basically all those getter functions in the device stop the need for you to export those classes explicitly?
TheQuestion = 2B || !2B
Post Reply