plugin starter kit

metadata
Wenzel Jakob 2010-08-24 00:28:21 +02:00
parent 5645cdf360
commit 795a38c60d
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1 @@
This is a tiny example on how Mitsuba plugins can be developed outside of the main codebase.

View File

@ -0,0 +1,5 @@
import os
env = Environment(ENV = os.environ, tools=['default'])
env['SHLIBPREFIX'] = ''
env.SharedLibrary('plugins/myutil', ['myutil.cpp'])

View File

@ -0,0 +1,19 @@
#include <mitsuba/render/util.h>
MTS_NAMESPACE_BEGIN
class MyUtility : public Utility {
public:
MyUtility(UtilityServices *us) : Utility(us) { }
int run(int argc, char **argv) {
cout << "Hello world!" << endl;
return 0;
}
MTS_DECLARE_CLASS()
};
MTS_IMPLEMENT_CLASS(MyUtility, false, Utility)
MTS_EXPORT_UTILITY(MyUtility, "Example utility")
MTS_NAMESPACE_END