Doc/Generated/CMakeLists
#
This file is part of Magnum.
#
Copyright Β© 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
2020, 2021, 2022, 2023, 2024, 2025, 2026
VladimΓr VondruΕ‘ <[email protected]>
#
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
#
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
#
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
#
Matches Corrade requirement, see its root CMakeLists for more information.
cmake_minimum_required(VERSION 3.5...3.10)
project(MagnumDocumentationImageGenerator CXX)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/../../modules/" ${CMAKE_MODULE_PATH})
find_package(Magnum REQUIRED
DebugTools
MeshTools
Primitives
Shaders
Sdl2Application
TextureTools)
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS ON)
if(CORRADE_TARGET_APPLE AND NOT MAGNUM_TARGET_GLES)
find_package(Magnum REQUIRED WindowlessCglApplication)
elseif(CORRADE_TARGET_UNIX)
find_package(Magnum REQUIRED WindowlessGlxApplication)
elseif(CORRADE_TARGET_WINDOWS)
find_package(Magnum REQUIRED WindowlessWglApplication)
else()
message(FATAL_ERROR "No windowless application available on this platform")
endif()
add_executable(colormaps colormaps.cpp)
target_link_libraries(colormaps PRIVATE
Magnum::Magnum
Magnum::DebugTools)
add_executable(easings easings.cpp)
target_link_libraries(easings PRIVATE
Magnum::Magnum)
add_executable(shaders shaders.cpp)
target_link_libraries(shaders PRIVATE
Magnum::Magnum
Magnum::DebugTools
Magnum::MeshTools
Magnum::Primitives
Magnum::Shaders
Magnum::WindowlessApplication)
add_executable(primitives primitives.cpp)
target_link_libraries(primitives PRIVATE
Magnum::Magnum
Magnum::MeshTools
Magnum::Primitives
Magnum::Shaders
Magnum::WindowlessApplication)
add_executable(atlas atlas.cpp)
target_link_libraries(atlas PRIVATE
Magnum::DebugTools
Magnum::TextureTools)
---
Doc/Generated/README
Source files for images in Magnum documentation
-----------------------------------------------
Compile and install Magnum with Sdl2Application, windowless application for
your platform and magnum-distancefieldconverter utility and any PngImporter
and PngImageConverter plugins from Magnum Plugins.
Create build dir, point CMake to this directory and compile the executables:
mkdir build-doc
cd build-doc
cmake ../doc/generated
cmake --build .
Primitive images
Generated by the primitives executable. Run it in this directory, the output
is put into doc/ directory. Apply pngcrush to them for smaller file sizes:
for f in $(ls primitives-*.png); do pngcrush -ow $f; done
Shader images
Generated by the shaders executable. Must be run in this directory, the
output is put into doc/ directory. The executable requires two textures:
- vector.png, generated as full-page PNG output at 96 DPI from vector.svg,
converted to pure grayscale using imagemagick:
mogrify -flatten -background '#ffffff' -colorspace gray vector.png- vector-distancefield.png, generated as full-page PNG output at 384 DPI
(1024x1024) to vector-src.png and then processed through
magnum-distancefieldconverter
magnum-distancefieldconverter --importer PngImporter --converter PngImageConverter --output-size "64 64" --radius 16 vector-src.png vector-distancefield.pngApply
pngcrush to the result for smaller file sizes:for f in $(ls shaders-*.png); do pngcrush -ow $f; done
Distance field vector images
Similarly as above, just with slightly different parameters. Thedistancefield-src.png is generated as full-page PNG output at 192 DPI
(512x512) from vector.svg, the distancefield-dst.png is then converted with
magnum-distancefieldconverter distancefield-src.png distancefield-dst.png --output-size "128 128" --radius 24This is chosen so it corresponds to the TextureTools::DistanceFieldGL doc
snippet where it takes a 256x256 image and converts it to 64x64 with a radius
12, but is scaled twice to look better on HiDPI displays.
---
Doc/Snippets/README
Snippets that possibly generate output for Magnum documentation
###############################################################
"Getting started" image
Displayed by the getting-started executable. Run the app and take screenshot
using Spectacle (including decorations, 880x707). Similarly for the gray
version. The resulting files should be resized to half. pngcrush to them for
smaller file sizes:
pngcrush -ow getting-started.png
pngcrush -ow getting-started-blue.png
The output printed by the application can be used to update the example output
in doc/getting-started.dox.
triangulate.svg, scenedata-tree.svg, scenedata-dod.svg, line-.svg
Created by Inkscape from doc/artwork/triangulate.svg and line-*.svg by
saving as Optimized SVG. On fresh installations you need the scour package
for it:
- enabling all possible options in the dialog, saving
- cleaning up the <svg> header (removing version, xmlns) in an editor
- converting to a style="", keeping viewBox
- adding class="m-image"
- removing all layers that have display: none
In case of the line-quad-data-expansion*.svg andline-quad-data-overlap-*.svg, they're all generated fromdoc/artwork/line-quad-expansion.svg and doc/artwork/line-quad-overlap.svg,
each time with different layers shown.
The doc/artwork/line-quad-data-other.svg is derived fromdoc/artwork/line-quad-data-neighbor.svg by removing the "neighbor" layer and
making the canvas smaller, the doc/artwork/line-quad-data.svg is then derived
from doc/artwork/line-quad-data-other.svg by removing the "other" layer and
making the canvas smaller yet again.
primitives-cube-.svg
Like above, created from doc/artwork/primitives-cube.svg.
---
CONTRIBUTING
Bug reports, feature requests or code contributions are always very welcome.
To make things easier, here are a few tips:
Reporting bugs, requesting features
-----------------------------------
- Best way to report bugs and request new features is to use GitHub
Issues, but you can contact the
team also any other way β see the README for details.
Code contribution
-----------------
- Best way to contribute is using GitHub Pull Requests
β fork the repository and make a pull request from a feature branch. You
can also send patches via e-mail or contact the team in any other way β see
the README for details.
- Follow the project coding guidelines. In short β try to match style of the
surrounding code and avoid any trailing whitespace. When in doubt, consult
Coding Style
guidelines.
- There's a Developers Guide
providing step-by-step checklists for almost every development aspect. It's
not strictly required to follow it to the point, but doing so will save the
maintainers a lot of time during review and merging.
- All your code will be released under the project license (see the
COPYING file for details), so make sure you and your
collaborators (or employers) have no problems with it.
---
README
Magnum β Lightweight and modular C++11 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.
[](https://gitter.im/mosra/magnum?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://circleci.com/gh/mosra/magnum)
[](https://ci.appveyor.com/project/mosra/magnum/branch/master)
[](https://codecov.io/gh/mosra/magnum)
[](https://opensource.org/licenses/MIT)
- Project homepage β https://magnum.graphics/
- Documentation β https://doc.magnum.graphics/
- GitHub project page β https://github.com/mosra/magnum
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.
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.
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.
-------
Wondering if Magnum is a good fit for your project? We prepared
a few case studies
to help you decide.
SUPPORTED PLATFORMS
===================
- 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.
WHAT'S NEW?
===========
Curious about what was added or improved recently? Check out the
Changelog
page in the documentation.
GETTING STARTED
===============
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.
RELATED PROJECTS
================
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.
- Corrade β main Magnum dependency, a multiplatform utility library:
https://github.com/mosra/corrade
- Magnum Bootstrap β bootstrap projects for many use cases, helping you
get up and running in no time: https://github.com/mosra/magnum-bootstrap
- Magnum Plugins β various importer plugins for image, font, audio and
3D model formats are at https://github.com/mosra/magnum-plugins
- Magnum Integration β integration with various external math and
physics, get it at https://github.com/mosra/magnum-integration
- Magnum Examples β examples of engine usage, varying from simple
Hello World-like example to more advanced applications, such as viewer
for complex 3D models. See it at https://github.com/mosra/magnum-examples
- Magnum Extras β playground for testing new APIs, specialized stuff
that doesn't necessarily need to be a part of main Magnum repository or
mutually exclusive functionality: https://github.com/mosra/magnum-extras
- Magnum Bindings β bindings to other languages such as Python are at
https://github.com/mosra/magnum-bindings
- Magnum Singles β various functionality from Magnum available as
easy-to-integrate fast-to-compile single-header libraries:
https://github.com/mosra/magnum-singles
Outside of the project itself, there's also a lot of community contributions
β check them out on the website.
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! 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.
- Project homepage β https://magnum.graphics/
- Documentation β https://doc.magnum.graphics/
- GitHub β https://github.com/mosra/magnum and the
#magnum topic
- GitLab β https://gitlab.com/mosra/magnum
- Gitter community chat β https://gitter.im/mosra/magnum
- E-mail β [email protected]
- Google Groups mailing list β [email protected] (archive)
- Bluesky β https://bsky.app/profile/mosra.cz
See also the Magnum Project Contact & Support page
for further information.
CREDITS
=======
Detailed contributor list
is maintained in the documentation. Big thanks to everyone involved!
There's also a list of third party components
that affect public use of the project.
LICENSE
=======
Magnum is licensed under the MIT/Expat license, see the COPYING file
for details.
---