#include struct ParamScale { float scale; float unused[3]; }; void setScale(const int scale) { ConstantBuffer cb; cb->scale = scale; PostEffect::SetConstant(ShaderStage::Pixel, 1, cb); } void Main() { Window::Resize(640, 480); Graphics::SetBackground(Palette::Black); int scale = 2; PostEffect::Register(PixelShader(L"scale.hlsl")); setScale(scale); const Texture texture(L"Example/Siv3D-kun.png"); while (System::Update()) { if (Input::KeyUp.clicked) { scale = Min(scale + 1, 4); setScale(scale); } else if (Input::KeyDown.clicked) { scale = Max(scale - 1, 1); setScale(scale); } texture.draw(); PutText(L"scale = ", scale).from(2, 2); } }