From c707eff1ad9d92c10f10f3c17f4fa49de2e26064 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Fri, 6 Sep 2024 17:30:07 +0800 Subject: [PATCH] update --- src/c1/circle.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/c1/circle.cpp b/src/c1/circle.cpp index a85cf72..c2d37f5 100644 --- a/src/c1/circle.cpp +++ b/src/c1/circle.cpp @@ -2,12 +2,10 @@ #include #include -#include #include #include #include #include -#include #include #include #include @@ -25,22 +23,6 @@ typedef unsigned int u8; #endif -class BouncyBall{ -public: - int bx=0,by=0,bsx=5,bsy=7; - BouncyBall(int x,int y,int speedX,int speedY):bx(x),by(y),bsx(speedX),bsy(speedY){} - BouncyBall* update(){ - bx+=bsx,by+=bsy; - if(bx>=1000||bx<=-1000){ - bsx=-bsx; - } - if(by>=1000||by<=-1000){ - bsy=-bsy; - } - return this; - } -}; - float angleToRad(float angle){ return angle/180*PI; } @@ -99,8 +81,8 @@ int main(){ glClear(GL_COLOR_BUFFER_BIT); render(); glfwSwapBuffers(window); + // std::this_thread::sleep_for(std::chrono::milliseconds(1000/F_PER_SECOND)); glfwPollEvents(); - std::this_thread::sleep_for(std::chrono::milliseconds(1000/F_PER_SECOND)); } return 0; }