An open API service indexing awesome lists of open source software.

https://github.com/demonstrandum/acetone

Haskell 2D Graphics
https://github.com/demonstrandum/acetone

Last synced: 9 months ago
JSON representation

Haskell 2D Graphics

Awesome Lists containing this project

README

          

# Acetone

Haskell library for 2D interactive graphics.

## Overview

- All spatial units are normalised by default. e.g., `0.0` is all the
way to the left/top, and `1.0` is all the way to the right/bottom on the shortest axis.
Pixel units are still supported, and other coördinate transforms are trivial.
A `fromPixels pixels` function is provided.
- The default coordinate system has the origin in the top-left corner.

## TODO

- Resizing the window does not behave properly on Windows.
- Add gradient and texture support.
- Add font/text layouting and rasterization with FreeType.

## Install and Build

### Get Haskell

Windows, macOS and GNU+Linux users can get GHC and Cabal with
[GHCUp](https://www.haskell.org/ghcup/)

### Note to Windows users

This repository/package's structure relies on symlink.
The latest versions of Windows should support this fully.
By enabling Developer Mode on Windows, you should be granted `mklink`
permission.
Symlinks have been supported since Vista, but needed to be
enabled and needed administrator privileges.

You must have Git set up to treat symlinks correctly, by doing as so:
```sh
git config --global core.symlinks true
```
in the Git CLI/Bash application.

### Build and install this package

Once in the repository, having completed the prerequisites, one can:

```sh
cabal update
cabal build
cabal install
```

You may need LLVM intsalled and in your `$PATH` for the build.

## Example

Run the GLFW based test/example program:

```sh
cabal run example
```