{"id":26701716,"url":"https://github.com/krehwell/memake","last_synced_at":"2025-09-15T07:19:37.848Z","repository":{"id":239403679,"uuid":"353067222","full_name":"krehwell/Memake","owner":"krehwell","description":"Yeet! C++ 2D graphics library to output primitives and other custom shapes, easily.","archived":false,"fork":false,"pushed_at":"2021-08-13T05:05:07.000Z","size":5920,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-12T07:25:55.149Z","etag":null,"topics":["2d-graphics","2d-library","graphics-library","sdl2"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krehwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-30T16:25:06.000Z","updated_at":"2024-05-12T07:25:56.317Z","dependencies_parsed_at":"2024-05-12T07:25:56.184Z","dependency_job_id":"39770116-32c3-4584-bc70-9e259bd35528","html_url":"https://github.com/krehwell/Memake","commit_stats":null,"previous_names":["krehwell/memake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krehwell%2FMemake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krehwell%2FMemake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krehwell%2FMemake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krehwell%2FMemake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krehwell","download_url":"https://codeload.github.com/krehwell/Memake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245764402,"owners_count":20668402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-graphics","2d-library","graphics-library","sdl2"],"created_at":"2025-03-27T01:29:53.712Z","updated_at":"2025-03-27T01:29:53.777Z","avatar_url":"https://github.com/krehwell.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memake\nYeet, yeet, yeet!.\n\n```c++\n#include \"Memake.h\"\nMemake mmk(800, 800, \"memake window\");\n\nvoid draw() {\n    mmk.drawRect(300, 300, 100, 100, Colmake.red); // draw a rectangle with red color\n}\n\nint main() {\n    mmk.update(draw);\n    return 0;\n}\n```\n\n## Dependencies\n- [SDL2](https://www.libsdl.org/)\n\n## Download\nDownload project based on tools you use to run C++:\n- Manual Compile (for chad): `git clone https://github.com/krehwell/Memake.git`\n- Visual Studio Code: [GDrive](https://drive.google.com/uc?id=1miBk4zrwGcTGMf8Lj65ge2YUiKuP8WUz\u0026export=download)\n- Visual Studio: [GDrive](https://drive.google.com/uc?id=1CSqh1opYfNVwt_4Vw8hDVYIA1FBPTcxu\u0026export=download)\n- Dev-C++: [GDrive](https://drive.google.com/u/1/uc?id=1ztK2zg4faMglrwNrvJa429BcZ2al5PK-\u0026export=download)\n\n\n## Installation\n\u003cdetails\u003e\n\u003csummary\u003eVisual Studio Code (VsCode) Installation: (\u003ca href=\"https://imgur.com/gallery/Xa16Wzh\"\u003eSimple installation page\u003c/a\u003e) \u003c/summary\u003e  \n\n1. Download the project and extract\n2. Inside the extracted folder go to `__install__` folder  \n    ![vscode1](https://i.imgur.com/zAySyOA.png)  \n3. Move `MinGW` folder to `C:`  \n    ![vscode2](https://i.imgur.com/ev9vPj2.png) \n4. Right click \"Add MinGW to env.bat\" and Run as administrator\n    ![vscode3](https://i.imgur.com/7X5sBvA.png) \n5. Open the extracted project with vscode\n    ![vscode4](https://i.imgur.com/7X5sBvA.png) \n6. Install C++ extension for VsCode\n    ![vscode5](https://i.imgur.com/dkXNRWW.png) \n7. Run project by pressing F5\n    ![vscode6](https://i.imgur.com/4ESu7QX.png) \n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVisual Studio Installation: (\u003ca href=\"https://imgur.com/gallery/B6VY4PZ\"\u003eSimple installation page\u003c/a\u003e)\u003c/summary\u003e  \n\u003cb\u003enote\u003c/b\u003e : This example is run on Visual Studio 2019, it should run just fine on 2017 too.  \n  \n1. Download the project and extract\n2. Inside the extracted folder open the \"Memake_VisualStudio.sln\"  \n    ![vs1](https://i.imgur.com/zAySyOA.png)  \n3. Press \"Local Windows Debugger\" to compile and run project   \n    ![vs2](https://i.imgur.com/kIdD6zO.png) \n4. See result  \n    ![vs3](https://i.imgur.com/i44HiFl.png)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDev-C++ Installation: (\u003ca href=\"https://imgur.com/a/9dTH38w\"\u003eSimple installation page\u003c/a\u003e) \u003c/summary\u003e\n \n    \n1. Download the project and extract\n2. Inside the extracted folder click \"project.dev\" to open the project in Dev-C++  \n    ![devc++1](https://i.imgur.com/H7ocRax.png)  \n3. Press \"Compile and Run (F11)\" to compile and run project   \n    ![devc++2](https://i.imgur.com/SO7AwoU.png) \n4. See result  \n    ![devc++3](https://i.imgur.com/Htd0B13.png)\n\u003c/details\u003e\n\n\n## Example Codes\n\n### Animation with Keyboard \n\u003cimg src=\"https://i.imgur.com/TFwBkr5.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nint x = 350;\nint y = 350;\n\nvoid draw() {\n    mmk.drawRect(x, y, 100, 100, Colmake.red);  // draw rectangle with a red color\n    \n    // get keyboard's key pressed  \n    switch(mmk.readKeyInput()) {\n        case 'd':\n            x++;\n            break;\n        case 'a':\n            x--;\n            break;\n        case 's':\n            y++;\n            break;\n    \tcase 'w':\n            y--;\n            break;\n\t}\n}\n\nint main()\n{\n    mmk.update(draw);\n\n    return 0;\n}\n```  \n\t\n\u003c/details\u003e\n  \n### Animation with Mouse \n\u003cimg src=\"https://i.imgur.com/MTdYxTl.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nint x = 350;\nint y = 350;\n\nvoid draw() {\n    mmk.drawCircle(x, y, 40, Colmake.yellow);  // draw circle with a yellow color\n    \n    // get mouse position\n    x = mmk.getMousePosX();\n    y = mmk.getMousePosY();\n}\n\nint main()\n{\n    mmk.update(draw);\n\n    return 0;\n}\n\n```  \n\t\n\u003c/details\u003e\n\n### Randomize Screen Background Every X Second \n\u003cimg src=\"https://i.imgur.com/lCdFArn.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nint x = 350;\nint y = 350;\n\nvoid draw() {\n    mmk.drawFractalTree(400, 750, 150, 22, 90, 20, Colmake.cornsilk);\n    \n    // set new background color \n    Color newColor = mmk.generateColor(random(0,255), random(0,255), random(0,255));\n    mmk.setScreenBackgroundColor(newColor);\n    \n    mmk.delay(200);  // delay to slow re-rendering \n}\n\nint main()\n{\n    mmk.update(draw);\n\n    return 0;\n}\n\n```  \n\u003c/details\u003e\n\n### Clamping Ball Animation \n\u003cimg src=\"https://i.imgur.com/dEMaNvI.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nclass Ball {\n    public:\n        int x, y, r;\n        int xdirection = 1, ydirection = 1;\n        \n        Ball(int _x, int _y, int _r) {\n            x = _x;\n            y = _y;\n            r = _r;\n        }\n        \n        void update() {\n            draw();\n            move();\n            checkScreenClamp();\n        }\n        \n        void draw() {\n            mmk.drawCircle(x, y, r, Colmake.beige);\n        }\n        \n        void move() {\n            x += xdirection;\n            y += ydirection;\n        }\n        \n        void checkScreenClamp() {  // check screen's edge to change ball's direction\n            if (x \u003c= 0 || x \u003e= mmk.getScreenW()) {\n                xdirection *= -1;\n            }\n        \t\n            if (y \u003c= 0 || y \u003e= mmk.getScreenH()) {\n                ydirection *= -1;\n            }\n        }\n};\n\nint main()\n{\n    Ball ball(230, 520, 40);\n\t\n    // use lambda to utilize local scope instead of define everything as global variable\n    mmk.update([\u0026](){\n        ball.update();\n        \n        mmk.delay(1);\n    });\n\n    return 0;\n}\n\n\n```  \n\u003c/details\u003e\n\t\n### Generate Custom Polygon \n\u003cimg src=\"https://i.imgur.com/ZsuLCKI.png\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nvoid draw() {\n    Vector2 polygon[] = {{117, 173}, {200, 300}, {364, 351}, {528, 144}, {414, 203}, {355, 63}, {277, 172}, {217, 51}, {203, 195}};\n    mmk.drawPolygon(polygon, 9, mmk.generateColor(255,102,0));  // 9 is the number of edges desired to be drawn\n}\n\nint main()\n{\n    mmk.update(draw);\n\n    return 0;\n}\n```  \n\u003c/details\u003e\n\t\n### Polygon Generator Randomizer  \n\u003cimg src=\"https://i.imgur.com/HVtGYwv.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\nusing namespace std;\n\nMemake mmk(800, 800, \"memake\");\n\nvoid draw() {\n    Vector2 polygon[] = {\n        {random(400, 500), random(300, 800)}, \n        {random(200, 300), random(200, 300)}, \n        {random(400, 500), random(300, 800)}, \n        {random(200, 300), random(200, 300)}, \n        {random(200, 300), random(200, 300)}, \n        {random(200, 300), random(200, 300)}, \n        {random(200, 300), random(200, 300)}, \n        {random(200, 300), random(200, 300)}, \n        {random(200, 300), random(200, 300)},\n        {random(600, 700), random(400, 600)},\n        {random(500, 700), random(400, 500)},\n        {random(600, 600), random(400, 700)}\n    };\n\t\t\n    mmk.drawPolygon(polygon, random(7,12), Colmake.khaki); \n    \n    mmk.delay(600);\n}\n\nint main()\n{\n    mmk.update(draw);\n\n    return 0;\n}\n\n```  \n\u003c/details\u003e\n\t\n### Bouncing Balls Screensaver \n\u003cimg src=\"https://i.imgur.com/TsoSPBT.gif\" width=\"35%\"\u003e\n\u003cdetails\u003e\n\u003csummary\u003eCode snippet\u003c/summary\u003e  \n    \n```c++\n#include \"Memake/Memake.h\"\n#include \u003cmath.h\u003e\n\nMemake mmk(800, 800, \"memake\");\n\nusing namespace std;\n\nclass Ball {\n    public:\n        int x, y, r;\n        int dx = 1, dy = 1;\n\n        Ball(int _x, int _y, int _r) {\n            x = _x;\n            y = _y;\n            r = _r;\n        }\n\n        void update() {\n            draw();\n            checkClamp();\n            move();\n        }\n\n        void draw() {\n            mmk.drawCircle(x, y, r, Colmake.beige);\n        }\n\n        void checkCollision(Ball \u0026b) {\n            int distX = x - b.x;\n            int distY = y - b.y;\n\n            float distance = sqrt((distX * distX) + (distY * distY));\n\n            if (distance \u003c r + b.r) {\n                dx *= -1;\n                dy *= -1;\n            }\n        }\n\n        void move() {\n            x += dx;\n            y += dy;\n        }\n\n        void checkClamp() {\n            if (x \u003c= 0 || x \u003e= mmk.getScreenW()) {\n                dx *= -1;\n            }\n            if (y \u003c= 0 || y \u003e= mmk.getScreenH()) {\n                dy *= -1;\n            }\n        }\n\n};\n\nint main()\n{\n    int numOfBall = 24;\n    Ball b[] = {\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n\tBall(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), \n\tBall(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10), Ball(random(0, 800), random(0, 800), 10),\n        Ball(random(0, 800), random(0, 800), 10)\n    };\n\n    mmk.update([\u0026](){\n        for (int i = 0; i \u003c numOfBall; i++) {\n            for (int j = 0; j \u003c numOfBall; j++) {\n                // check collision between one ball to others, but don't check collision to itself\n                if (j != i) {\n                    b[i].checkCollision(b[j]);\n                }\n            }\n            b[i].update();  // update/move every ball\n        }\n\n        mmk.delay(2);\n    });\n\n    return 0;\n}\n```  \n\u003c/details\u003e\t\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrehwell%2Fmemake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrehwell%2Fmemake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrehwell%2Fmemake/lists"}