Skip to content

Instantly share code, notes, and snippets.

@voidproc
Created August 28, 2016 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save voidproc/3139e13be5cbe6627bada396f9db149f to your computer and use it in GitHub Desktop.
Save voidproc/3139e13be5cbe6627bada396f9db149f to your computer and use it in GitHub Desktop.
#include <Siv3D.hpp>
#include <HamFramework.hpp>
void Main()
{
ScalableWindow::Setup(640, 480);
Graphics::SetBackground(Palette::White);
Stopwatch resizeWatch(true);
Size windowSize = Window::Size();
while (System::Update())
{
// Monitor window size
if (windowSize != Window::Size())
{
resizeWatch.restart();
}
if (resizeWatch.ms() > 500)
{
resizeWatch.pause();
}
windowSize = Window::Size();
// Draw something ...
Window::ClientRect().draw(Palette::Black);
if (resizeWatch.ms() > 500)
{
const auto transformer = ScalableWindow::CreateTransformer();
Window::BaseClientRect().draw(Palette::Yellow).drawFrame(10.0, 2.0, Palette::Orange);
}
ScalableWindow::DrawBlackBars(Palette::Gray);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment