reflex-frp/reflex-sdl2

Name: reflex-sdl2

Owner: Reflex FRP

Description: A minimal host for sdl2 based reflex apps.

Forked from: schell/reflex-sdl2

Created: 2017-08-21 21:40:36.0

Updated: 2018-01-23 00:36:10.0

Pushed: 2017-08-27 20:48:34.0

Homepage:

Size: 25

Language: Haskell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

reflex-sdl2

This is a very minimal host for running reflex apps using sdl2.

installation

Writing and running sdl2 apps requires version 2 of the awesome SDL library.

macOS

Using homebrew

brew install sdl2
Ubuntu

The sdl2 bindings require SDL >= 2.0.4, or for special instructions to be followed. Assuming you're on Ubuntu >= 16.04, you can run

apt-get install libsdl2-dev

otherwise please visit the org page above and install via their README.

building
with Stack

This project uses stack for building. From the project directory:

stack build
with Nix

You can also build this using project using Nix4.

There are two ways to proceed.

If you're not a Nix user, the best way to get started would be to clone the reflex-platform somewhere:

git clone https://github.com/reflex-frp/reflex-platform

After that you can ues the work-on script from the project directory to open a shell with an environment set up for developing this project:

PATH_TO_REFLEX_PLATFORM/work-on ghc ./reflex-sdl2.nix

If you're already using Nix, then you can open the same shell with:

nix-shell

In either case, once you are in that shell you can build the project with:

cabal build
examples

You can view an example using the built-in 2d renderer in app/Main.hs. To run the example do:

stack build
stack exec reflex-sdl2-exe

or from a Nix shell:

cabal run reflex-sdl2-exe

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.