@@ -43,7 +43,7 @@ class ExampleBounce : public Application
4343
4444 void calculate_circle_position () {
4545 for (u32 i = 0 ; i < circle_vertices_count; ++i) {
46- double theta = 6.28 * float (i) / circle_vertices_count;
46+ double theta = 6.28 * double (i) / circle_vertices_count;
4747 circle[i].point = { position.x + 0.1 * std::cos (theta), position.y + 0.1 * std::sin (theta) };
4848 }
4949 }
@@ -56,7 +56,7 @@ class ExampleBounce : public Application
5656
5757public:
5858
59- ExampleBounce () : Application(" ExampleBounce" , VideoMode(600 , 600 ), Window::Floating ) {
59+ ExampleBounce () : Application(" ExampleBounce" , VideoMode(600 , 600 ), ! Window::Resizable ) {
6060 push_layer<CubeLayer>(this );
6161 push_layer<ImGuiLayer>(this );
6262 set_frame_limit (60 );
@@ -65,16 +65,14 @@ class ExampleBounce : public Application
6565 virtual bool OnUpdate (Time elapsed) override {
6666 clear ();
6767
68- keyboard_handle ();
69-
7068 auto estimated_position = position + camera.get_projection () * velocity * elapsed.asSeconds ();
7169
7270 if (estimated_position.x >= 0.9 || estimated_position.x <= -0.9 )
7371 velocity.x = -(velocity.x / 2.0 );
7472 else if (estimated_position.y >= 0.9 || estimated_position.y <= -0.9 )
7573 velocity.y = -(velocity.y / 2.0 );
7674 else
77- position = estimated_position, calculate_circle_position ();
75+ position = estimated_position, keyboard_handle (), calculate_circle_position ();
7876
7977 calculate_circle_color ();
8078
0 commit comments