Giter Site home page Giter Site logo

mosra / magnum-bindings Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 13.0 1.81 MB

Bindings of the Magnum C++11 graphics engine into other languages

Home Page: https://magnum.graphics

License: Other

CMake 12.22% Shell 0.64% C++ 52.56% Python 33.69% Ruby 0.11% Batchfile 0.78%
c-plus-plus-11 opengl webgl graphics-engine game-engine c-plus-plus gamedev python magnum vulkan game graphics

magnum-bindings's Introduction

This repository contains bindings of the Magnum C++11/C++14 graphics engine into other languages such as Python.

Join the chat at https://gitter.im/mosra/magnum Coverage Status MIT License

UNDER CONSTRUCTION

Contents of this repository and documentation is under construction. You can find work-in-progress docs at https://doc.magnum.graphics/python/ but there isn't much to look at yet.

CONTACT & SUPPORT

If you want to contribute to Magnum, if you spotted a bug, need a feature or have an awesome idea, you can get a copy of the sources from GitHub and start right away!

See also the Magnum Project Contact & Support page for further information.

CREDITS

See the CREDITS.md file for details. Big thanks to everyone involved!

LICENSE

Magnum is licensed under the MIT/Expat license, see the COPYING file for details.

magnum-bindings's People

Contributors

cegbertoculus avatar jamesmurphy-mc avatar jlaxson avatar mosra avatar skylion007 avatar sthalik avatar vladimirgamalyan avatar

Stargazers

 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

magnum-bindings's Issues

Build failing in clang on macOS

I'm trying to build habitat-sim, for which magnum-bindings appears to be a dependency. The build is failing with the following error:

FAILED: deps/magnum-bindings/src/python/corrade/CMakeFiles/corrade.dir/containers.cpp.o 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++  -Dcorrade_EXPORTS -I/Users/[REDACTED]/Code/habitat-sim/src/deps -I/Users/[REDACTED]/Code/habitat-sim/src/deps/magnum-bindings/src -I/Users/[REDACTED]/Code/habitat-sim/src/deps/magnum-bindings/src/python -Ideps/magnum-bindings/src/python -I/Users/[REDACTED]/Code/habitat-sim/src/deps/corrade/src -Ideps/corrade/src -isystem /Users/[REDACTED]/Code/habitat-sim/src/cmake/../deps/eigen-git-mirror -isystem /Users/[REDACTED]/Code/habitat-sim/src/cmake/../deps/Sophus -isystem /Users/[REDACTED]/Code/habitat-sim/src/cmake/../deps/rapidjson/include -isystem /Users/[REDACTED]/Code/habitat-sim/src/deps/pybind11/include -isystem /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DVERSION_INFO=\"0.1.2\" -fvisibility=hidden -O2 -g -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -fPIC -fvisibility=hidden   -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -pedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wmissing-prototypes -Wno-shorten-64-to-32 -flto -std=gnu++14 -MD -MT deps/magnum-bindings/src/python/corrade/CMakeFiles/corrade.dir/containers.cpp.o -MF deps/magnum-bindings/src/python/corrade/CMakeFiles/corrade.dir/containers.cpp.o.d -o deps/magnum-bindings/src/python/corrade/CMakeFiles/corrade.dir/containers.cpp.o -c /Users/[REDACTED]/Code/habitat-sim/src/deps/magnum-bindings/src/python/corrade/containers.cpp
In file included from /Users/[REDACTED]/Code/habitat-sim/src/deps/magnum-bindings/src/python/corrade/containers.cpp:34:
/Users/[REDACTED]/Code/habitat-sim/src/deps/magnum-bindings/src/python/corrade/PyBuffer.h:55:95: error: cannot initialize an array element of type 'Py_ssize_t' (aka 'long') with an rvalue of type 'nullptr_t'
        *buffer = Py_buffer{nullptr, nullptr, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr};
                                                                                              ^~~~~~~

It looks like it's only using Python 2.7, which is odd. I have Python 3.7 installed, and CMake even found it:

-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.7.2", minimum required is "3.6") 
-- Bindings being generated for python at /usr/bin/python
-- Found PythonInterp: /usr/bin/python (found version "2.7.10") 
-- pybind11 v2.3.0

Help:binding-python does not exist in some static methods of c++

class Path:Magnum::GL::AbstractFramebuffer class

static void blit(AbstractFramebuffer& source,
AbstractFramebuffer& destination,
const Range2Di& sourceRectangle,
const Range2Di& destinationRectangle,
FramebufferBlitMask mask,
FramebufferBlitFilter filter)
Copy block of pixels.

static void blit(AbstractFramebuffer& source,
AbstractFramebuffer& destination,
const Range2Di& rectangle,
FramebufferBlitMask mask)

Install magnum-bindings for ppc64le architecture

Hi authors,
I'm currently trying to install Habitat-sim on a ppc64le-architecture machine, which requires magnum-bindings library. However, when installing magnum-bindings in ppc64le, I got a lot of troubles and I couldn't resolve them.
Could you please help me on a really proper guide to install this library on a ppc64le-architecture machine? Many thanks in advance and looking forward to hearing from you!

Debian package

Hi I am trying to install magnum so I can use it with python3 on an ubuntu 18.04 machine.

I followed the instructions to install corrade and magnum from https://doc.magnum.graphics/corrade/building-corrade.html#building-corrade-packages-deb and https://doc.magnum.graphics/magnum/building.html#building-packages-deb

I also added -DWITH_SCENEGRAPH=ON to the debian/rules, following https://doc.magnum.graphics/magnum/building.html#building-features

Am I missing something?

Thank you and look forward to hearing back from you!

Python Bindings under Emscripten?

I tried to build the python bindings under emscripten.

Here's how it went:

1. LONG_BIT definition appears wrong

First, a CPython-related compilation error in Python about LONG_BIT mismatch

/usr/local/include/python3.11/pyport.h:601:2: error: "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

This is similar to what other people have been asking in pyodide and in pybind11. The pyodide issue seems to have been fixed in 0.22 but I can't figure out what they did.

I also looked into cross compiling python with wasm/wasi using upstream CPython3.11 - it doesn't raise the LONG_BIT error there.

I guess we are either missing some emscripten compiler configs in the toolchain, or some python build configurations - the system target arch there are called wasm32-unknown-emscripten instead of just emscripten.

Here is the emconfigure command for compiling python with emscripten vs. magnum emscripten toolchain, we probably have to reproduce the effects of these arguments:

emconfigure \
    --host=wasm32-unknown-emscripten \
    --with-emscripten-target=browser \
    --enable-wasm-dynamic-linking=no \

So I ignored it and patched it out to see what's next.

2. Missing Symbols: corrade plugin manager; magnum GL bindings

I suppose the corrade plugins manager doesn't compile because of missing functionality in emscripten, and the gl.cpp binding fails because we only have EGL not GL.

I'm willing to work on adding python support to your bindings as a hobby project of mine - do let me know if you have any tips!

Would it be possible to write bindings to have Python bindings code in the browser?

Rendering without having the main loop owned by magnum

Is it possible to have the main loop owned by the python application?

What I would like to do is something like this:

app = Application()
while True: 
  app.mainLoopIteration()
  # do other stuff

Now this could be achieved by just exposing the mainLoopIteration method on Sdl2Application. However, then the python application would have to check for the exit flag and the flags are not exposed outside the application class.

Is there a way to do this that I'm overlooking or would this have to be implemented? If this would have to be implemented, what do you feel would be the appropriate way to change the api to support such a use case?

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.