nanovg-simple: Simple interface to rendering with NanoVG

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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


[Skip to ReadMe]

Properties

Versions0.4.0.0, 0.5.0.0
Change logNone available
Dependenciesbase (>=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]
LicenseBSD-3-Clause
CopyrightCthulhu (c) 2018
AuthorCthulhu
Maintainercthulhu.den@gmail.com
CategoryGraphics
Home pagehttps://github.com/CthulhuDen/nanovg-simple#readme
Bug trackerhttps://github.com/CthulhuDen/nanovg-simple/issues
Source repositoryhead: git clone https://github.com/CthulhuDen/nanovg-simple
Executablesnanovg-simple
UploadedMon Nov 26 20:19:09 UTC 2018 by CthulhuDen

Modules

Flags

NameDescriptionDefaultType
library-onlyEnabledAutomatic

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

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for nanovg-simple-0.5.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

main :: IO ()
main = run 800 600 "Simple app" $ asWindow $
  pure $ translateP 50 0 $ mconcat
    [ fill (Color 1 1 1 1) $ circle (10, 10) 10
    , stroke (Color 1 1 1 1) $ circle (10, 10) 15
    , fill (Color 0 1 0 1) $ $ translateS (-50) 0 $ line (0, 0) (5, 5)
    ]