Giter Site home page Giter Site logo

johnnovak / nim-nanovg Goto Github PK

View Code? Open in Web Editor NEW
22.0 5.0 7.0 1.05 MB

Nim wrapper for the NanoVG vector graphics library for OpenGL

License: Do What The F*ck You Want To Public License

C 94.44% Nim 5.56%
canvas graphics nanovg nim nim-lang opengl vector-graphics wrapper

nim-nanovg's Introduction

nim-nanovg

Nim wrapper for the C NanoVG antialiased vector graphics rendering library for OpenGL

Installation

nim-nanovg can be installed via Nimble:

nimble install nanovg

Usage

Have a look at demo.nim in the examples directory. You can build the examples by executing one of the following commands:

nimble examplesGL2
nimble examplesGL2Debug

nimble examplesGL3
nimble examplesGL3Debug

The examples require nim-glfw.

Documentation

The API documentation is in-progress; currently, it's a slightly edited version of the original NanoVG source comments.

You can also check out the NanoVG README for further info.

Notes

Attempting to compile the library on Mac OS X 10.14.5 Mojave / XCode 11.3.1 with the GL2 backend results in compilation errors. I can't be bothered fixing this as GL3 works fine.

License

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details.

nim-nanovg's People

Contributors

johnnovak avatar spotlightkid avatar yglukhov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nim-nanovg's Issues

Project Structure Problems? Error on fresh install

Hi!

It seems that sometimes when I import nanovg and call some procs, I call the wrapper ones directly rather than the ones in nanovg.nim. I doubt that this is it, but isn't the nanovg.nim file and nanovg folder supposed to be inside a src directory and the nimble file have a srcDir = "src"? https://github.com/nim-lang/nimble#project-structure
Maybe this confuses the importer? :/ I doubt it though..

I get silly errors like Error: undeclared identifier: 'nvgCreateContext' and I get the incorrect (the wrapper) API for createImageRGBA requiring a ptr instead of an openArray[byte] which is defined in nanovg.nim.

Things used to work fine, but I reinstalled for testing purposes and now nothing works.

I have tested on Windows, MacOS and Ubuntu and it is the same behavior everywhere :/
nimble install [email protected] with both nim stable and devel.

Examples fail to run

Hi,

Specs:

  • Windows 10 x64
  • Nim devel
  • installed nim-nanovg with nimble install nanovg

I tried building a couple of examples:

  • demo.nim runs and immediately stops without an error
  • example_fbo.nim throws:
Traceback (most recent call last)
...\examples\example_fbo.nim(220) example_fbo
...\examples\example_fbo.nim(144) main
...\examples\example_fbo.nim(22) renderPattern
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Can this be fixed?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.