Lightweight and modular C++11 graphics middleware for games and data visualization


Magnum — Lightweight and modular C++11/C++14 graphics middleware for games and data visualization

Looking for an open-source library that gives you graphics abstraction and platform independence on major desktop, mobile and web platforms? Do you want it to have all the convenience utilities around yet stay small, powerful and not give up on flexibility? Here it is. And it's free to use, even for commercial purposes.

Join the chat at Build Status Build Status Build Status Coverage Status Hunter Package MIT License

Beauty of simplicity

Among Magnum essentials is a UTF-8-aware OS, filesystem and console abstraction, a feature-packed vector math library and a slim C++11 wrapper of OpenGL / WebGL family of APIs. Build on top of that or opt-in for more.

See all core features

With batteries included

Shaders and primitives for fast prototyping, algorithms, debugging and automatic testing, asset management, integration with popular windowing toolkits and a UI library. Everything fits together but you still have a choice.

List the extra features

Screws are not glued in

There's always more than one way to do things. Enjoy the freedom of choice and integrate your own asset loader, texture compressor, font format or math library, if you feel the need. Or use any of the various plugins.

View extension points

Wondering if Magnum is a good fit for your project? We prepared a few case studies to help you decide.


  • Linux and embedded Linux
  • Windows with MSVC, clang-cl and MinGW, Windows RT (Store/Phone)
  • macOS, iOS
  • Android
  • Web (asm.js or WebAssembly), through Emscripten

Graphics APIs:

  • OpenGL 2.1 through 4.6, core profile functionality and modern extensions
  • OpenGL ES 2.0, 3.0–3.2 and extensions to match desktop OpenGL functionality
  • WebGL 1.0, 2.0 and extensions to match desktop OpenGL functionality

See the Build Status page for detailed per-platform build status.


Curious about what was added or improved recently? Check out the Changelog page in the documentation.


The best way to get started is to read the thorough download, build, install and start using Magnum in your project. There is also a complete building documentation — we provide packages for many platforms, including Windows, Linux and macOS. After that, there are various tutorials and examples and a complete feature guide explaining all aspects of the library.

Apart from that, various Magnum functionality is available through single-header libraries. Just download a file, #include it in your project and you're ready to go! No buildsystem wrangling needed.


The engine itself is kept as small as possible with only a few dependencies. Additional functionality, often depending on external libraries, is provided in separate repositories.

Outside of the project itself, there's also a lot of community contributions — check them out on the website.


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! There is the already mentioned guide about how to download and build Magnum and also a guide about coding style and best practices which you should follow to keep the library as consistent and maintainable as possible.

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


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


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

  • Conan package

    Conan package

    I'm writing a conan recipe for Magnum (already got one for Corrade successfully building). I've wrestled a few days now with these issues (each try takes a lot of time) so I'd thought I'd look for some help/ideas here!


    I'm building conan packages for GCC, Clang (etc.) inside docker containers. In the conan recipe, prior to building magnum, it installs libgl1-mesa-dev (or libgl1-mesa-dev:i386 respectively) on the host. But when later building, it either:

    1. Fails to find OpenGL libs when targeting x86 (for all builds on Ubuntu) if only installing libgl1-mesa-dev:i386:
      CMake Error at /usr/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 
          Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY)

      Above can be fixed* (for all but Ubuntu Trusty) by installing both libgl1-mesa-dev & libgl1-mesa-dev:i386 (in that order, else 1. happens again), but then it:

    2. fails to link OpenGL (error adding symbols: File in wrong format) on Ubuntu Bionic & Cosmic when targeting x86 (it appears link the 64bit lib).

    *There are a lot of issues with multiple mesa-dev packages on the same host.


    • CMake 3.12
    • Ubuntu x64: Trusty (GCC 4.9), Xenial (GCC 5), Artful (GCC 6 & 7, Clang 3.9. 4, 5), Bionic (GCC 8, Clang 6), Cosmic (Clang 7) (using the conan docker images)

    So, any ideas? Anyone seen similar issues? Am I missing something obvious?

    opened by helmesjo 85
  • Problem with configuring CMake

    Problem with configuring CMake

    I`m just getting "Configuring incomplete, errors occurred!". No concrete errors, just nope. I'm trying to configure it for MinGW and I'm receiving this CMakeErrorLog file:

    Determining if the system is big endian passed with the following output:
    Change Dir: C:/Users/Crisser/Desktop/magnum-build/CMakeFiles/CMakeTmp
    Run Build Command:"C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe" "cmTC_08a55/fast"
    C:/PROGRA~2/CODEBL~1/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_08a55.dir\build.make CMakeFiles/cmTC_08a55.dir/build
    mingw32-make.exe[1]: Entering directory 'C:/Users/Crisser/Desktop/magnum-build/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_08a55.dir/TestEndianess.c.obj
    C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe     -o CMakeFiles\cmTC_08a55.dir\TestEndianess.c.obj   -c C:\Users\Crisser\Desktop\magnum-build\CMakeFiles\CMakeTmp\TestEndianess.c
    Linking C executable cmTC_08a55.exe
    "C:\Program Files (x86)\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_08a55.dir\link.txt --verbose=1
    "C:\Program Files (x86)\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_08a55.dir/objects.a
    C:\PROGRA~2\CODEBL~1\MinGW\bin\ar.exe cr CMakeFiles\cmTC_08a55.dir/objects.a @CMakeFiles\cmTC_08a55.dir\objects1.rsp
    C:\PROGRA~2\CODEBL~1\MinGW\bin\gcc.exe       -Wl,--whole-archive CMakeFiles\cmTC_08a55.dir/objects.a -Wl,--no-whole-archive  -o cmTC_08a55.exe -Wl,--out-implib,libcmTC_08a55.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\cmTC_08a55.dir\linklibs.rsp
    mingw32-make.exe[1]: Leaving directory 'C:/Users/Crisser/Desktop/magnum-build/CMakeFiles/CMakeTmp'
    /* A 16 bit integer is required. */
    typedef unsigned short cmakeint16;
    /* On a little endian machine, these 16bit ints will give "THIS IS LITTLE ENDIAN."
       On a big endian machine the characters will be exchanged pairwise. */
    const cmakeint16 info_little[] =  {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x5454, 0x454c, 0x4520, 0x444e, 0x4149, 0x2e4e, 0x0000};
    /* on a big endian machine, these 16bit ints will give "THIS IS BIG ENDIAN."
       On a little endian machine the characters will be exchanged pairwise. */
    const cmakeint16 info_big[] =     {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};
    #ifdef __CLASSIC_C__
    int main(argc, argv) int argc; char *argv[];
    int main(int argc, char *argv[])
      int require = 0;
      require += info_little[argc];
      require += info_big[argc];
      return require;

    Is it part of CMake code? What's happening? I've done everything how explained in your getting started tutorial.

    no action needed 
    opened by Crisspl 31
  • MSVC 2017 ICE in PackingBatch.cpp

    MSVC 2017 ICE in PackingBatch.cpp

    Hello, this might be kind of nitpicking but wanted to know if there is a solution.

    I redirected Corrade::Utility::Debug into an std::stringstream as described in the docs and it works as expected. But the engine startup information is logged before I can initialize anything in my application class (which the mentioned stringstream is a field of). I wonder if there is a way to "salvage" that information.

    I mean I can redirect stdout into a txt file and read the contents into my stringstream. Currently that's what I am doing. It feels kind of hacky, and I don't use the stdout.txt anymore after the initial statup logs are written into it. So it just sits there with the executable. Tried to delete it but since the executable is holding onto it, removing operation fails.

    changelog mention added 
    opened by fauder 27
  • Multi-context/window rendering.

    Multi-context/window rendering.

    Is it possible to use magnum to render to different contexts ?

    I'm using multiple-windows, doing the all the complex rendering from the main context through render to texture. I'm wondering if I can do the quad rendering for the other windows through Magnum or if I should do direct openGL calls.

    no action needed 
    opened by Tryum 24
  • OpenAL extension support

    OpenAL extension support

    Hi @mosra, Hi everybody!

    here is a work-in-progress pullrequest for anything related to Audio and OpenAL extension support.


    • [x] Add support for OpenAL extensions
      • [x] Finish doc
      • [x] Ensure Format Type parameter is a useful config setting. (format type and channels are for the loopback extension, will will not be supported for now.)
      • [x] Tests
    • [x] Implement AL_EXT_float32 and AL_EXT_double
      • Not really anything to test.
    • [x] Add support for the OpenAL soft hrtfs
      • [x] Tests

    Greetings, Squareys

    changelog mention added 
    opened by Squareys 22
  • [MSYS2/Mingw-w64/Clang] duplicate section has different size

    [MSYS2/Mingw-w64/Clang] duplicate section has different size

    I'm trying to compile the project, but using Clang (via a CMake toolchain file). Compiling prints a linking warning :

    C:/msys64/mingw64/lib/libMagnumGlfwApplication-d.a(GlfwApplication.cpp.obj): duplicate section ".rdata$_ZTSN6Magnum8Platform15GlfwApplicationE[_ZTSN6Magnum8Platform15GlfwApplicationE]" has different size. 

    Forcing the usage of LLVM's LLD with -fuse-ld=lld gives me this error :

    lld-link: error: duplicate symbol: typeinfo name for Magnum::Platform::GlfwApplication
    >>> defined at CMakeFiles/appExec.dir/src/main.cpp.obj
    >>> defined at libMagnumGlfwApplication-d.a(GlfwApplication.cpp.obj)

    My toolchain file is as simple as :

    SET (CMAKE_C_COMPILER "clang")
    SET (CMAKE_CXX_COMPILER "clang++")
    SET (CMAKE_C_FLAGS "-fuse-ld=lld")

    I've tried this using the official Magnum MSYS2 package, but also with the latest HEAD (local compilation of Corrade + Magnum). Same issue with both SDL2 and GLFW.

    I've had absolutely no issue nor warnings with GNU tho.

    Am I doing something wrong here ?

    changelog mention added 
    opened by Amphaal 21
  • Plaftorm: Add cursor management support

    Plaftorm: Add cursor management support

    Platform support:

    • [x] ~AndroidApplication~ It's rarely used
    • [x] GlfwApplication
    • [x] Sdl2Application
    • [x] ~GlxApplication~
    • [ ] ~EmscriptenApplication~ It'll be made by mosra
    • [x] ~XEglApplication~

    The main usage for this (that is the main reason on why I implemented this) is for the ImGuiIntegration, because right now when hovering the edges of the windows/other draggable elements the cursor doesn't change due to the lack of this feature.

    I'm not entirely sure about how good it's implemented, e.g. the way I constructed the array using the last enum element to get the size, and the whole switch-case that I needed to make (yeah, basically everything).

    Also, I was thinking about adding the cursor creation in the Application constructor as well, using the Configuration class, but even there I was unsure if it was a good idea or not.

    changelog mention added 
    opened by melix99 21
  • 2018.10 release

    2018.10 release

    After releasing 2018.04 I decided to have a bit more time to pull bigger features in and so 2018.06 was skipped. I don't want to take the release too long, ~~so I'd like to have 2018.08 as the next release -- i.e., before the end of August.~~ ha no chance.

    What needs to be done:

    • [x] Everything that's in the 2018.0c milestones and hasn't been postponed (this issue + the stuff below)
      • [x] Provide some basic format / ... enum translation? (#234)
      • [x] Look into the "corrade module dir not found" fiasco with emscripten and try to find a proper solution (
      • [x] Cubic Hermite Splines (#267)
    • [x] Spline import in glTF -- mosra/magnum-plugins@0c55e3150213a19b5409c18e02c88f77a83cc06e
    • [x] quaternion normalization in glTF -- mosra/magnum-plugins@0ce845678c735845b71cf8b0e8c170491392eda0
    • [x] AnimationData should have trackTarget() and trackTargetType() because everything else in Trade is like that (instance() and instanceType()). Changing this later would be bad. -- e43d5790f606c8b13f29fde4a53a6a48361dd937
    • [x] File callbacks for Trade::AbstractImporter (mosra/magnum@d6189cb74f1b9089fd62c8db559c8e93135d393c)
    • [x] Finish initial animation support and merge it to master (#191)
    • [x] glTF animation import (mosra/magnum-plugins#46)
    • [x] Improve default visuals of Emscripten apps (mainly: make them responsive and in-line with website design) -- mosra/magnum@b2cb689cdc2156608bfeda06e6bfc76e89a19eac, mosra/corrade@8769546495b70d4ddef343291a7e9e02abc76a71
    • [x] Create some advanced viewer/player app in the extras repository that's able to load models and play back their animations -- very important to actually verify both the usability of the API and correctness of its behavior (mosra/magnum-extras#6)
    • [x] Inline math rendering is broken on the website (what the heck did I break this time?!) -- stale cache file, is okay now
    • [x] Make the initial Vulkan lib properly compiling on Windows (together with CI setup) -- done in d578d4d89e5f5b9ab0c73d1567bfafa19f530093 and 6f2b11595393542957ddb20ff3606a13fb9c0266
      • [x] Integrate the barebones Vulkan Triangle example -- mosra/magnum-examples@41c78efc69b2e8d2d0a85f0a45ceed2dc40b816d
    • [x] ~~Finish~~ Initial HiDPI support (#243)
      • [x] Make Ui DPI-aware -- mosra/magnum-extras@87beabb3f8c885ef04165893a810fae98500ac92
      • [x] GLFW support -- dba35bac7a9c170931c476719e4781e501c92a65
      • [x] Re-upload webgl showcase to be DPI-aware
      • [x] ~~Windows support~~ postponed, nobody complained yet :trollface:
    • [x] AssimpImporter "no root node" updates broke DART -- import the root node if there is just the root node -- mosra/magnum-plugins@93ac419df2072d1bd895682182fa86361e3573e2
    • [x] Alpha masking in Phong is broken, color intensity should not be affecting alpha channels -- mosra/magnum@a1ef8550d36ba46be929e0078557b01c300e78f6
    • [x] Clarify difference between rotationScaling() and rotation() (and uniformScaling()) in the docs (with math eqs) (086ed8a278df652b8d72e513bbce8dce6d3eea5e)
    • [x] Use T instead of Vector<1, T> in Range1D -- Animation depends on that heavily and [0] is very ugly ... does that break anything? --
    • [x] ~~Move enums inside plugin interface classes outside so they are easier to type (and add deprecated aliases)~~ postponed
    • [x] ~~CMake 3.12 doesn't seem to play well with Emscripten (on Windows the platform file is ignored, resulting in wrong file suffixes)~~ can't reproduce
    • [x] Oculus SDK 1.4 download fails with 404 now (in case it's not cached by appveyor:, need to fetch a copy of the latest and store it somewhere privately because the upstream downloaded is behind a wall with barbed wire ughhh (mosra/magnum-integration#26)
    • [x] Updates in Find modules so they can find DebugTools and BulletIntegration even without Shapes or other dependencies, even on non-deprecated builds -- 2c56d1600a1fceea9eb8d4518d4b6b3f20769835
      • [x] That unblocks mosra/magnum-plugins#26 -- mosra/magnum-plugins@228e2d43dd5ac2358c4089fb3024ff2e3a420f3b
    • [x] Visibly deprecate old unmaintained functionality, remove it from packages and schedule it for complete removal in ~6 months (#148)
      • [x] the Shapes library (and related stuff in DebugTools and BulletIntegration) -- 8efc6b39e902d01dfac904163ad90385d3007013, mosra/magnum-integration@968fa40c7fe58ae9efced185f91e47d0992589d9
      • [x] the ColladaImporter plugin -- mosra/magnum-plugins@35ee1a2665917c0246b02b108086a7ade88d1f0f
      • [x] the Platform::GlutApplication lib -- mosra/magnum@d70f75a179f05920da5dcf09c61dd268476328bf
    • [x] Fix important reports from -- e7954783530a0fac7f24f81241a3d0e609468638, 471a6d0c28bccaa327d75d30b789f26df62ebdec, c0affdae3ba3c13535617e182fe7074b8f3b3d0f, 7356a1b788579ee4495f0d97da42557cb5478e90, 87a951fc5d3bd5e0672c31a02102bf0b45d08faf and mosra/corrade@623e5c2afa146dc53927897a9d7ce28cc78eeff9
    • [x] Fix build failure of extras on 32-bit windows (the Interconnect library has wrong assumptions about member function pointer sizes with classes using multiple inheritance) (mosra/magnum-extras#7) -- mosra/corrade@b83c116754c92bcf57ccedf113657a75fc11e6f5
    • [x] ~~Do the ugly windows-specific Interconnect/Ui virtual base workaround for mingw as well (seems to be the same ABI, duh)~~ didn't help, postponed (mosra/corrade#51)
    • [x] ~~What about Interconnect and ICF on MSVC?~~ postponed, mosra/corrade#51
    • [x] Make the corrade-rc utility not depend on the Utility library to avoid the most common build issues -- mosra/corrade@fb56f72eb24fa846313f662a37558cbbaf5c4221
    • [x] Provide clearer documentation for using custom buildsystems (#268)
    • [x] Mention potential pitfalls and differences among various primitives (mosra/magnum-examples#48)
    • [x] Update the magnum-bootstrap repository with fresh CMake modules once also GLFW HiDPI support is done
    • [x] Support for multiple primitives per object in the glTF importer (
    • [x] Disabled-by-default workaround to allow cinematic animations in the glTF importer -- mosra/magnum-plugins@2ee3000994ba9bf1cd2e3b3c961490bc1cb6f234
    • [x] Linear gradient primitive
    • [x] Investigate and work around MSVC 2017 ICE with Color.h -- fixed in b44166b23818bba62e6a0e4e7bcc4e6cd95c81ca
    • [x] ~~Fix license detection on GitHub~~ don't know, don't care
    • [x] https my shit

    What should be done (very good for marketing, but it's not extremely critical if this misses the milestone):

    • [x] Integrating the mouse controls example (mosra/magnum-examples#46)
    • [x] Integrating the Box2D example that I have in my e-mail inbox since March and didn't get to it yet (sorry) -- mosra/magnum-examples@62d4712df4e746c995c1c147a223eaa88f7c8f7b
    • [x] ~~Integrate minimp3 for MP3 audio import~~ postponed, #146
    • [x] ~~Investigate OpenAL support on Android (#149)~~ postponed, needed in October earliest
    • [x] Merge JpegImageConverter to support more screenshot options (mosra/magnum-plugins#26)
    • [x] ~~Simple animated example showing difference between quaternion slerp/lerp~~ postponed, #102
    • [x] ~~Simple animated example showing floating point drift (angle, matrices, quats, renormalized quats)~~ postponed, #102
    • [x] Example gallery with images instead of a boring list (should be possible thanks to latest updates to m.css doxygen theme) -- (
      • [x] The same for utilities

    ~~These lists might grow later.~~ ugh NO, ENUFF

    Apart from that there's a lot of other not-as-important things to add, but since I won't have time to anything extra, I won't list them here. As always, help is greatly appreciated -- and if anybody is willing to contribute, their name will be prominently mentioned in the release notes :)

    changelog mention added 
    opened by mosra 20
  • Next release

    Next release

    There's a lot of new stuff which should be made into official release as soon as possible in order to keep the changelog in sane size.

    A (hopefully not very growing) list of things to do:


    • [x] At least somewhat usable MSVC 2015 support (#96)
    • [x] ~~Update~~ Get rid of compatibility branch
    • [x] ~~Revive (P)NaCl support as GCC 4.4 support was dropped~~ later
    • [x] Publicly available and green CI for all platforms (#99)
    • [x] Code coverage on
    • ~~Put documentation on (fixed some other way, see #113)
    • [x] Fix currently pending issues and TODOs
    • [x] Stabilize new APIs
    • [x] ~~Drop stuff that's long deprecated~~ after the release
    • [x] Update copyright year to 2017
    • [x] Make changelogs part of Doxygen docs


    • [x] Add planned --skip-tests, --skip-benchmarks and --no-xfail options to TestSuite tester executables (mosra/corrade@c9208a8b13863f117b7f49576d2abbddd756f8e9, mosra/corrade@00249f263d18aa912e240e38a1cba8922ec37c60)
    • [x] Something's wrong with recent Emscripten builds (Utility::Resource) (mosra/corrade@a330b4a78d697bb8a7deae89ba6f292a4433a282)
    • [x] Update TestSuite documentation to mention colored output, instanced tests, repeating and benchmarks (mosra/corrade@f37f624e6207a2f91e33f819a9f755a26257c7c8)
    • [x] ~~Plugin initialization/finalization is broken by design (e.g. unloading HarfBuzzFont finalizes FreeType library)~~ postponed

    Core lib:

    • [x] ~~Finish~~ Fix pixel storage support so it passes the tests at least on one platform (#104)
    • [x] magnum-imageconverter utility
    • [x] ~~"OpenGL 2015" and OpenGL ES 3.2 support (just a few new function aliases)~~ postponed, see #231
    • [x] Finish Windows Store/Phone support (a4d3beb0c3c718ce7cd38a537fc9be7d27235215)
    • [x] ~~WindowlessXEglApplication to be able to run utilities on embedded Linux devices~~ we have WindowlessEglApplication and that should be enough I think
    • [x] Compute shader tests fail on NV (ad962415a211307f1292f2f02f8739dfa4ae4370)
    • [x] Container::Array instances returned from plugin crash on dangling deleter pointer after a plugin is unloaded (mosra/corrade@43397de88223c398b485a512d8c55c64c3b1b4ff)
    • [x] ~~Finish unhandled cases in DebugTools::textureImage()~~ postponed
    • [x] Implement compressed subimage queries to finally have complete textures (affected by a bug on NVidia) (645edecbcdc76902e80634bcc54782544512cf0a)
      • [x] which means adding a clean way for driver workarounds and ability to selectively disable them from command-line (356491e1dfb74df635fe607fc2f75a6989278e1c)
      • [x] and from environment to have all cases conveniently batch-testable (707d1d084d20c5c98814873e7b1dc24cc29623f9)


    • [x] Merge DDS importer (mosra/magnum-plugins#7)
    • [x] Add AnyImageConverter and AnyAudioImporter
    • [x] Make StbImageConverter produce also other image formats (mosra/magnum-plugins@332ba6cec42f7590fcbf7d1ff94aedeac046c39d)
      • [x] Ability to get alias name from plugin manager (mosra/corrade@834ea41c1c2c1fe7d12b6bf62a7efd2ec08b9a1e)
    • [x] ~~Implement StbDxtImageConverter using stb_dxt and (dynamically) use it in DdsImageConverter (should be easy as the other way around is already done)~~ postponed


    • [x] Port Audio example to Emscripten (should be fun)
    • [x] Check what's new in WebGL 2 land (mosra/magnum-examples#12)
    • [x] Picking example broken on Mesa (04983da23a503d68bddcc0ab416c81bf22a9f910 and mosra/magnum-examples@9f05e1c42ae5849f88e8e691ae1b8c86dbe1f933)


    • [x] Stabilize OvrIntegration API and ~~update to 0.7 (mosra/magnum-integration#7)~~ ~~0.8 (mosra/magnum-integration#10, mosra/magnum-examples#19)~~ 1.3 (mosra/magnum-integration#12, mosra/magnum-examples#22), hopefully they will finally stop completely breaking the API with each new release
    opened by mosra 20
  • Rewrite FindOpenAL so it works with add_subdirectory'd OpenAL Soft sources

    Rewrite FindOpenAL so it works with add_subdirectory'd OpenAL Soft sources

    Requested by @hsdk123. Currently the forked upstream FindOpenAL only works with bundled OpenAL Soft binaries, but not with sources.

    EDIT: And also allow DLL copying like with FindSDL and FindGLFW.

    changelog mention added 
    opened by mosra 19
  • Audio features

    Audio features

    Hi @mosra, Hi everybody!

    As discussed, here is a work-in-progress pullrequest for everything related to Audio and SceneGraph.


    • [x] PlayableGroup
    • [x] Playable
    • [x] Listener
    • Adapt audio-example (later)

    Greetings, Squareys

    changelog mention added 
    opened by Squareys 19
  • Cannot compile magnum for Emscripten via vcpkg head due to SDL2 issues

    Cannot compile magnum for Emscripten via vcpkg head due to SDL2 issues


    I am trying to build magnum for Emscripten via vcpkg via: vcpkg install --head corrade magnum[debugtools,gl,primitives,scenegraph,shaders,shaderconverter,shadertools]

    It seems for Emscripten, Magnum uses a separate path that uses SDL_SetVideo, but Vcpkg resolves to SDL2 which means SDL_SetVideo is unavailable. I see in the non Emscripten path, SDL_CreateWindow is used instead which looks like the correct API for SDL2.

    In the portfile for magnum, it seems like vcpkg actually applies a bunch of patches to make SDL match SDL2? See See

    The logs are:

    FAILED: src/Magnum/Platform/CMakeFiles/MagnumSdl2Application.dir/Sdl2Application.cpp.o 
    C:\Source\vcpkg\BuildToolsRepo\__toolPackages\Windows\Cpp\emsdk\upstream\emscripten\em++.bat -DCORRADE_IS_DEBUG_BUILD -IC:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src -IC:/Source/vcpkg/__vcpkg/buildtrees/magnum/wasm32-emscripten-dbg/src -isystem C:/Source/vcpkg/__vcpkg/installed/wasm32-emscripten/include -isystem C:/Source/vcpkg/__vcpkg/installed/wasm32-emscripten/include/SDL2 -g -g -g -std=c++11 -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wmissing-prototypes -Wno-shorten-64-to-32 -MD -MT src/Magnum/Platform/CMakeFiles/MagnumSdl2Application.dir/Sdl2Application.cpp.o -MF src\Magnum\Platform\CMakeFiles\MagnumSdl2Application.dir\Sdl2Application.cpp.o.d -o src/Magnum/Platform/CMakeFiles/MagnumSdl2Application.dir/Sdl2Application.cpp.o -c C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:435:20: error: use of undeclared identifier 'SDL_OPENGL'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:435:31: error: use of undeclared identifier 'SDL_HWSURFACE'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:435:45: error: use of undeclared identifier 'SDL_DOUBLEBUF'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:440:18: error: use of undeclared identifier 'SDL_RESIZABLE'
            flags |= SDL_RESIZABLE;
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:443:21: error: use of undeclared identifier 'SDL_SetVideoMode'
        if(!(_surface = SDL_SetVideoMode(scaledWindowSize.x(), scaledWindowSize.y(), 24, flags))) {
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:671:20: error: use of undeclared identifier 'SDL_OPENGL'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:671:31: error: use of undeclared identifier 'SDL_HWSURFACE'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:671:45: error: use of undeclared identifier 'SDL_DOUBLEBUF'
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:676:18: error: use of undeclared identifier 'SDL_RESIZABLE'
            flags |= SDL_RESIZABLE;
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:679:21: error: use of undeclared identifier 'SDL_SetVideoMode'
        if(!(_surface = SDL_SetVideoMode(scaledWindowSize.x(), scaledWindowSize.y(), 24, flags))) {
    C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp:780:5: error: use of undeclared identifier 'SDL_Flip'; did you mean 'SDL_blit'?
    C:/Source/vcpkg/__vcpkg/installed/wasm32-emscripten/include/SDL2/SDL_surface.h:102:23: note: 'SDL_blit' declared here
    typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
    11 errors generated.
    em++: error: 'C:/Source/vcpkg/BuildToolsRepo/__toolPackages/Windows/Cpp/emsdk/upstream/bin\clang++.exe -target wasm32-unknown-emscripten -fignore-exceptions -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=22 -IC:\Source\vcpkg\BuildToolsRepo\__toolPackages\Windows\Cpp\emsdk\upstream\emscripten\cache\sysroot\include\SDL --sysroot=C:\Source\vcpkg\BuildToolsRepo\__toolPackages\Windows\Cpp\emsdk\upstream\emscripten\cache\sysroot -Xclang -iwithsysroot/include\compat -DCORRADE_IS_DEBUG_BUILD -IC:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src -IC:/Source/vcpkg/__vcpkg/buildtrees/magnum/wasm32-emscripten-dbg/src -isystem C:/Source/vcpkg/__vcpkg/installed/wasm32-emscripten/include -isystem C:/Source/vcpkg/__vcpkg/installed/wasm32-emscripten/include/SDL2 -g3 -g3 -g3 -std=c++11 -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wmissing-prototypes -Wno-shorten-64-to-32 -MD -MT src/Magnum/Platform/CMakeFiles/MagnumSdl2Application.dir/Sdl2Application.cpp.o -MF src\Magnum\Platform\CMakeFiles\MagnumSdl2Application.dir\Sdl2Application.cpp.o.d -c C:/Source/vcpkg/__vcpkg/buildtrees/magnum/src/1e116134c5-105b238d76.clean/src/Magnum/Platform/Sdl2Application.cpp -o src/Magnum/Platform/CMakeFiles/MagnumSdl2Application.dir/Sdl2Application.cpp.o' failed (returned 1)
    opened by kokulshan 2
  • Provide a passthrough access to image data from scene importers

    Provide a passthrough access to image data from scene importers

    Hello !

    We would like to thread the importing of images attached to an imported scene file, that we currently get mainly through AbstractImporter::image2D() function. Being able to thread it would be cool as it turns out this is one of the main bottlenecks when loading different kinds of scenes.

    As a simple solution, we thought a image2DData() function could be provided as an alternative to image2D(), but maybe you have other better ideas. Giving a quick try this approach seemed easy enough to implement and can be made to work with both embedded files and separate files, although the ownership of what it returns is an open question in that case 😄.

    If you have a precise idea of how to approach this but don't have time, I could help, so let us know 😅


    opened by hugoam 1
  • Anti-aliased wide line rendering shader and related MeshTools

    Anti-aliased wide line rendering shader and related MeshTools

    Certain parts are still subject to ongoing research, so the code contains a lot of commented-out stuff. TODOs left:

    • [ ] Create a MeshTools utility that converts an arbitrary Lines / LineLoop MeshData to a list of quads to be fed to the shader, flexible enough to support packed vertex colors as well (or none at all)
      • [ ] And lower-level utilities
    • [ ] Configurable line join (miter, round, bevel)
    • [ ] Configurable line join angle at which it flips from a miter to a bevel
    • [ ] Investigate the overlapping vertex layout to save 66% of the data
      • [ ] Investigate quad instancing to save 84% (?) of the data
    • [ ] Look into the remaining (literal) corner cases / artifacts
      • [ ] Line gets thinner at certain acute joint angles
      • [ ] Edge / smoothing factor calculation for joints
      • [ ] Android WebGL browser shows a strange extra artifact in the demo
    • [ ] Expand to 3D
    • [ ] UBO and multidraw support
    • [ ] Manually CSE the shader code
    • [ ] ES2/WebGL1 support? Would need a manual gl_VertexID input, should I still bother?
    • [ ] Tests
    • [ ] Documentation

    A gradually-updated demo is at

    opened by mosra 0
  • magnum example code can't find SDL2 file

    magnum example code can't find SDL2 file

    I'm trying to build the box2d example from the website and encountering an error in one of the early includes:

    #include <Magnum/Platform/Sdl2Application.h>

    which complains about not finding "SDL_keycode.h", which is present on my system with the other SDL2 files. I'm wondering if this is just a problem with my CMake configuration:

    cmake_minimum_required(VERSION 3.11) # FetchContent is available in 3.11+
    find_package(Magnum REQUIRED Sdl2Application) 

    Do I need to do anything else to pull in the relevant SDL2 files?

    opened by strattonbrazil 1
  • Add constexpr to Vector{2,3,4} and Vector<N, T>

    Add constexpr to Vector{2,3,4} and Vector

    Let's sprinkle constexpr with reckless abandon.

    I'm still writing tests for all vector operators and subclasses. Would like your comments as to whether this is a reasonable approach.

    opened by sthalik 5
Vladimír Vondruš
Trying to make the world a better place.
Vladimír Vondruš
Alpha Plot is a free application for Scientific Data Analysis and Visualization for Windows, Linux and Mac OS X

Alpha Plot is a free application for Scientific Data Analysis and Visualization for Windows, Linux and Mac OS X (probably BSD also). Web Link Website

Arun Narayanankutty 171 Dec 26, 2022
Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal

Low Level Graphics Library (LLGL) Documentation NOTE: This repository receives bug fixes only, but no major updates. Pull requests may still be accept

Lukas Hermanns 1.5k Jan 8, 2023
A terminal-based graphics library for both 2D and 3D graphics.

TermGL A terminal-based graphics library for both 2D and 3D graphics. Written in C, created for terminals supporting ANSI escape codes. Table of Conte

null 215 Dec 28, 2022
kaun is a replacement for löve's built-in module intended for 3D graphics

kaun kaun is a replacement for löve's built-in module intended for 3D graphics. It is a Lua module you can require from a shared library

Joel Schumacher 4 Apr 5, 2021
This repo contains the DirectX Graphics samples that demonstrate how to build graphics intensive applications on Windows.

DirectX-Graphics-Samples This repo contains the DirectX 12 Graphics samples that demonstrate how to build graphics intensive applications for Windows

Microsoft 4.9k Dec 26, 2022
Metal-cpp is a low-overhead C++ interface for Metal that helps developers add Metal functionality to graphics apps, games, and game engines that are written in C++.

About metal-cpp is a low overhead and header only C++ interface for Metal that helps developers add Metal functionality to graphics applications that

Бранимир Караџић 164 Dec 31, 2022
Powerful, easy to use, and portable visualization toolkit for mixed 3D and 2D content

Powerful, easy to use, and portable visualization toolkit for mixed 3D and 2D content

Microsoft 138 Jan 8, 2023
HARFANG®3D is an all-in-one 3D visualization library usable in C++, Python, Lua and Go.

HARFANG® 3D engine HARFANG®3D is an all-in-one 3D visualization library usable in C++, Python, Lua and Go. Table of contents About Features Screenshot

HARFANG® 3D 280 Jan 1, 2023
RGL - 3D visualization device system for R using OpenGL

RGL - 3D visualization device system for R using OpenGL INTRODUCTION The RGL package is a visualization device system for R, using OpenGL or WebGL as

null 68 Dec 27, 2022
Binary visualization tool primarily aimed at videogame reverse engineering & research.

binviz Binary visualization tool. Allows you to load a binary and pan/zoom around its content. Each byte (or 4 bytes in 4-byte mode) is represented by

Nick Renieris 31 Dec 6, 2022
Vis: Asynchronous 3D Visualization Tool

English | 简体中文 Vis: Asynchronous 3D Visualization Tool Vis 是一款交互式异步3D可视化工具,旨在让3D视觉和机器人应用开发更简单。 其核心功能包括: 图形绘制 3D模型文件导入 多种交互工具 Gzimo 安装 Linux # 安装必要的依

RVBUST 117 Nov 2, 2022
Mandelbrot set visualization in OpenGL

Mandelbort-Set done in OpenGL Steps to build and run ( program tested only on Linux-Ubuntu 18.04,20.04 ) install the necessary packages- glut,glfw,glm

Paleti Krishnasai 2 Feb 13, 2022
C++14 network/graph visualization library / Qt node editor.

QuickQanava QuickQanava is a C++14 library designed to display graphs and relational content in a Qt/QML application. QuickQanava provide QML componen

null 883 Jan 7, 2023
Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics

Yocto/GL: Tiny C++ Libraries for Data-Oriented Physically-based Graphics Yocto/GL is a collection of small C++17 libraries for building physically-bas

Fabio Pellacini 2.4k Dec 27, 2022
Brand new engine with new and QoL features. Grafex is Psych engine with some additions and Better graphics

Friday Night Funkin' - Graphex Engine Credits: Grafex Mod aka Psych Graphic Rework: Xale - Lead Coding, Artist PurpleSnake - Second Coder Psych Engine

Xale 2 Jan 7, 2023
A modern cross-platform low-level graphics library and rendering framework

Diligent Engine A Modern Cross-Platform Low-Level 3D Graphics Library Diligent Engine is a lightweight cross-platform graphics API abstraction library

Diligent Graphics 2.6k Dec 30, 2022
Dear PyGui 3D Engine (early development) and Graphics API demos.

Marvel This repo is the working location of the eventual Dear PyGui 3D Engine. It also contains several single file examples of creating a triangle wi

Jonathan Hoffstadt 85 Jan 5, 2023
This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Computer Graphics and Computer Vision Description: This repository is used for storing sourcecode related to final project of Computer Graphics and Co

null 10 Jul 8, 2022
Yet another Chip-8 interpreter, this time written in C++ using GLFW and OpenGL as its graphics library 💻

Yet another Chip-8 interpreter, but this time with a beautiful interface ??

Akshit Garg 30 Dec 14, 2022