Skip to content

ECburx/Idris2GL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Idris2GL

IdrisVersion

A 2D graphic library for Idris 2, which is inspired by Gloss. IdrisGL uses SDL under the hood, but you won’t need to worry about any of that.

Logo

Contributor Wanted

  • Provides functions to build 2D vector graphics, animations, simulations and games.
  • Supports most keyboard events and mouse events.
  • Frames per second control.
  • Audio and sound effects.

Documentation

Documentation for the IdrisGL

Dependencies

  • SDL2
  • SDL2 Image
  • SDL2 GFX
  • SDL2 TTF
  • SDL2 Mixer
sudo apt update && sudo apt upgrade
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-dev libsdl2-mixer-dev

Install

Install with Pack

  • Assuming you have installed Pack.
  • Make sure to add $HOME/.pack/bin to your $PATH variable.
  • Install all the dependencies using the commands above.
  • pack install idrisGL
Unable to install with Pack?
  • make[1]: idris2: No such file or directory
    Make sure to add $HOME/.pack/bin to your $PATH variable.

  • Errors caused by include <SDL....> or SDL not found.
    Install all the dependencies using the commands above.

  • idris2 -p idrisGL: Can't load the idrisGL library? or idrisGL not found?
    You may have multiple idris2 installed.
    By default, idrisGL is installed to $HOME/.pack. Use $HOME/.pack/bin/idris2 -p idrisGL to load this library.

  • Not on the list?
    Check Pack Nightly Build and report an issue if it is related to IdrisGL.

Install from Source Code

  • git clone https://github.com/ECburx/Idris2GL
  • Navigate to the directory: cd Idris2GL
  • Make sure to add idris2 to $PATH.
  • If you have installed all the dependencies, make install
  • Otherwise, make quickInstall. This will install the dependencies for you.

Import

$ idris2 -p idrisGL to load dependencies.

  • import IdrisGL: basic IdrisGL functions.
  • import IdrisGL.Color: predefined colors.
  • import IdrisGL.Random: unsafe, predictable and limited randomness, for users who need random data to test graphics. (May be removed in the future.)
  • import IdrisGL.SDL: SDL2, SDL2_image, SDL2_gfx, SDL2_ttf bindings.

About

A Graphics Library for Idris 2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published