Giter Site home page Giter Site logo

cinder-nanovg's People

Contributors

notlion avatar pizthewiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

cinder-nanovg's Issues

Context handling in multi-window?

Is an NV context coupled to a GL context? I'm trying to use Cinder-NanoVG for general UI components and want to better understand the scope and management of the NV Context being drawn into.

Font rendering with Cinder-imGui

I'm compiling some code with both Cinder-NanoVG and Cinder-imGui blocks, but the font rendering in imGui became solid blocks as soon as NanoVG is rendering stuff.
screenshot_2017-12-13_03-21-58
Do you have any ideas on resolving this problem?

Best,
origamidance.

position of text drawn

When I draw a string(text) using : ctx->text(pos,text) and choose for example
(0,0) as the position the resulting text rect drawn does not have that position.
In case of (0,0) it gets negative x,y values.

To force the text to be drawn at the intended position I can do:

    // setup preferred position and text
    vec2 intendedPos{0,0};
    string text{"this is a test"};
    Rectf r = ctx->textBounds(0, 0, text);

    // correct text pos
    vec2 correctedPos{intendedPos.x - r.x1, intendedPos.y - r.y1} ;
    // correct rect
    r = ctx->textBounds(correctedPos.x, correctedPos.y, text);

    // draw Text
    ctx->beginPath();
    ctx->fillColor(ColorAf{0.2, 0.2, 0.2});
    ctx->text(correctedPos,text);

Is this intended behaviour or a bug? I believe what's confusing about this is that it behaves
unexpected in context of other cinder stuff.

Texture Proxy Motivation

This is a great wrapper! The shapes look so nice. I'm really looking forward to diving in deeper.

I added a simple ci::Timer to get the number of milliseconds spent per frame in the RenderToTexture sample, and found that the NanoVG performance is generally better than the Texture Proxy performance (on a Mac Pro w/ AMD Firepro card). When running in Release with 512 shapes, I see the following frame times:

Texture Proxies: ~10.0 ms
NanoVG:          ~ 2.8 ms

My guess is that the proxies aren't really worth it unless the underlying shape is very complex.

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.