Created
August 28, 2016 12:26
-
-
Save voidproc/3139e13be5cbe6627bada396f9db149f 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> | |
#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