GithubHelp home page GithubHelp logo

foreverzer0 / glfw Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 1.0 316 KB

Ruby bindings for the excellent GLFW library, implemented as a high-performance C extension, using common Ruby idioms and object-oriented API opposed to a direct analog.

Home Page: https://www.glfw.org/

License: MIT License

Ruby 15.03% Shell 0.03% C 84.94%

glfw's People

Contributors

artob avatar foreverzer0 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

mcptron

glfw's Issues

Fetch dependencies using MSYS2 on Windows

Use MSYS2's (largely undocumented) built-in support for installing package dependencies simply by specifying them in the gemspec, to fetch the native GLFW binary for Windows users.

Vulkan Support

While GLFW is capable of creating Vulkan contexts, and exposing this functionality would be trivial, using Vulkan with Ruby is rather counter-intuitive and not in high-demand, if any demand at all.

This issue is here simply as a reminder for possible future enhancements or feature requests for this functionality, or even just simply for discussion related to it.

make error during install

I'm getting an error during gem install glfw:

Building native extensions. This could take a while...
ERROR:  Error installing glfw:
	ERROR: Failed to build gem native extension.

    current directory: /Users/choxi/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/glfw-3.3.2.0/ext/glfw
/Users/choxi/.rbenv/versions/2.5.3/bin/ruby -I /Users/choxi/.rbenv/versions/2.5.3/lib/ruby/site_ruby/2.5.0 -r ./siteconf20210406-79433-qpmmer.rb extconf.rb
checking for glfwInit() in -lglfw... yes
creating Makefile

current directory: /Users/choxi/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/glfw-3.3.2.0/ext/glfw
make DESTDIR\= clean

current directory: /Users/choxi/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/glfw-3.3.2.0/ext/glfw
make DESTDIR\=
compiling common.c
compiling cursor.c
compiling glfw.c
compiling image.c
image.c:48:12: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    return rb_str_new(img->pixels, len);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/intern.h:775:20: note: expanded from macro 'rb_str_new'
        rb_str_new_static((str), (len)) : \
        ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/defines.h:105:53: note: expanded from macro 'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
                                                    ^
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/intern.h:707:37: note: passing argument to parameter here
VALUE rb_str_new_static(const char *, long);
                                    ^
image.c:48:12: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types with different sign [-Wpointer-sign]
    return rb_str_new(img->pixels, len);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/intern.h:776:13: note: expanded from macro 'rb_str_new'
        rb_str_new((str), (len))          \
        ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/defines.h:105:53: note: expanded from macro 'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
                                                    ^
/Users/choxi/.rbenv/versions/2.5.3/include/ruby-2.5.0/ruby/intern.h:686:29: note: passing argument to parameter here
VALUE rb_str_new(const char*, long);
                            ^
2 warnings generated.
compiling joystick.c
compiling monitor.c
monitor.c:71:28: error: implicit declaration of function 'USHORT2NUM' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_ary_store(r, i, USHORT2NUM(ramp->red[i]));
                           ^
1 error generated.
make: *** [monitor.o] Error 1

make failed, exit code 2

I installed glfw on my Mac via Homebrew:

$ brew info glfw
glfw: stable 3.3.2 (bottled), HEAD
Multi-platform library for OpenGL applications
https://www.glfw.org/
/usr/local/Cellar/glfw/3.3.2 (14 files, 519.1KB) *
  Built from source on 2021-04-06 at 22:02:56
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/glfw.rb
License: Zlib
==> Dependencies
Build: cmake โœ”
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 4,290 (30 days), 11,981 (90 days), 37,655 (365 days)
install-on-request: 3,829 (30 days), 10,698 (90 days), 33,830 (365 days)
build-error: 0 (30 days)

Any idea what the issue might be? Any help or pointers would be appreciated, thanks!

Example(s)

Add example scripts in the repo showcasing basic functionality using modern OpenGL.

Match version releases to native GLFW versions

Starting with the next release, version releases will follow the same pattern as the native GLFW library for a more sane way determining which gem version goes with which library version.

Add method stubs

Create dummy stubs, with documentation, so that linters can take advantage and use them for code completion, inline documentation, etc. in editors and IDEs.

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.