nanovg 0.5.1.0 → 0.5.2.0
raw patch · 16 files changed
+62/−18 lines, 16 filesdep ~vector
Dependency ranges changed: vector
Files
- CHANGELOG.md +4/−0
- README.md +2/−0
- cbits/glew.c +7/−0
- cbits/nanovg_gl.c +4/−0
- example/Example.hs +1/−0
- nanovg.cabal +9/−3
- src/NanoVG.hs +1/−0
- src/NanoVG/Internal/Color.chs +1/−0
- src/NanoVG/Internal/FixedVector.hs +3/−0
- src/NanoVG/Internal/GL3.chs +4/−0
- src/NanoVG/Internal/Paint.chs +1/−0
- src/NanoVG/Internal/Text.chs +1/−0
- src/NanoVG/Internal/Transformation.chs +1/−0
- test/Contexts.hs +4/−3
- test/NanoVGSpec.hs +12/−11
- test/Spec.hs +7/−1
CHANGELOG.md view
@@ -1,3 +1,7 @@+0.5.2.0+---+* MacOS support+ 0.5.0.0 --- * Remove dependency on linear
README.md view
@@ -1,5 +1,7 @@ # NanoVG Haskell bindings +[](https://travis-ci.org/cocreature/nanovg-hs)+ Currently only the GL3 backend is supported. A large part of the example bundled with
cbits/glew.c view
@@ -1,3 +1,4 @@+#if !defined(darwin_HOST_OS) #include <GL/glew.h> #include <stdio.h> #include "nanovg.h"@@ -10,3 +11,9 @@ /* return -1; */ } }++#else+void initGlew() {+ // This space intentionally left blank.+}+#endif
cbits/nanovg_gl.c view
@@ -1,5 +1,9 @@ #define NANOVG_GL3_IMPLEMENTATION // This is used to link the implementation+#if defined(darwin_HOST_OS)+#include <OpenGL/gl3.h>+#else #include "GL/glew.h"+#endif #include "nanovg.h" #include "nanovg_gl.h"
example/Example.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE OverloadedStrings #-} module Main where +import Control.Applicative (pure) import Control.Monad import Control.Monad.Loops import Control.Monad.Trans.Maybe
nanovg.cabal view
@@ -1,5 +1,5 @@ name: nanovg-version: 0.5.1.0+version: 0.5.2.0 synopsis: Haskell bindings for nanovg description: Raw bindings to the OpenGL vector graphics library NanoVG homepage: https://github.com/cocreature/nanovg-hs@@ -62,8 +62,12 @@ cbits/nanovg_gl.c cc-options: -DNDEBUG ghc-options: -Wall- extra-libraries: GLU, GL, m, GLEW- ghc-options: -pgml gcc "-optl-Wl,--whole-archive" "-optl-Wl,-lGLEW" "-optl-Wl,--no-whole-archive"+ if os(osx)+ frameworks: OpenGL+ cc-options: -Ddarwin_HOST_OS+ else+ extra-libraries: GLU, GL, m, GLEW+ ghc-options: -pgml gcc "-optl-Wl,--whole-archive" "-optl-Wl,-lGLEW" "-optl-Wl,--no-whole-archive" build-tools: c2hs executable example00@@ -83,6 +87,8 @@ buildable: False default-language: Haskell2010 c-sources: cbits/glew.c+ if os(osx)+ cc-options: -Ddarwin_HOST_OS test-suite nanovg-test type: exitcode-stdio-1.0
src/NanoVG.hs view
@@ -127,6 +127,7 @@ , M23 ) where +import Data.Functor ((<$>)) import Control.Monad import qualified Data.Text as T import Data.Text.Foreign
src/NanoVG/Internal/Color.chs view
@@ -1,5 +1,6 @@ module NanoVG.Internal.Color where +import Control.Applicative (pure) import Foreign.C.Types import Foreign.Marshal.Alloc import Foreign.Ptr
src/NanoVG/Internal/FixedVector.hs view
@@ -1,6 +1,9 @@ {-# LANGUAGE DeriveFunctor, DeriveFoldable, DeriveTraversable #-} module NanoVG.Internal.FixedVector where +import Data.Foldable (Foldable)+import Data.Traversable (Traversable)+ -- | Vector of 2 strict elements data V2 a = V2 !a
src/NanoVG/Internal/GL3.chs view
@@ -11,7 +11,11 @@ -- For now only the GL3 backend is supported #define NANOVG_GL3 -- We need to include this to define GLuint+#if defined(darwin_HOST_OS)+#include <OpenGL/gl3.h>+#else #include "GL/glew.h"+#endif #include "nanovg.h" #include "nanovg_gl.h"
src/NanoVG/Internal/Paint.chs view
@@ -1,6 +1,7 @@ {-# LANGUAGE RecordWildCards #-} module NanoVG.Internal.Paint where +import Control.Applicative (pure) import Foreign.C.Types import Foreign.Marshal.Alloc import Foreign.Marshal.Utils
src/NanoVG/Internal/Text.chs view
@@ -2,6 +2,7 @@ {-# LANGUAGE ScopedTypeVariables #-} module NanoVG.Internal.Text where +import Control.Applicative (pure) import Data.ByteString hiding (null) import qualified Data.Set as S import qualified Data.Text as T
src/NanoVG/Internal/Transformation.chs view
@@ -1,6 +1,7 @@ {-# LANGUAGE ScopedTypeVariables #-} module NanoVG.Internal.Transformation where +import Control.Applicative (pure) import Foreign.C.Types import Foreign.Marshal.Alloc import Foreign.Marshal.Utils
test/Contexts.hs view
@@ -3,11 +3,12 @@ {-# LANGUAGE TemplateHaskell #-} module Contexts where -import NanoVG-import Language.C.Inline.HaskellIdentifier-import qualified Language.C.Inline.Context as C import qualified Data.Map as M+import Data.Monoid+import qualified Language.C.Inline.Context as C+import Language.C.Inline.HaskellIdentifier import qualified Language.C.Types as C+import NanoVG nanoVGCtx :: C.Context nanoVGCtx = mempty { C.ctxTypesTable = M.fromList [(C.TypeName "NVGcolor",[t|Color|])
test/NanoVGSpec.hs view
@@ -3,20 +3,21 @@ {-# LANGUAGE ScopedTypeVariables #-} module NanoVGSpec where -import Control.Monad+import Contexts+import Control.Applicative+import Control.Monad+import qualified Data.Map as M+import Data.Monoid+import Foreign.C.Types+import Foreign.Marshal.Alloc+import Foreign.Ptr+import Foreign.Storable import qualified Language.C.Inline as C import qualified Language.C.Inline.Context as C-import Contexts-import Data.Monoid import qualified Language.C.Types as C-import qualified Data.Map as M-import Foreign.Marshal.Alloc-import Foreign.Ptr-import Foreign.C.Types-import Foreign.Storable-import Test.Hspec-import NanoVG-import Test.QuickCheck+import NanoVG+import Test.Hspec+import Test.QuickCheck C.context (C.baseCtx <> nanoVGCtx) C.include "nanovg.h"
test/Spec.hs view
@@ -1,1 +1,7 @@-{-# OPTIONS_GHC -F -pgmF hspec-discover #-}+module Main where++import Test.Hspec+import qualified NanoVGSpec as NanoVG++main :: IO ()+main = hspec NanoVG.spec