nanovg-simple: Simple interface to rendering with NanoVG

[ bsd3, graphics, library ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/CthulhuDen/nanovg-simple#readme


[Skip to Readme]
Versions [faq] 0.4.0.0
Dependencies base (>=4.7 && <5), GLFW-b (>=3.2.1.0 && <3.3), monad-loops (>=0.4.3 && <0.5), nanovg (>=0.6.0.0 && <0.7), nanovg-simple, OpenGL (>=3.0.2.2 && <3.1), safe-exceptions (>=0.1.7.0 && <0.2), text (>=1.2.3.0 && <1.3), time (>=1.8.0.2 && <1.10) [details]
License BSD-3-Clause
Copyright Cthulhu (c) 2018
Author Cthulhu
Maintainer cthulhu.den@gmail.com
Category Graphics
Home page https://github.com/CthulhuDen/nanovg-simple#readme
Bug tracker https://github.com/CthulhuDen/nanovg-simple/issues
Source repo head: git clone https://github.com/CthulhuDen/nanovg-simple
Uploaded by CthulhuDen at Sat Nov 17 16:19:27 UTC 2018
Distributions NixOS:0.4.0.0
Executables nanovg-simple
Downloads 157 total (16 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-11-18 [all 1 reports]

Modules

[Index] [Quick Jump]

Flags

NameDescriptionDefaultType
library-onlyEnabledAutomatic

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for nanovg-simple-0.4.0.0

[back to package description]

nanovg-simple

Simple interface to creating window with associated NanoVG context. See nanovg.h for comprehensive listing of methods.

Refer to Graphics.NanoVG.Simple module for utilities to create NanoVG window. Simple example:

import           Graphics.NanoVG.Simple
import qualified NanoVG as NVG

main :: IO ()
main = run 800 600 "Simple app" $ simpleWindow $
  NVG.circle ctx 10 10 10 *> NVG.fill ctx

Also provided is wrapper for rendering combination of composable picture pieces: see Graphics.NanoVG.Picture.

import           Graphics.NanoVG.Picture
import           Graphics.NanoVG.Simple
import qualified NanoVG as NVG

main :: IO ()
main = run 800 600 "Simple app" $ asWindow $
  pure $ translateP 50 0 $ pictures
    [ fill (NVG.Color 1 1 1 1) $ circle (10, 10) 10
    , stroke (NVG.Color 1 1 1 1) $ circle (10, 10) 15
    ]