Mercurial > malikania
comparison tests/libclient/js-animation/main.cpp @ 63:96ba0c5cf893
Misc: update duktape.hpp to new style
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 16 Dec 2016 16:11:24 +0100 |
parents | f30c84b4b9ed |
children |
comparison
equal
deleted
inserted
replaced
62:a0081be977b5 | 63:96ba0c5cf893 |
---|---|
32 | 32 |
33 class test_animation { | 33 class test_animation { |
34 protected: | 34 protected: |
35 mlk::directory_resources_locator m_locator; | 35 mlk::directory_resources_locator m_locator; |
36 mlk::client_resources_loader m_loader; | 36 mlk::client_resources_loader m_loader; |
37 UniqueContext m_ctx; | 37 dukx_context m_ctx; |
38 | 38 |
39 public: | 39 public: |
40 test_animation() | 40 test_animation() |
41 : m_locator(SOURCE_DIRECTORY "/resources") | 41 : m_locator(SOURCE_DIRECTORY "/resources") |
42 , m_loader(m_locator) | 42 , m_loader(m_locator) |
60 "a = new Malikania.Animation('animations/margins.json');" | 60 "a = new Malikania.Animation('animations/margins.json');" |
61 "d = new Malikania.Animator(a);" | 61 "d = new Malikania.Animator(a);" |
62 ); | 62 ); |
63 | 63 |
64 if (ret != 0) { | 64 if (ret != 0) { |
65 throw dukx_exception(m_ctx, -1); | 65 throw dukx_get_exception(m_ctx, -1); |
66 } | 66 } |
67 | 67 |
68 boost::timer::cpu_timer timer; | 68 boost::timer::cpu_timer timer; |
69 | 69 |
70 while (timer.elapsed().wall / 1000000LL < 8000) { | 70 while (timer.elapsed().wall / 1000000LL < 8000) { |
75 "d.update();" | 75 "d.update();" |
76 "w.present();" | 76 "w.present();" |
77 ); | 77 ); |
78 | 78 |
79 if (ret != 0) { | 79 if (ret != 0) { |
80 throw dukx_exception(m_ctx, -1); | 80 throw dukx_get_exception(m_ctx, -1); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 std::this_thread::sleep_for(3s); | 84 std::this_thread::sleep_for(3s); |
85 } catch (const std::exception &ex) { | 85 } catch (const std::exception &ex) { |