pixiq

module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: Apache-2.0

README

Pixiq

CircleCI GoDoc Go Report Card

Create Pixel Art games in Golang with fun and ease.

What you can do with Pixiq?

  • draw images on a screen in real time using your favourite Go programming language
  • manipulate every single pixel directly or with the use of tools (blend and clear supported at the moment)
  • handle user input (keyboard and mouse supported at the moment)

What is Pixel Art?

  • is the art of making digital images where the creator place every single pixel of the image
  • it is all about limits: low resolution, limited palette, no rotation besides square angles and only integer scaling
  • no automatic anti-aliasing, no filters, blur and other fancy tools
  • more information can be found in The Pixel Art Tutorial

Installation

  • Go 1.14+
  • Ubuntu/Debian: sudo apt-get install libgl1-mesa-dev xorg-dev gcc
  • CentOS/Fedora: sudo yum install libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel mesa-libGL-devel libXi-devel gcc
  • MacOS: xcode-select --install

Hello world!

$ go mod init hello
$ go get -u github.com/elgopher/pixiq
package main

import (
	"github.com/elgopher/pixiq/colornames"
	"github.com/elgopher/pixiq/glfw"
)

func main() {
	glfw.RunOrDie(func(openGL *glfw.OpenGL) {
		window, err := openGL.OpenWindow(80, 16, glfw.Zoom(5))
		if err != nil {
			panic(err)
		}
		for {
			screen := window.Screen()
			screen.SetColor(40, 8, colornames.White)
			window.Draw()
			if window.ShouldClose() {
				break
			}
		}
	})
}

More examples you can find in examples directory.

Basic primitives

Project status

The project is under heavy development at the moment, and some of its features are experimental/missing and may change in the near future.

The project is using semantic versioning. Current version is 0.X.Y which basically means that future versions may introduce incompatible API changes. More about architecture can be found in architecture document.

Project goals

  • Create Go API which is just fun to use. It will provide tools known from Pixel Art software.
  • Create Development Tools similar to Chrome Developer Tools to support the development process
  • Make it fast - image manipulation requires a lot of computation, therefore Pixiq should be well optimized
  • Create a set of loosely coupled packages which can be used selectively and replaced or extended easily

Directories

Path Synopsis
Package blend provides blend tools using CPU blender := blend.NewSourceOver() blender.BlendSourceToTarget(faceSelection, screen.Selection(10, 24))
Package blend provides blend tools using CPU blender := blend.NewSourceOver() blender.BlendSourceToTarget(faceSelection, screen.Selection(10, 24))
Package clear provides CPU tools for clearing selections using specific color
Package clear provides CPU tools for clearing selections using specific color
Package colornames provides named colors as defined in the SVG 1.1 spec.
Package colornames provides named colors as defined in the SVG 1.1 spec.
Package decoder provides functionality of decoding compressed images such as PNG and GIF.
Package decoder provides functionality of decoding compressed images such as PNG and GIF.
examples
Package gl provides Go abstractions for interacting with OpenGL in a safer and easier way.
Package gl provides Go abstractions for interacting with OpenGL in a safer and easier way.
Package glblend provides blend tools using video card TODO Add Blender with fragment shader as a parameter.
Package glblend provides blend tools using video card TODO Add Blender with fragment shader as a parameter.
Package glclear provides GPU tools for clearing selections using specific color
Package glclear provides GPU tools for clearing selections using specific color
Package glfw makes it possible to use Pixiq on PCs with Linux, Windows or MacOS.
Package glfw makes it possible to use Pixiq on PCs with Linux, Windows or MacOS.
internal
Package internal contains internal stuff of OpenGL which require some unit testing but we don't want to make it public to the external world.
Package internal contains internal stuff of OpenGL which require some unit testing but we don't want to make it public to the external world.
Package goimage provides functions for converting Pixiq image.Selection into standard Go image.Image and vice-versa
Package goimage provides functions for converting Pixiq image.Selection into standard Go image.Image and vice-versa
Package image provides hardware-accelerated Image primitive which can be manipulated in real-time using Pixel-Perfect API.
Package image provides hardware-accelerated Image primitive which can be manipulated in real-time using Pixel-Perfect API.
fake
Package fake provides a fake image.AcceleratedImage implementation which can be used in unit testing.
Package fake provides a fake image.AcceleratedImage implementation which can be used in unit testing.
Package keyboard adds support for keyboard input.
Package keyboard adds support for keyboard input.
Package mouse adds support for mouse input.
Package mouse adds support for mouse input.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL