GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mruby-zest/mruby-nanovg: Fork of mruby-nanovg

BranchesTags
Open more actions menu

Latest commit

 

History

54 Commits
54 Commits

Folders and files

NameName
Last commit message
Last commit date
docstub
docstub
 
 
examples
examples
 
 
include/mrb/nvg
include/mrb/nvg
 
 
mrblib
mrblib
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
mrbgem.rake
mrbgem.rake
 
 

Repository files navigation

mruby-nanovg (WIP)

Mruby Bindings for nanovg.

mrb_config.rb

MRuby::Build.new do |conf|
  #toolchain :gcc
  toolchain :clang # I used clang for testing, you can use gcc

  conf.gembox 'default'
  conf.gem github: 'IceDragon200/mruby-glew'
  conf.gem github: 'IceDragon200/mruby-glfw3'
  conf.gem github: 'IceDragon200/mruby-nanovg'
  conf.gem github: 'take-cheeze/mruby-clang-plugin' # not required, just makes debugging nicer

  conf.cc do |cc|
    cc.include_paths << 'path/to/nanovg/src'
  end

  conf.linker do |linker|
    linker.library_paths << 'path/to/nanovg/build'
    linker.libraries << 'GL'     # for mruby-nanovg and glfw
    linker.libraries << 'GLEW'   # for mruby-glew
    linker.libraries << 'glfw'   # for mruby-glfw3
    linker.libraries << 'nanovg' # for mruby-nanovg
  end
end

Requirements:

In order to build and use the gem, the following gems are required

  • mruby-idextmacros Include this in your build_config include path, it has helper macros used by the gem for creating attribute fields and generic methods
  • mruby-glew
  • mruby-gles

If you wish to try the examples, you'll need mruby-glfw3

Defines

Name Description
MRUBY_NANOVG_GL2 Uses NANOVG_GL2_IMPLMENTATION
MRUBY_NANOVG_GL3 Uses NANOVG_GL3_IMPLMENTATION
MRUBY_NANOVG_GLES2 Uses NANOVG_GLES2_IMPLMENTATION
MRUBY_NANOVG_GLES3 Uses NANOVG_GLES3_IMPLMENTATION

Docs

# to generate docs locally, you'll need c-ruby, rake and yard installed.
rake docs

Gotchas

# text_break_lines is a tricky function to wrap, instead I've opted to handle the row buffering intenrally and yield the params back to the user
context.text_break_lines text, width do |row_string, row_width, min_x, max_x|
  # do stuff with the row_string
end

context.text_glyph_positions(x, y, text) #=> [[x, min_x, max_x]...]

TODO:

  • Bind
    • Nanovg::Context.text_glyph_positions
    • Nanovg::Context.text_break_lines
    • everything else
  • Tests
    • Nanovg
    • Nanovg::Color
    • Nanovg::Context
    • Nanovg::Paint
    • Nanovg::Transform
  • Samples / Examples
    • Port original nanovg ogl2 example

About

Fork of mruby-nanovg

Resources

Readme
Activity
Custom properties

Stars

1 star

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.