Giter Club home page Giter Club logo

Comments (5)

Playermet avatar Playermet commented on July 26, 2024

Hi!
I don't have Mac Os X, but i know several solutions that working on Linux Mint.

First way. Put library (libglfw.so in my case) in directory with example files.

-- './libglfw.3.1.dylib' in your case
local glfw = require 'glfw' ('./libglfw.so')

Second way. Using precise path to library.

-- '/opt/local/lib/libglfw.3.1.dylib' in your case
local glfw = require 'glfw' ('/usr/local/lib/libglfw.so')

Third way. Function ffi.load doesnโ€™t use package.cpath, but we can easy solve it.

-- '/opt/local/lib/?.dylib' in your case, and 'libglfw.3.1' as name
-- also, package.cpath may be used instead of libpath
local libpath = '/usr/local/lib/?.so;'
local glfw = require 'glfw' (package.searchpath('libglfw', libpath))

from luajit-glfw.

Sakari369 avatar Sakari369 commented on July 26, 2024

Thanks @Playermet , I got it working with this:

local glfw = require 'glfw' ('/opt/local/lib/libglfw.3.dylib')

Didn't realize you can change the library it points to on the another argument.
Thanks for the quick answer!

Although when trying to run the examples, they just crash on my Os X system, maybe because the rendering is not doing anything? Not sure.

from luajit-glfw.

Playermet avatar Playermet commented on July 26, 2024

Examples should show black screen, without crashes.

Try insert this line before glfw.Init call:

glfw.SetErrorCallback(print)

What printed to the console after run?

from luajit-glfw.

Sakari369 avatar Sakari369 commented on July 26, 2024

Actually now that I test again, the examples work, showing the empty buffer (black with some glitches from the uninitialized memory). Strange. Anyway, I guess this can be closed, thanks!

from luajit-glfw.

Playermet avatar Playermet commented on July 26, 2024

You're welcome!

from luajit-glfw.

Related Issues (5)

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.