Sha256: a551ad6f79794e6f918a660d7b90012f195011c5767b90d60e4d6c7ee87f15e2
Contents?: true
Size: 1.43 KB
Versions: 4
Compression:
Stored size: 1.43 KB
Contents
#include <xot.h> #include <rays.h> #include <reflex.h> using namespace Xot; using namespace Rays; using namespace Reflex; class Win : public Window { typedef Window Super; public: void on_update (UpdateEvent* e) { redraw(); } void on_draw (DrawEvent* e) { e->painter->text(stringf("%f", e->fps), 10, 10); } };// Window class App : public Application { public: void on_start (Event* e) { Window* win = new Win(); win->set_title(app()->name()); win->set_frame(100, 100, 500, 500); win->show(); win->root()->set_gravity(0, 9.8); Image image(32, 32); Painter painter = image.painter(); painter.begin(); painter.no_stroke(); painter.set_fill(1, 1, 1); painter.rect(0, 0, image.width(), image.height()); painter.set_fill(1, 0, 0); painter.ellipse(0, 0, image.width(), image.height()); painter.end(); for (int y = 0; y < 3; ++y) for (int x = 0; x < 10; ++x) { ImageView* view = new ImageView(); view->set_image(image); view->set_frame( x * (image.width() + 10), y * (image.height() + 10), image.width(), image.height()); win->root()->add_child(view); view->body()->set_dynamic(true); view->body()->set_density(1); } } };// App int main(int argc, const char** argv) { Rays::init(); Reflex::init(); Application* app = new App(); app->set_name("Hello Xcode!"); app->start(); Reflex::fin(); Rays::fin(); return 0; }
Version data entries
4 entries across 3 versions & 1 rubygems