#include "c_api/TScene.h" #include #include #include #include #include #include "Log.hpp" #ifdef __cplusplus namespace thermion { extern "C" { using namespace filament; #endif EMSCRIPTEN_KEEPALIVE TRenderTarget *RenderTarget_create( TEngine *tEngine, uint32_t width, uint32_t height, TTexture *tColor, TTexture *tDepth) { auto engine = reinterpret_cast(tEngine); auto color = reinterpret_cast(tColor); auto depth = reinterpret_cast(tDepth); auto rt = filament::RenderTarget::Builder() .texture(RenderTarget::AttachmentPoint::COLOR, color) .texture(RenderTarget::AttachmentPoint::DEPTH, depth) .build(*engine); return reinterpret_cast(rt); } EMSCRIPTEN_KEEPALIVE void RenderTarget_destroy( TEngine *tEngine, TRenderTarget *tRenderTarget ) { auto engine = reinterpret_cast(tEngine); auto *renderTarget = reinterpret_cast(tRenderTarget); engine->destroy(renderTarget); } #ifdef __cplusplus } } #endif