-
-
Save Reputeless/9ce288b57451dc2ede914044b9e006d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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