move outline material to embedded binary
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "material/image.h"
|
||||
#include "material/grid.h"
|
||||
#include "material/unlit_fixed_size.h"
|
||||
#include "material/outline.h"
|
||||
|
||||
#include "c_api/TMaterialInstance.h"
|
||||
|
||||
@@ -74,6 +75,14 @@ namespace thermion
|
||||
return reinterpret_cast<TMaterial *>(material);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE TMaterial *Material_createOutlineMaterial(TEngine *tEngine) {
|
||||
auto *engine = reinterpret_cast<filament::Engine *>(tEngine);
|
||||
auto *material = filament::Material::Builder()
|
||||
.package(OUTLINE_OUTLINE_DATA, OUTLINE_OUTLINE_SIZE)
|
||||
.build(*engine);
|
||||
return reinterpret_cast<TMaterial *>(material);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE bool Material_hasParameter(TMaterial *tMaterial, const char *propertyName) {
|
||||
auto *material = reinterpret_cast<filament::Material *>(tMaterial);
|
||||
return material->hasParameter(propertyName);
|
||||
|
||||
@@ -513,6 +513,17 @@ extern "C"
|
||||
auto fut = _renderThread->add_task(lambda);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE void Material_createOutlineMaterialRenderThread(TEngine *tEngine, void (*onComplete)(TMaterial *))
|
||||
{
|
||||
std::packaged_task<void()> lambda(
|
||||
[=]() mutable
|
||||
{
|
||||
auto *instance = Material_createOutlineMaterial(tEngine);
|
||||
PROXY(onComplete(instance));
|
||||
});
|
||||
auto fut = _renderThread->add_task(lambda);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE void Material_createInstanceRenderThread(TMaterial *tMaterial, void (*onComplete)(TMaterialInstance *))
|
||||
{
|
||||
std::packaged_task<void()> lambda(
|
||||
|
||||
Reference in New Issue
Block a user