implement TSkybox and use setColor method to set the background color, rather than the image
This commit is contained in:
30
thermion_dart/native/src/c_api/TSkybox.cpp
Normal file
30
thermion_dart/native/src/c_api/TSkybox.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <emscripten.h>
|
||||
#endif
|
||||
|
||||
#include "c_api/TSkybox.h"
|
||||
|
||||
#include <filament/math/mat4.h>
|
||||
#include <filament/Skybox.h>
|
||||
|
||||
#include "Log.hpp"
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace thermion
|
||||
{
|
||||
extern "C"
|
||||
{
|
||||
using namespace filament;
|
||||
#endif
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE void Skybox_setColor(TSkybox *tSkybox, double r, double g, double b, double a)
|
||||
{
|
||||
auto *skybox = reinterpret_cast<filament::Skybox *>(tSkybox);
|
||||
skybox->setColor(filament::math::float4 { static_cast<float>(r), static_cast<float>(g), static_cast<float>(b), static_cast<float>(a) } );
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user