Created
May 30, 2018 20:27
-
-
Save DavidLudwig/12c648e6e1473ad08540699f4e659595 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 <io2d.h> | |
#include <mutex> | |
using namespace std; | |
using namespace std::experimental; | |
using namespace std::experimental::io2d; | |
static output_surface & display() { | |
static auto surface = output_surface{500, 500, format::argb32, scaling::none, refresh_style::fixed, 30.f}; | |
return surface; | |
} | |
int main(int argc, const char * argv[]) { | |
display().size_change_callback([&](output_surface& surface){ | |
surface.dimensions(surface.display_dimensions()); | |
}); | |
display().draw_callback([&](auto& surface) { | |
brush greenBrush{rgba_color::green}; | |
surface.paint(greenBrush); | |
}); | |
display().begin_show(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment