diff --git a/src/c1/circle.cpp b/src/c1/circle.cpp new file mode 100644 index 0000000..a85cf72 --- /dev/null +++ b/src/c1/circle.cpp @@ -0,0 +1,114 @@ +//circle.cpp + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const float POINT_SIZE = 32.0f; +const unsigned int F_PER_SECOND = 144; +const float PI = 3.141592653589793238462643383279502884L; + +typedef unsigned int u8; + +#ifdef NDEBUG + #define PRINT(v) +#else + #define PRINT(v){std::cout<=1000||bx<=-1000){ + bsx=-bsx; + } + if(by>=1000||by<=-1000){ + bsy=-bsy; + } + return this; + } +}; + +float angleToRad(float angle){ + return angle/180*PI; +} + +void render(){ + glBegin(GL_TRIANGLES); + static int state = -1; + state=(state+1)%F_PER_SECOND; + const u8 anglePerCircle = 1; + static float circleSize = 0.1f; + if(state==0){ + circleSize+=0.1f; + } + if(circleSize>1.0f){ + circleSize=0.1f; + } + for (u8 i=0;i +int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { + main(); + return 0; +} +#endif \ No newline at end of file diff --git a/xmake.lua b/xmake.lua index 12407c5..0fa7dbe 100644 --- a/xmake.lua +++ b/xmake.lua @@ -19,4 +19,7 @@ target("3Points") add_files("src/c1/threePoints.cpp") target("circlePoints") - add_files("src/c1/circlePoints.cpp") \ No newline at end of file + add_files("src/c1/circlePoints.cpp") + +target("circle") + add_files("src/c1/circle.cpp") \ No newline at end of file