DLLs for Linx and Mac?

Started by
31 comments, last by Cromulent 15 years, 10 months ago
Quote:Original post by EmptyVoid
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
So how does 3DS Max deal with it's plug-ins?


3D Studio Max is not available for Linux or Macs. So it does not have to worry about it.


That answered my question very well. Thanks lol

One thing though why on earth would you want a Mac or Linux in that case?...

Because there is superior 3D software like Maya that does run on Macs and Linux;)

[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Advertisement
Quote:Original post by daviangel
Quote:Original post by EmptyVoid
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
So how does 3DS Max deal with it's plug-ins?


3D Studio Max is not available for Linux or Macs. So it does not have to worry about it.


That answered my question very well. Thanks lol

One thing though why on earth would you want a Mac or Linux in that case?...

Because there is superior 3D software like Maya that does run on Macs and Linux;)


Maya is not superior you can't write exporter plug-ins as far as I know.
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by EmptyVoid
Quote:Original post by daviangel
Quote:Original post by EmptyVoid
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
So how does 3DS Max deal with it's plug-ins?


3D Studio Max is not available for Linux or Macs. So it does not have to worry about it.


That answered my question very well. Thanks lol

One thing though why on earth would you want a Mac or Linux in that case?...

Because there is superior 3D software like Maya that does run on Macs and Linux;)


Maya is not superior you can't write exporter plug-ins as far as I know.


Of course you can. There is a whole Maya API that you can use.
Quote:Original post by Cromulent
Of course you can. There is a whole Maya API that you can use.


If that is the case then how did they make the plug-in system cross platform?
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by EmptyVoid
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
Quote:Original post by daviangel
Quote:Original post by EmptyVoid
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
So how does 3DS Max deal with it's plug-ins?


3D Studio Max is not available for Linux or Macs. So it does not have to worry about it.


That answered my question very well. Thanks lol

One thing though why on earth would you want a Mac or Linux in that case?...

Because there is superior 3D software like Maya that does run on Macs and Linux;)


Maya is not superior you can't write exporter plug-ins as far as I know.


Of course you can. There is a whole Maya API that you can use.


If that is the case then how did they make the plug-in system cross platform?


Write cross platform compatible code and the just install it in the proper place for that operating system. Obviously it will need to be recompiled but that is the same with any C/C++ code.

Java JAR's and CLR DLL's (For the "Any" CPU) are cross platform. Just that they need the runtime to JIT them to the target CPU/OS at runtime.
But how does maya do it? What header files is it using?
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by EmptyVoid
But how does maya do it? What header files is it using?


Same way as any other SDK works. It is nothing magic really.
Quote:Original post by Cromulent
Quote:Original post by EmptyVoid
But how does maya do it? What header files is it using?


Same way as any other SDK works. It is nothing magic really.


Ok how do I make a SDK?
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by EmptyVoid
Ok how do I make a SDK?

Wow. That's a huge question.

An SDK - a software development kit - is a collection of tools, utilities, dynamic libraries, static import libraries and source code to assist and/or enable developers to create solutions that target a specific platform. That platform can be an operating system (eg, Windows SDK), a set of interfaces that abstract access to resources like hardware (eg, DirectX SDK), or even a single application (eg, Maya SDK). An SDK is authored the same way you author any collection of code and applications - that is not your problem. Your problem is that you don't fundamentally know what you are doing.

Let's start at the beginning. What do you want to accomplish? From your posts, it appears you want to create an extension mechanism for an application (eg, your game) that works across platforms - Windows, OS X, Linux. The first thing you need to realize is that these are three separate products - three separate applications compiled specifically to those operating system platforms, and a similar/identical extension mechanism across all three.

The following assumes you're writing your game in either C or C++.

Let's say you've written a game for Windows, using an abstraction toolkit like SDL so that your game builds under Linux simply by recompiling. You now want to add to your game the ability to load new functionality from a dynamic library or shared object present in a specific folder. For Windows, you need to call LoadLibrary to open the dynamic library, then GetProcAddress to obtain the address of a particular function implemented in it; for Linux and OS X (after 10.3), you need to call dlopen to load the shared object, then dlsym to obtain the address of a symbol defined in the library. C and C++ support the notion of conditional compilation via the preprocessor: you can check for the existence of platform-specific symbols and cause different branches of code to be compiled as a consequence.

#ifdef _WIN_VER    // Windows    LoadLibrary(...);    ...    GetProcAddress(...);    ...#elseif __APPLE__  // Mac OS    dlopen(...);    ...    dlsym(...);    ...#elseif __linux__  // take a wild guess    dlopen(...);    ...    dlsym(...);    ...    // despite calling the same function, the parameters for Linux may differ    // from Mac OS X, so we separate those platforms as well#else    // you can disable the application from loading plugins, or whatever#endif


But what if you don't want to mess about with platform-specific dynamic library techniques? Well, then you actually have to do more upfront work to simplify things on the end. Say you want to create something comparable to the Maya Embedded Language; then you need to create the plugin language (or pick one - there are dozens of extension and embeddable languages), build/select the compiler, integrate it into the toolchain used by your developers (including your end users if you allow them to develop plugin and extensions), and then embed an interpreter or other mechanism to parse the compiled object files within your application.


As you can see, there is a lot you need to do. Get busy, and good luck!

This topic is closed to new replies.

Advertisement