Skip to content

Instantly share code, notes, and snippets.

@DavidLudwig
Created May 30, 2018 20:27
Show Gist options
  • Save DavidLudwig/12c648e6e1473ad08540699f4e659595 to your computer and use it in GitHub Desktop.
Save DavidLudwig/12c648e6e1473ad08540699f4e659595 to your computer and use it in GitHub Desktop.
#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