{"id":18672105,"url":"https://github.com/dfirebaugh/hlg","last_synced_at":"2025-04-12T01:30:55.748Z","repository":{"id":195446537,"uuid":"692920031","full_name":"dfirebaugh/hlg","owner":"dfirebaugh","description":"a high level graphics api using wgpu","archived":false,"fork":false,"pushed_at":"2024-11-10T14:49:01.000Z","size":2234,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T21:14:36.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfirebaugh.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":"2023-09-18T01:04:42.000Z","updated_at":"2024-11-10T14:49:05.000Z","dependencies_parsed_at":"2023-09-18T02:57:37.294Z","dependency_job_id":"4104e765-ab3a-4309-81ab-ca636b8422a3","html_url":"https://github.com/dfirebaugh/hlg","commit_stats":null,"previous_names":["dfirebaugh/ggez","dfirebaugh/hlg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhlg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhlg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhlg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fhlg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfirebaugh","download_url":"https://codeload.github.com/dfirebaugh/hlg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248504211,"owners_count":21115134,"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-11-07T09:09:30.052Z","updated_at":"2025-04-12T01:30:55.743Z","avatar_url":"https://github.com/dfirebaugh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hlg  (High Level Graphics)\nThis project is a WIP. The goal is to make a high level graphics api for golang.\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/dfirebaugh/hlg.svg)](https://pkg.go.dev/github.com/dfirebaugh/hlg)\nDocumentation: https://dfirebaugh.github.io/hlg/\n\n### Examples\ncheck the `./examples` dir for some basic examples\n\n\n#### Triangle\n\n```golang\npackage main\n\nimport (\n\t\"github.com/dfirebaugh/hlg\"\n\t\"golang.org/x/image/colornames\"\n)\n\nvar triangle hlg.Shape\n\n// update operation need to happen less frequently than render operations\nfunc update() {\n}\n\nfunc render() {\n\thlg.Clear(colornames.Skyblue)\n\ttriangle.Render()\n}\n\nfunc main() {\n\thlg.SetWindowSize(720, 480)\n\thlg.SetScreenSize(240, 160)\n\ttriangle = hlg.Triangle(0, 160, 120, 0, 240, 160, colornames.Orangered)\n\n\thlg.Run(update, render)\n}\n```\n\n![triangle_example](./assets/images/triangle_example.png)\n\n#### Colored Triangle\n\n```golang\npackage main\n\nimport (\n\t\"github.com/dfirebaugh/hlg\"\n\t\"golang.org/x/image/colornames\"\n)\n\nvar triangle hlg.Shape\n\nconst (\n\tscreenWidth  = 240\n\tscreenHeight = 160\n)\n\n// update operations happen less frequently than render operations\nfunc update() {\n}\n\nfunc render() {\n\thlg.Clear(colornames.Skyblue)\n\ttriangle.Render()\n}\n\nfunc main() {\n\thlg.SetWindowSize(screenWidth, screenHeight)\n\thlg.SetTitle(\"color triangle\")\n\n\ttriangle = hlg.PolygonFromVertices(0, 0, 0, []hlg.Vertex{\n\t\t{\n\t\t\tPosition: [3]float32{0, screenHeight, 0},\n\t\t\tColor:    colornames.Red,\n\t\t},\n\t\t{\n\t\t\tPosition: [3]float32{screenWidth / 2, 0, 0},\n\t\t\tColor:    colornames.Green,\n\t\t},\n\t\t{\n\t\t\tPosition: [3]float32{screenWidth, screenHeight, 0},\n\t\t\tColor:    colornames.Blue,\n\t\t},\n\t})\n\n\thlg.Run(update, render)\n}\n```\n\n![color_triangle_example](./assets/images/color_triangle_example.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fhlg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfirebaugh%2Fhlg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fhlg/lists"}