Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rostislavjadavan/gofb
Framebuffer library for golang
https://github.com/rostislavjadavan/gofb
framebuffer gamedev-library golang golang-library pixel
Last synced: about 2 months ago
JSON representation
Framebuffer library for golang
- Host: GitHub
- URL: https://github.com/rostislavjadavan/gofb
- Owner: rostislavjadavan
- License: mit
- Created: 2020-04-13T18:10:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-16T10:00:58.000Z (2 months ago)
- Last Synced: 2024-10-17T21:11:06.378Z (2 months ago)
- Topics: framebuffer, gamedev-library, golang, golang-library, pixel
- Language: Go
- Homepage:
- Size: 1.57 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![](logo/gofb_500.png)
# gofb
Framebuffer library for golang
[![Go Report Card](https://goreportcard.com/badge/github.com/rostislavjadavan/gofb)](https://goreportcard.com/report/github.com/rostislavjadavan/gofb)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/rostislavjadavan/gofb)](https://pkg.go.dev/github.com/rostislavjadavan/gofb)## Example
```go
package mainimport (
"github.com/rostislavjadavan/gofb"
)func main() {
// Create Window
w := gofb.NewWindow("go-fb", 600, 600, false)// Create pixel buffer
surface := gofb.NewSurface(600, 600)// Draw pixel into buffer
surface.SetPixel(300, 300, gofb.NewColor3(255, 255, 255))for w.IsRunning() {
w.StartFrame()
w.Clear(gofb.ColorBlack)// Draw buffer on the screen
surface.Draw(0, 0)w.FinalizeFrame()
}defer surface.Release()
defer w.Destroy()
}
```## Features
- draw pixel by pixel
- load `png`, `jpg` images
- scale to mimic pixel art
- use custom `ttf` font
- sprite sheets (for tile set rendering)
- keyboard and mouse input## More examples
Take a look at all the examples in the [/examples](/examples) folder.
![](examples/simple/preview.jpg)
![](examples/animation/preview.gif)
![](examples/tunnel/preview.jpg)
![](examples/mouse/preview.gif)
![](examples/roguelike/preview.jpg)## Libraries used
- https://github.com/go-gl/glfw
- https://github.com/go-gl/gltext## License
[MIT](LICENSE)