plugin starter kit
parent
5645cdf360
commit
795a38c60d
|
@ -0,0 +1 @@
|
||||||
|
This is a tiny example on how Mitsuba plugins can be developed outside of the main codebase.
|
|
@ -0,0 +1,5 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
env = Environment(ENV = os.environ, tools=['default'])
|
||||||
|
env['SHLIBPREFIX'] = ''
|
||||||
|
env.SharedLibrary('plugins/myutil', ['myutil.cpp'])
|
|
@ -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
|
Loading…
Reference in New Issue