{"id":13466325,"url":"https://github.com/micahpearlman/MonkVG","last_synced_at":"2025-03-25T21:32:02.353Z","repository":{"id":661800,"uuid":"304757","full_name":"micahpearlman/MonkVG","owner":"micahpearlman","description":"MonkVG is an OpenVG 1.1 like vector graphics API implementation optimized for game use currently using an OpenGL ES backend that should be compatible with any HW that supports OpenGL ES 2.0 which includes most iOS and Android devices. ","archived":false,"fork":false,"pushed_at":"2024-10-28T18:27:28.000Z","size":67854,"stargazers_count":378,"open_issues_count":10,"forks_count":66,"subscribers_count":38,"default_branch":"master","last_synced_at":"2024-10-29T19:18:11.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micahpearlman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2009-09-12T03:55:27.000Z","updated_at":"2024-10-28T18:27:32.000Z","dependencies_parsed_at":"2024-11-10T21:17:26.586Z","dependency_job_id":"8e76b0a5-2bf6-4d2c-9d3e-2c80e1285a16","html_url":"https://github.com/micahpearlman/MonkVG","commit_stats":{"total_commits":210,"total_committers":16,"mean_commits":13.125,"dds":0.3666666666666667,"last_synced_commit":"194911a03cc5a3695d014b99de946a4153434254"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micahpearlman%2FMonkVG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micahpearlman%2FMonkVG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micahpearlman%2FMonkVG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micahpearlman%2FMonkVG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micahpearlman","download_url":"https://codeload.github.com/micahpearlman/MonkVG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245548087,"owners_count":20633507,"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":[],"created_at":"2024-07-31T15:00:42.458Z","updated_at":"2025-03-25T21:32:02.341Z","avatar_url":"https://github.com/micahpearlman.png","language":"C++","funding_links":[],"categories":["C","2D renderer","etc"],"sub_categories":["Native"],"readme":"MonkVG: An OpenVG implementation\n==================================\n![Tiger](tiger.png)\n\n## Overview\n\nMonkVG is an OpenVG 1.1 *like* vector graphics API implementation currently using an Vulkan 1.1 or OpenGL 3.3 backend that should be compatible with any HW that supports Vulkan or OpenGL.\n\nThis is an open source BSD licensed project that is in active development. Contributors and sponsors welcome.\n\nIt can be found at GitHub http://github.com/micahpearlman/MonkVG\n\nProjects using MonkVG include:\n\n- MonkSVG: A SVG parser and renderer.  https://github.com/micahpearlman/MonkSVG\n- CCSVG: A SVG renderer for Cocos2D. https://github.com/lukelutman/CCSVG\n\n## Whats New\n\n- (11/11/2024) Added Python Bindings.  See `examples/python_opengl.py` for an example.\n- (10/22/2024) Added Vulkan 1.1 backend.  \n- (9/6/2024) Complete refactor of the code base.  Currently only OpenGL 3.3 backend is supported.\n- (2/17/2022) CMake build support and GLFW example.\n- (1/22/2012) Now supports OpenGL ES 1.1 *AND* 2.0 (NOTE: as of 9/6/2024 only OpenGL 3.3 is supported)\n\n\n## Installation\n\nUse git to clone:  \n\n```\ngit clone --recursive https://github.com/micahpearlman/MonkVG.git\n```\n\nExamples requires the GLFW library to be installed.  On MacOS:\n\n```\nbrew install glfw\n```\n\nDebian/Ubuntu:\n\n```\nsudo apt-get install libglfw3-dev\n```\n\nFor MacOS Vulkan support install MoltenVK:\n\n```\nbrew install molten-vk\n```\n\n### CMake Build\n\n```\nmkdir ./build\ncd ./build\n\ncmake ..\ncmake --build .\n\n# run the GLFW example\n./glfw_hello_world \n```\n\n### Python Wheel\n\n```\n# first run the cmake build\ncmake --preset=\"Python OpenGL Debug\" -S . -B ./build \u0026\u0026 cmake --build ./build\n\n# activate the virtual environment \nsource build/venv/bin/activate\n\n# build the wheel\npython3 setup.py sdist bdist_wheel\n```\n\nWheel will be in `dist/` directory.\n\n#### MacOS Arm Notes\n\nThe standard brew glfw library won't work on M1 Mac.  To install the correct version:\n\n```\n# Remove GLFW\nbrew uninstall glfw\n\n# Build GLFW from source\ngit clone https://github.com/glfw/glfw.git \u0026\u0026 \\\ncd glfw \u0026\u0026 \\\ncmake -DCMAKE_OSX_ARCHITECTURES=arm64 . \u0026\u0026 \\\nmake \u0026\u0026 \\\nsudo make install\n```\n## What is implemented\n\n- Most all path segment commands including: moves, lines, bezier curves, elliptical arcs.\n- Robust contour tesselation supporting both fill rules.\n- Very basic stroking.\n- Most paints including: Solid color fill, linear and radial gradients.  \n- Bitmap font rendering.\n- Bitmap image rendering.\n- OpenVG utility library (see vgu.h)\n\t\n## TODO\n- Pattern fills and strokes.\n- Gradient fills on strokes (works for fills).\n- Stroke font rendering (may work just untested).\n- Various blending modes (somewhat working already).\n- Scissoring and masking.\n- Improve stroking geometry generation.\n\n## Probably never support\n- Image filters.\n- Anti-aliasing. (Though this can be supported outside OpenVG.  For example iOS fullscreen AA glRenderbufferStorageMultisampleAPPLE method)\n\n## Extensions\n\nMonkVG was originally created for games, so speed has usually been prefered over quality or full OpenVG compliance.  To improve speed there have been MonkVG specific extensions. See \"vgext.h\" for some of the details.\n\n## Contributors\n\nPaul Holden (Initial Android Port)  \nVincent Richomme (Windows Port)  \nGav Wood (Android and Linux Port) \n\nAlso Luke contributed a great article on how to integrate MonkVG + MonkSWF with Cocos2D: http://blog.zincroe.com/2011/11/displaying-a-swf-on-the-iphone-with-cocos2d-and-monkswf/\n\n## Simple Example\n\nSee `./examples` directory.\n\nNOTE:  MonkVG will not create a OpenGL context, it is the applications responsibility to create there own OpenGL context.\nAlso, if your application does any other OpenGL rendering it should save off the GL state and then restore before calling any MonkVG methods.\n\n```\n\t\nVGPaint _paint;\nVGPath _path;\nvoid init() {\n\t... setup platform specific opengl ...\n\t// setup the OpenVG context\n\tvgCreateContextMNK( 320, 480, VG_RENDERING_BACKEND_TYPE_OPENGLES20 );\n\n\t...OR... for OpenGL ES 1.1\n\n\tvgCreateContextMNK( 320, 480, VG_RENDERING_BACKEND_TYPE_OPENGLES11 );\n\n\t// create a paint\n\t_paint = vgCreatePaint();\n\tvgSetPaint(_paint, VG_FILL_PATH );\n\tVGfloat color[4] = { 1.0f, 0.0f, 0.0f, 1.0f };\n\tvgSetParameterfv(_paint, VG_PAINT_COLOR, 4, \u0026color[0]);\n\n\t// create a box path\n\t_path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,1,0,0,0, VG_PATH_CAPABILITY_ALL);\n\tvguRect( _path, 50.0f, 50.0f, 90.0f, 50.0f );\n}\n\t\nvoid draw() {\n\t... save any GL state here ...\n\t... start opengl context ...\n\n\t/// draw the basic path\n\tvgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);\n\tvgLoadIdentity();\n\tvgTranslate( screenWidth/2, screenHeight/2 );\n\tvgSetPaint( _paint, VG_FILL_PATH );\n\tvgDrawPath( _path, VG_FILL_PATH );\n\n\t... end opengl context ...\n\t... restore and GL state here ...\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahpearlman%2FMonkVG","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicahpearlman%2FMonkVG","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicahpearlman%2FMonkVG/lists"}