{"id":15394309,"url":"https://github.com/xyproto/pixelpusher","last_synced_at":"2025-04-15T23:53:22.538Z","repository":{"id":57622869,"uuid":"145105360","full_name":"xyproto/pixelpusher","owner":"xyproto","description":":space_invader: Plot pixels on a 320x200 256c canvas","archived":false,"fork":false,"pushed_at":"2024-01-08T12:26:43.000Z","size":40645,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T03:03:36.116Z","etag":null,"topics":["256-colors","gamedev","go","graphics","pixel-art","rasterization","renderer","sdl2","software-renderer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.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":"2018-08-17T10:08:52.000Z","updated_at":"2024-05-30T13:37:32.000Z","dependencies_parsed_at":"2024-06-19T19:21:25.840Z","dependency_job_id":null,"html_url":"https://github.com/xyproto/pixelpusher","commit_stats":null,"previous_names":["xyproto/multirender"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fpixelpusher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fpixelpusher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fpixelpusher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fpixelpusher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/pixelpusher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["256-colors","gamedev","go","graphics","pixel-art","rasterization","renderer","sdl2","software-renderer"],"created_at":"2024-10-01T15:23:09.670Z","updated_at":"2025-04-15T23:53:22.522Z","avatar_url":"https://github.com/xyproto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pixelpusher\n\n![Build](https://github.com/xyproto/pixelpusher/workflows/Build/badge.svg)\n[![GoDoc](https://godoc.org/github.com/xyproto/pixelpusher?status.svg)](http://godoc.org/github.com/xyproto/pixelpusher)\n[![License](http://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/xyproto/pixelpusher/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/pixelpusher)](https://goreportcard.com/report/github.com/xyproto/pixelpusher)\n\nConcurrent software rendering, triangle rasterization and pixel buffer manipulation.\n\n![screencap](img/screencap.gif) ![triangles](img/triangles.png)\n\n![butterflies](img/butterfly.png) ![glitch effect](img/strobe.png)\n\n![software rendered duck with glitch effect](img/glitch.png) ![software rendered beveled cube](img/cube.png)\n\n## Features and limitations\n\n* Can draw software-rendered triangles concurrently, using goroutines. The work of drawing the triangles is divided on the available CPU cores.\n* Provides flat-shaded triangles.\n* Everything is drawn to a `[]uint32` pixel buffer (containing \"red\", \"green\", \"blue\" and \"alpha\").\n* Tested together with SDL2, but can be used with any graphics library that can output pixels from a pixel buffer.\n* The software rendering of 3D graphics in the screenshot above is provided by [fauxgl](https://github.com/fogleman/fauxgl). The outputs from this can be combined with effects from `pixelpusher`.\n\n## Getting started\n\nThis program imports `pixelpusher`, sets up a callback function for drawing pixels to the `gfx.Pixels` slice, creates a `pixelpusher.Config` struct and then calls the `.Run` function. The window title is `Red Pixel`:\n\n```go\npackage main\n\nimport (\n    pp \"github.com/xyproto/pixelpusher\"\n)\n\nfunc onDraw(canvas *pp.Canvas) error {\n    // x=0, y=0, red=255, green=0, blue=0\n    return pp.Plot(canvas, 0, 0, 255, 0, 0)\n}\n\nfunc main() {\n    // The window title is \"Red Pixel\"\n    canvas := pp.New(\"Red Pixel\")\n    // onDraw will be called whenever it is time to draw a frame\n    canvas.Run(onDraw, nil, nil, nil)\n}\n```\n\nThis program allows the user to press the arrow keys or the WASD keys to move a red pixel around and draw something. Press `ctrl-s` to save the image and press `Esc` or `q` to quit.\n\n```go\npackage main\n\nimport (\n    \"errors\"\n\n    pp \"github.com/xyproto/pixelpusher\"\n)\n\nvar x, y = 160, 100\n\nfunc onDraw(canvas *pp.Canvas) error {\n    return pp.Plot(canvas, x, y, 255, 0, 0)\n}\n\nfunc onPress(left, right, up, down, space, enter, esc bool) error {\n    if up {\n        y--\n    } else if down {\n        y++\n    }\n    if left {\n        x--\n    } else if right {\n        x++\n    }\n    if esc {\n        return errors.New(\"quit\")\n    }\n    return nil\n}\n\nfunc main() {\n    pp.New(\"Simple Draw\").Run(onDraw, onPress, nil, nil)\n}\n```\n\n# General information\n\n* Version: 1.2.1\n* License: BSD-3\n* Author: Alexander F. Rødseth \u0026lt;xyproto@archlinux.org\u0026gt;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fpixelpusher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Fpixelpusher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fpixelpusher/lists"}