diff --git a/src/c1/circle.cpp b/src/c1/circle.cpp new file mode 100644 index 0000000..31fce86 --- /dev/null +++ b/src/c1/circle.cpp @@ -0,0 +1,101 @@ +//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 = 120; +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_POINTS); + static int state = -1; + state=(state+1)%F_PER_SECOND; + const float anglePerCircle = 10.0f; + 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 9fae909..34cd950 100644 --- a/xmake.lua +++ b/xmake.lua @@ -16,4 +16,7 @@ add_requires("glfw","glad","glm") add_packages("glfw","glad","glm") target("3Points") - add_files("src/c1/threePoints.cpp") \ No newline at end of file + add_files("src/c1/threePoints.cpp") + +target("circle") + add_files("src/c1/circle.cpp") \ No newline at end of file