Skip to content

Instantly share code, notes, and snippets.

@Reputeless
Created Dec 18, 2022
Embed
What would you like to do?
# include <Siv3D.hpp> // OpenSiv3D v0.6.6
void Main()
{
std::unique_ptr<TextureAssetData> assetData = std::make_unique<TextureAssetData>();
// ロード時の仕事
assetData->onLoad = [](TextureAssetData& asset, [[maybe_unused]] const String& hint)
{
// ここに作成したテクスチャを代入する
asset.texture = Texture{ Image{ 256, 256, Palette::Skyblue }, TextureDesc::Mipped };
return true;
};
// 登録
TextureAsset::Register(U"MyTexture", std::move(assetData));
while (System::Update())
{
TextureAsset(U"MyTexture").draw();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment