From a54049494e57ff8f7ef94c4753e7e5541ed68ec7 Mon Sep 17 00:00:00 2001 From: Lynix Date: Sat, 12 Feb 2022 10:29:57 +0100 Subject: [PATCH] Rewrite readme --- AUTHORS | 5 -- ChangeLog.md => CHANGELOG.md | 12 ++++- INSTALL.md | 67 +++++++++++---------------- readme.md => README.md | 30 ++++++------ THANKS.md | 24 +++++----- writing style.md | 88 ------------------------------------ xmake/actions/listdeps.lua | 49 ++++++++++++++++++++ 7 files changed, 113 insertions(+), 162 deletions(-) delete mode 100644 AUTHORS rename ChangeLog.md => CHANGELOG.md (98%) rename readme.md => README.md (55%) delete mode 100644 writing style.md create mode 100644 xmake/actions/listdeps.lua diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 24e079909..000000000 --- a/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -Nazara Engine was originally created in early 2012. -It follows a complete overhaul of a previous project in order to offer more features and modularity. - -Jérôme "Lynix" Leclercq - main developper (lynix680@gmail.com) -Full Cycle Games - sponsor and contributor since January 2017. diff --git a/ChangeLog.md b/CHANGELOG.md similarity index 98% rename from ChangeLog.md rename to CHANGELOG.md index 829e42437..405991b8e 100644 --- a/ChangeLog.md +++ b/CHANGELOG.md @@ -1,4 +1,14 @@ -# Upcoming version: +# Nazara-Next (master) + +- Switched from premake to [xmake](https://xmake.io) to build the engine or generate project files +- Remade the renderer and graphics modules with modern techniques and API +- Added Shader module, bringing a custom shader language to the engine +- Removed libsndfile dependency (minimp3, dr_wav and libflac are now used instead) +- Removed NazaraSDK, ECS are now part of regular libraries +- Removed thirdparty library codes, [xmake](https://xmake.io) is now used to handle them. +- Way too many changes to list here + +# 0.5 (last legacy version, unreleased due to next version): Miscellaneous: - Add possibility to excludes with one commande all tests/examples/tools/etc. diff --git a/INSTALL.md b/INSTALL.md index 05c162982..7f972008e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,53 +1,40 @@ -# Installation +# Install -> **Notice**: For french speakers, a more detailed explanation of the instructions is provided here: [Instructions pour compiler](wiki/(FR)-Compiler-le-moteur). +## Build -The first step to using the engine is to recover it. This can currently be done in two ways: -1) This can be don either from the original github (only the development is continuously evolving): -```git clone https://github.com/DigitalPulseSoftware/NazaraEngine.git``` -2) Or by downloading a [zip file](https://github.com/DigitalPulseSoftware/NazaraEngine/archive/master.zip) containing the entire source code of the engine. +First, clone or download the project sources as a .zip -All you have to do is go to the "build/" folder. The compilation system uses [premake](https://premake.github.io/) to generate build systems. +Nazara is based on [XMake](https://xmake.io), a new amazing build system which will download and compile all dependencies it won't find on your computer, even [Qt](https://www.qt.io) if you wish to build the shader nodes editor. -## Windows -For Windows users, they can directly use ".bat" files such as: "Build_VS2017.bat". It will generate a solution "NazaraEngine.sln" ready to use that you can directly build to produce the libs or execute the samples. +Once XMake is installed (note that you can also download a [portable version](https://github.com/xmake-io/xmake/releases) of XMake if you wish not to install it), you'll need to run `xmake config --mode=releasedbg` in the project folder (you can also use `--mode=debug` if you wish to build a debug version of the game). +If you wish to include unit tests or the shader nodes editor, you'll need to add `--tests=y` and `--shadernodes=y` respectively to `xmake config` parameters. -## Linux +XMake will try to find all the project dependencies on your computer and ask you to install the missing ones. -Linux users, can type: "./premake5-linux64 gmake" or with the additional argument "--cc=clang" to configure the C++ compiler used. +### Compile using command-line (first method) -Some additional libraries will be required for compilation depending on the modules used: +Once you're ready to compile the engine itself, run `xmake` (or `xmake -jX` if you wish not to use all your computer threads, with X being the number of threads you wish to use) and watch as the engine compiles. -#### Audio module (OpenAL and libsndfile) +### Generate a project (second method) -- with apt: `sudo apt-get install libopenal-dev libsndfile1-dev` -- with pacman: `sudo pacman -S openal libsndfile` +XMake can also generate a project file for another tool: +- Visual Studio: `xmake project -k vs` +- CMakeLists.txt (which you can open in CLion and more): `xmake project -k cmake` +- Makefile: `xmake project -k make` +- Ninja: `xmake project -k ninja` +- XCode: `xmake project -k xcode` -#### Platform module (Freetype): - -- with apt: `sudo apt-get install libfreetype6-dev` -- with pacman: `sudo pacman -S freetype2` - -#### Utility module (XCB + X11): - -- with apt: `sudo apt-get install libxcb-cursor-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libx11-dev` -- with pacman: `sudo pacman -S libxcb libx11` - -#### OpenGL renderer module: - -- with apt: `sudo apt-get install mesa-common-dev libgl1-mesa-dev` -- with pacman: `sudo pacman -S mesa` - -#### Plugin Assimp: - -- with apt: `sudo apt-get install libassimp-dev` -- with pacman: `sudo pacman -S assimp` - -#### The one line command to install everything is: - -- with apt: `sudo apt-get install libopenal-dev libsndfile1-dev libfreetype6-dev libxcb-cursor-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libx11-dev mesa-common-dev libgl1-mesa-dev libassimp-dev` -- with pacman: `sudo pacman -S openal libsndfile freetype2 libxcb libx11 mesa assimp` +You should now be able to the project file with the tool of your choice. ## Test -One should now be able to execute the samples provided in the folder "NazaraEngine/examples/bin/" or the unit tests within "NazaraEngine/tests/". \ No newline at end of file +To run the examples, unit tests or tools, you can either run them in the project or by using the command-line: + +`xmake run ` with `` being the name of the executable you wish to run. + +Available examples names can be found in the `examples` folder (example: `xmake run PhysicsDemo`). +You can also run unit tests with `xmake run Nazara(Client)UnitTests`. + +## Install + +You can also package the engine in a folder by using `xmake install -o target_folder`, on Unix-based system you can also install it system-wide by running `xmake install`. \ No newline at end of file diff --git a/readme.md b/README.md similarity index 55% rename from readme.md rename to README.md index 038f27371..2bf9467c6 100644 --- a/readme.md +++ b/README.md @@ -6,21 +6,26 @@ Linux | [![Linux build status](https://github.com/DigitalPulseSoftware/NazaraEng # Nazara Engine -Nazara Engine is a fast, complete, cross-platform, object-oriented API which can help you in your daily developer life. -Its goal is to provide a set of useful classes : Its core provides unicode strings, filesystem access, hashs, threads, ... +Nazara Engine is a cross-platform framework aimed at (but not limited to) real-time applications requiring audio, 2D and 3D rendering, network and more (such as video games). -It also provide a set of libraries, such as audio, network, physics, renderer, 2D and 3D graphics engines, ... +Features: +- 2D and 3D rendering using either Vulkan, OpenGL and OpenGL ES (depending on what's available on the target system). +- Its own renderer-agnostic shader language (NZSL - Nazara Shading Language), no need to write specialized GLSL code anymore! +- Easy to customize graphics module providing basis for advanced techniques (such as deferred shading, HDR, PBR rendering and more). +- Audio playback and streaming based on OpenAL. +- 2D and 3D Physics integration (with [Chipmunk](https://chipmunk-physics.net) and [Newton Dynamics](https://github.com/MADEAPPS/newton-dynamics)). +- Optional ECS (Entity-Component-System) classes for helping with entity handling (based on the excellent [entt](https://github.com/skypjack/entt)). +- A [ENet](https://github.com/lsalzman/enet)-based reliable UDP networking protocol. -You can use it in any kind of commercial/non-commercial applications without any restriction ([MIT license](http://opensource.org/licenses/MIT)). +You can use it in any kind of commercial and non-commercial applications without any restriction ([MIT license](http://opensource.org/licenses/MIT)). ## Authors Jérôme "Lynix" Leclercq - main developper () -Full Cycle Games - sponsor and contributor from 2017 to 2020. -## Install +## Build and install -Use the premake build system in the build directory then compile the engine for your platform. +See [INSTALL.md](INSTALL.md) for build instructions. ## How to use @@ -33,21 +38,14 @@ You can find tutorials on installation, compilation and use on the [official wik - Submitting a patch to GitHub - Post suggestions/bugs on the forum or the [GitHub tracker](https://github.com/DigitalPulseSoftware/NazaraEngine/issues) - [Fork the project](https://github.com/DigitalPulseSoftware/NazaraEngine/fork) on GitHub and [push your changes](https://github.com/DigitalPulseSoftware/NazaraEngine/pulls) -- Talking about Nazara Engine to other people +- Talking about Nazara Engine to other people, spread the word! - Doing anything else that might help us ## Links -[Website](https://nazara.digitalpulsesoftware.net) -[Documentation](https://nazara.digitalpulsesoftware.net/doc) [Discord](https://discord.gg/MvwNx73) [Wiki](https://github.com/DigitalPulseSoftware/NazaraEngine/wiki) -[Forum](https://forum.digitalpulsesoftware.net) ## Thanks to: -- **RafBill** and **Raakz:** Finding bugs and/or testing. -- **Fissal "DrFisher" Hannoun**: Helping a lot in architecture design. -- **Alexandre "Danman" Janniaux**: Helping making the POSIX implementation. -- **Youri "Gawaboumga" Hubaut**: Improving the whole project by making the documentation, improving the code, and more. -- **Rémi "overdrivr" Bèges**: Made the Noise module. +See [THANKS.md](THANKS.md) \ No newline at end of file diff --git a/THANKS.md b/THANKS.md index b2821222e..5d77c2fdc 100644 --- a/THANKS.md +++ b/THANKS.md @@ -12,15 +12,15 @@ A special thank you to all those who may have contributed directly or indirectly This engine also uses different projects, we obviously thank their respective authors and contributors: -- [Assimp](http://www.assimp.org/): Model loader. -- [Catch2](https://github.com/catchorg/Catch2): Test framework for C++. -- [Chimpmunk](http://chipmunk-physics.net/): Physics engine for 2D. -- [Freetype](https://www.freetype.org/): Font rendering library. -- [Lua](https://www.lua.org/): Scripting library. -- [Netwon](http://newtondynamics.com/forum/newton.php): Physics engine for 3D. -- [Sndfile](http://www.mega-nerd.com/libsndfile/): Audio loader. -- [Stb](https://github.com/nothings/stb): Image loader. -- [Utfcpp](http://utfcpp.sourceforge.net/): UTF-8 handler. -- [OpenAL](https://www.openal.org/): Audio API specification. -- [OpenGL](https://www.khronos.org/opengl/): Graphics API specification. -- [Vulkan](https://www.khronos.org/vulkan/): New graphics API specification which replaced OpenGL. +- [chipmunk2d](https://chipmunk-physics.net/): A fast and lightweight 2D game physics library. +- [dr_wav](https://github.com/mackron/dr_libs): Single file audio decoding libraries for C/C++. +- [entt](https://github.com/skypjack/entt): Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more. +- [freetype](https://www.freetype.org): A freely available software library to render fonts. +- [kiwisolver](https://kiwisolver.readthedocs.io/en/latest/): Efficient C++ implementation of the Cassowary constraint solving algorithm +- [libflac](https://xiph.org/flac): Free Lossless Audio Codec +- [libsdl](https://www.libsdl.org/): Simple DirectMedia Layer +- [libvorbis](https://xiph.org/vorbis): Reference implementation of the Ogg Vorbis audio format. +- [minimp3](https://github.com/lieff/minimp3): Minimalistic MP3 decoder single header library +- [newtondynamics](http://newtondynamics.com): Newton Dynamics is an integrated solution for real time simulation of physics environments. +- [openal-soft](https://openal-soft.org): OpenAL Soft is a software implementation of the OpenAL 3D audio API. +- [stb](https://github.com/nothings/stb): single-file public domain (or MIT licensed) libraries for C/C++ \ No newline at end of file diff --git a/writing style.md b/writing style.md deleted file mode 100644 index 08df4b18a..000000000 --- a/writing style.md +++ /dev/null @@ -1,88 +0,0 @@ -Examples writing-style: - -Alphabetical order for everything and try to regroup each methods beginning with the same letter in the header - -Class header: -```cpp -// Copyright (C) YEAR AUTHOR -// This file is part of the "Nazara Engine - MODULE module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_FILENAME_HPP -#define NAZARA_FILENAME_HPP - -#include -#include -#include - -struct NzPossibleImplementation; - -class NAZARA_API NzClassName -{ - friend NzClassFriend; - - public: - Constructors(); - Destructor(); - - FunctionInAClass(); - - protected: - - private: - NzClass m_variableName; - STL m_variableName; - dataType m_variableName; - - NzPossibleImplementation* m_impl; -}; - -#endif // NAZARA_FILENAME_HPP -``` - -Class source: -```cpp -// Copyright (C) YEAR AUTHOR -// This file is part of the "Nazara Engine - MODULE module" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#include -#include -#include - -struct NzPossibleImplementation {}; - -NzClassName::Constructors() : -m_variableName(init) -{ - testsAndOtherInits; -} - -NzClassName::PublicFunctions() -NzClassName::ProtectedFunctions() -NzClassName::PrivateFunctions() -``` - -Structure: -```cpp -/!\ enum in Enums.hpp - -enum nzEnum -{ - nzEnum_1, - nzEnum_2, - - nzEnum_Max = nzEnum_2 -}; -``` - -Function: -```cpp -FunctionName() -{ - variableName = init; -} -``` diff --git a/xmake/actions/listdeps.lua b/xmake/actions/listdeps.lua new file mode 100644 index 000000000..c6c1fec25 --- /dev/null +++ b/xmake/actions/listdeps.lua @@ -0,0 +1,49 @@ +task("list-deps") + +set_menu({ + -- Settings menu usage + usage = "xmake list-deps [target]", + description = "List dependencies used by the engine or a specific target", + options = + { + {'t', "target", "v", nil, "Target name" } + } +}) + +on_run(function () + import("core.base.option") + import("core.project.project") + import("private.action.require.impl.package") + + local requires, requires_extra = project.requires_str() + if not requires or #requires == 0 then + return + end + + local usedpackages + + local targetname = option.get("target") + if targetname then + local target = project.target(targetname) + usedpackages = target:pkgs() + else + usedpackages = project.required_packages() + end + + local projectdeps = {} + for _, instance in ipairs(package.load_packages(requires, {requires_extra = requires_extra})) do + if usedpackages[instance:name()] then + table.insert(projectdeps, { + name = instance:name(), + desc = instance:description(), + homepage = instance:get("homepage") + }) + end + end + + table.sort(projectdeps, function (a, b) return a.name < b.name end) + + for _, dep in pairs(projectdeps) do + print(string.format("- [%s](%s): %s", dep.name, dep.homepage, dep.desc)) + end +end) \ No newline at end of file