Mercurial > malikania
view client/main.cpp @ 77:61ea80e925ab
CMake: import pugixml 1.8, closes #613
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 20 Jan 2017 11:00:14 +0100 |
parents | 858621081b95 |
children | ee850a6ab89e |
line wrap: on
line source
/* * main.cpp -- main client file * * Copyright (c) 2013-2017 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <malikania/duktape.hpp> #include <chrono> #include <thread> #include "malikania/button.hpp" #include "malikania/color.hpp" #include "malikania/frame.hpp" #include "malikania/label.hpp" #include "malikania/point.hpp" #include "malikania/unique_layout.hpp" #include "malikania/window.hpp" int main() { mlk::window win; auto f = std::make_shared<mlk::frame>(); auto w = std::make_shared<mlk::label>("Malikania"); auto l = std::make_shared<mlk::unique_layout>(w); f->move({50, 50}); f->set_layout(l); win.add_frame(f); while (win.is_open()) { win.poll(); win.set_drawing_color({255, 255, 255, 255}); win.clear(); win.draw_frames(); win.present(); std::this_thread::sleep_for(std::chrono::milliseconds(50)); } }