Git Product home page Git Product logo

nazaraengine / nazaraengine Goto Github PK

View Code? Open in Web Editor NEW
681.0 39.0 71.0 27.07 MB

Nazara Engine is a cross-platform framework aimed at (but not limited to) real-time applications requiring audio, 2D and 3D real-time rendering, network and more.

License: MIT License

Lua 0.93% C++ 99.07% Objective-C++ 0.01%
opengl vulkan game-engine c-plus-plus cross-platform network enet realtime-games nazara-engine cplusplus-17

nazaraengine's Introduction

Platform Build Status
Windows Windows build status
MSYS2 (MinGW64) Windows build status
Linux Linux build status
macOS macOS build status
Emscripten Emscripten build status

Nazara Engine

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).

Features:

  • Supports Windows, Linux, macOS and the web (Android and iOS are coming).
  • 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), a single modern language working with all renderer backends
  • Easy to customize graphics module providing basis for advanced techniques (such as deferred shading, HDR, PBR rendering and more).
  • A powerful and extensible frame graph system allowing you to easily define how your rendering works.
  • Builtin retained widgets (but ImGUI support is available through NazaraImgui.
  • Audio playback and streaming based on OpenAL-Soft.
  • 2D and 3D Physics integration (with Chipmunk and Jolt Physics).
  • Optional ECS (Entity-Component-System) classes for helping with entity handling (based on the excellent entt).
  • A ENet-based reliable UDP networking protocol, supporting IPv6 and encryption (check out ENet6)
  • Support for plugins (with provided Assimp and FFMpeg plugins)

You can use it in any kind of commercial and non-commercial applications without any restriction (MIT license).

Authors

Jérôme "SirLynix" Leclercq - main developper ([email protected])

How to use

You can find tutorials on installation, compilation and use on the official wiki.
See INSTALL.md for build instructions.

Contribute

Don't hesitate to contribute to Nazara Engine by:
  • Extending the wiki
  • Submitting a patch to GitHub
  • Post suggestions/bugs on the forum or the GitHub tracker
  • Fork the project on GitHub and push your changes
  • Talking about Nazara Engine to other people, spread the word!
  • Doing anything else that might help us

Links

Discord
X (Twitter)
Wiki

Thanks to:

See THANKS.md

nazaraengine's People

Contributors

alexandre-janniaux avatar antoinejt avatar apjue avatar bryant1410 avatar ciotatsoft avatar dd10-e avatar dependabot[bot] avatar faymoon avatar gawaboumga avatar germinolegrand avatar giganon avatar gogo2464 avatar hardcpp avatar imperators79 avatar larnin avatar nedkam avatar overdrivr avatar remqb avatar sirlynix avatar taosc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nazaraengine's Issues

Mesh skeleton template does not include bind pose informations

Currently, the skeleton template included by a skeletal-animated mesh contains joint name, joint inverse bind matrix and joint parent.

It should include bind-pose rotation, scale and translation in order that the mesh and it's AABB are drawable and usable without any animation.

Compilation with clang fails

Linking NazaraUnitTests with Clang gives this:

obj/x64/DebugDynamic/NazaraUnitTests/Application.o: In function `____C_A_T_C_H____T_E_S_T____4()':
/home/travis/build/DigitalPulseSoftware/NazaraEngine/build/gmake/tools/../../../tests/SDK/NDK/Application.cpp:20: undefined reference to `Ndk::Application::Run()'
obj/x64/DebugDynamic/NazaraUnitTests/Application.o: In function `Ndk::Application::Instance()':
/home/travis/build/DigitalPulseSoftware/NazaraEngine/build/gmake/tools/../../../SDK/include/NDK/Application.inl:350: undefined reference to `Ndk::Application::s_application'
obj/x64/DebugDynamic/NazaraUnitTests/Application.o: In function `Ndk::EntityOwner::Reset(Ndk::Entity*)':
/home/travis/build/DigitalPulseSoftware/NazaraEngine/build/gmake/tools/../../../SDK/include/NDK/EntityOwner.inl:49: undefined reference to `Ndk::Entity::Kill()'
obj/x64/DebugDynamic/NazaraUnitTests/Application.o: In function `std::default_delete<Ndk::World>::operator()(Ndk::World*) const':
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/bits/unique_ptr.h:76: undefined reference to `Ndk::World::~World()'
...

LuaClass fails to handle some constructor cases

When constructing an object, that (empty) object is pushed on the Lua stack before the constructor function is called.

    template<class T>
    int LuaClass<T>::ConstructorProxy(lua_State* state)
    {
        LuaInstance& lua = *LuaInstance::GetInstance(state);

        std::shared_ptr<ClassInfo>& info = *static_cast<std::shared_ptr<ClassInfo>*>(lua.ToUserdata(lua.GetIndexOfUpValue(1)));
        const ConstructorFunc& constructor = info->constructor;

        lua.Remove(1); // On enlève l'argument "table" du stack

        T* instance = static_cast<T*>(lua.PushUserdata(sizeof(T))); //<<<<<< HERE

        if (!constructor(lua, instance))

which induce an extra parameter of type "userdata" on every constructor.

Probleme de define avec OpenAL

Le fichier Audio.cpp utilise des constantes définies dans <AL/al.h> (les constantes commençant par AL_). Ce header est inclue dans le projet dans le header OpenAL.hpp. La constante NAZARA_AUDIO_OPENAL permet d'utiliser ou non OpenAL.

L'utilisation de ces constantes de OpenAL rend le code dépendant de cette lib. Il faut :

  • soit rendre cette lib obligatoire et retirer NAZARA_AUDIO_OPENAL (mais ca serait une mauvaise idée, cela interdit d'utiliser Nazara sans lib audio).
  • soit ajouter un #else pour définir ces constantes si OpenAL n'est pas utilisée.
  • soit définir de nouvelles constantes indépendantes de la lib audio pour Nazara.

La troisième solution serait la meilleure. EDIT: Ou pas, finalement. En fait, ca serait mieux de rendre le module audio optionnel (voir faire de l'audio un vrai module, c'est a dire pouvoir ajouter ou supprimer l'audio simplement avec un plugin, sans recompiler).

Idem pour les fonctions al.
Idem dans Music.cpp, Sound.cpp, SoundEffect.cpp, SoundEmitter.cpp...

En fait, OpenAL est une dépendance obligatoire de Nazara ? Il n'est pas possible de build sans ?

Integration tests

See possibility to create integration tests, with dummy server, to tests network module.

VectorX operator<< is leaking memory

I should further investigate, but this operator seems to be leaking memory.

Code

NzVector2f test2(12.f,12.f);
std::cout<<"test "<<test2<<std::endl;
NzVector3f  test3(16.f, 16.f, 45.f);
std::cout<<"test "<<test3<<std::endl;
NzVector4f test4(12.f,12.f,12.f,12.f);
std::cout<<"test "<<test4<<std::endl;

NazaraLeaks.log

03/01/2013 - 19:25:16: ==============================
03/01/2013 - 19:25:16:   Nazara Memory Leak Tracker  
03/01/2013 - 19:25:16: ==============================
03/01/2013 - 19:25:19: Application finished, checking leaks...
03/01/2013 - 19:25:19: ==============================
03/01/2013 - 19:25:19:    Leaks have been detected   
03/01/2013 - 19:25:19: ==============================

Leak list:
-0x006c035c -> 64 bytes allocated at unknown position
-0x006c04a4 -> 64 bytes allocated at unknown position
-0x006c0574 -> 128 bytes allocated at unknown position

3 blocks leaked (256 bytes)

Pixel format (XXXX) failed validation tests

When initializing the Utility module, several warnings occurs:
05/10/2016 - 18:05:23: Warning: Pixel format 0x21 (RGB32F) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void)) 05/10/2016 - 18:05:23: Warning: Pixel format 0x22 (RGB32I) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void)) 05/10/2016 - 18:05:23: Warning: Pixel format 0x23 (RGB32UI) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void)) 05/10/2016 - 18:05:23: Warning: Pixel format 0x29 (RGBA32F) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void)) 05/10/2016 - 18:05:23: Warning: Pixel format 0x2A (RGBA32I) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void)) 05/10/2016 - 18:05:23: Warning: Pixel format 0x2B (RGBA32UI) failed validation tests (..\..\..\src\Nazara\Utility\PixelFormat.cpp:1344: bool __cdecl Nz::PixelFormat::Initialize(void))

While this has no side-effect, fixing it would be a good thing.

Configurable key mapping

Add possibility to create "action" in game and attach key (keyboard, gamepad).
Add base to create dialog to do that in game.

MD2 loader doesn't handle static mesh loading

The integrated MD2 loader has no code to handle animated = false mesh parameter.

NzMeshParams parameters;
parameters.animated = false;

NzMesh drfreak;
drfreak.LoadFromFile("drfreak.md2", parameters); // This is unsupported and will lead to undefined mesh

HybridMultiFractal2D.hpp include fail

Under sensitive-case system such as Archlinux, HybridMultiFractal2D.cpp fails to include HybridMultiFractal2D.hpp, because it is named HybridMultifractal2D.hpp (with a lowercase f).

we get this error :
../../src/Nazara/Noise/HybridMultifractal2D.cpp:7:49: erreur fatale: Nazara/Noise/HybridMultiFractal2D.hpp : No file found. (the error is translated from french).

DebugDrawer issue - VertexBuffer corruption

Drawing a vertex buffer right after a call to DebugDrawer::Draw causes said vertex buffer to be corrupted.

Drawing the vertex buffer before DebugDrawer::Drawer does not show the issue.

Here is the test code (sorry for the *DampedString" function could have removed it)

#include <Nazara/Core/Clock.hpp>
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <iostream>

NzVector3f DampedString(const NzVector3f& currentPos, const NzVector3f& targetPos, float frametime, float springStrength = 3.f);

int main()
{
    NzInitializer<NzGraphics> nazara;
    if (!nazara)
    {
        std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl;
        std::getchar();

        return EXIT_FAILURE;
    }

    NzDebugDrawer::Initialize();
    NzScene scene;


    NzEulerAnglesf camAngles(0.f, -20.f, 0.f);
    NzCamera camera;
    camera.SetPosition(0.f, 0.25f, 2.f);
    camera.SetRotation(camAngles);
    camera.SetParent(scene);
    camera.SetZFar(5000.f);
    camera.SetZNear(0.1f);

    NzVideoMode mode = NzVideoMode::GetDesktopMode();
    mode.width *= 3.f/4.f;
    mode.height *= 3.f/4.f;
    NzString windowTitle = "Nazara Demo - DebugDrawer bug";
    nzWindowStyleFlags style = nzWindowStyle_Default;


    NzRenderWindow window(mode, windowTitle, style);
    if (!window.IsValid())
    {
        std::cout << "Failed to create render window" << std::endl;
        std::getchar();

        return EXIT_FAILURE;
    }

    window.SetCursor(nzWindowCursor_None);
    camera.SetTarget(window);
    NzClock secondClock, updateClock;
    unsigned int fps = 0;
    bool smoothMovement = true;
    NzVector3f targetPos = camera.GetPosition();



    /// Le vertex buffer testé
    std::array<float,75> data;
    int index = 0;

    NzVertexBuffer buf(NzVertexDeclaration::Get(nzVertexLayout_XYZ),25,nzBufferStorage_Hardware,nzBufferUsage_Static);

    for(int y(0) ; y < 5 ; ++y)
        for(int x(0) ; x < 5 ; ++x)
        {
            index = (x + 5 * y)*3;
            //On génère une grille
            data.at(index) = x * 100.f;
            data.at(index + 1) = 0.f;
            data.at(index + 2) = y * 100.f;
        }
    buf.Fill(data.data(),0,25);


    //On affiche le contenu du vertex buffer
    NzBufferMapper<NzVertexBuffer> mapper(buf,nzBufferAccess_ReadOnly);
    const float* vertices = reinterpret_cast<const float*>(mapper.GetPointer());

    std::cout<<"Avant Rendu---------------------"<<std::endl;
    for(int i(0) ; i < 25 ; ++i)
        std::cout<<vertices[i*3]<<" ; "<<vertices[i*3+1]<<" ; "<<vertices[i*3+2]<<std::endl;

    mapper.Unmap();

    while (window.IsOpen())
    {
        NzEvent event;
        while (window.PollEvent(&event))
        {
            switch (event.type)
            {
                case nzEventType_MouseMoved:
                {
                    float sensitivity = 0.3f;
                    camAngles.yaw = NzNormalizeAngle(camAngles.yaw - event.mouseMove.deltaX*sensitivity);
                    camAngles.pitch = NzClamp(camAngles.pitch - event.mouseMove.deltaY*sensitivity, -89.f, 89.f);
                    camera.SetRotation(camAngles);
                    NzMouse::SetPosition(window.GetWidth()/2, window.GetHeight()/2, window);
                    break;
                }

                case nzEventType_Quit:
                    window.Close();
                    break;

                case nzEventType_KeyPressed:
                    if (event.key.code == NzKeyboard::Key::Escape)
                        window.Close();
                    else if (event.key.code == NzKeyboard::F1)
                    {
                        if (smoothMovement)
                        {
                            targetPos = camera.GetPosition();
                            smoothMovement = false;
                        }
                        else
                            smoothMovement = true;
                    }
                    break;

                default:
                    break;
            }
        }

        if (updateClock.GetMilliseconds() >= 1000/60)
        {
            float elapsedTime = updateClock.GetSeconds();
            float cameraSpeed = 3.f * elapsedTime;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::Space))
                cameraSpeed *= 2.f;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::Up) || NzKeyboard::IsKeyPressed(NzKeyboard::Z))
                targetPos += camera.GetForward() * cameraSpeed;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::Down) || NzKeyboard::IsKeyPressed(NzKeyboard::S))
                targetPos += camera.GetBackward() * cameraSpeed;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::Left) || NzKeyboard::IsKeyPressed(NzKeyboard::Q))
                targetPos += camera.GetLeft() * cameraSpeed;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::Right) || NzKeyboard::IsKeyPressed(NzKeyboard::D))
                targetPos += camera.GetRight() * cameraSpeed;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::LShift) || NzKeyboard::IsKeyPressed(NzKeyboard::RShift))
                targetPos += NzVector3f::Up() * cameraSpeed;
            if (NzKeyboard::IsKeyPressed(NzKeyboard::LControl) || NzKeyboard::IsKeyPressed(NzKeyboard::RControl))
                targetPos += NzVector3f::Down() * cameraSpeed;

            camera.SetPosition((smoothMovement) ? DampedString(camera.GetPosition(), targetPos, elapsedTime) : targetPos, nzCoordSys_Global);
            updateClock.Restart();
        }


        camera.Activate();
        scene.Update();
        scene.Cull();
        scene.UpdateVisible();
        scene.Draw();

        NzRenderer::SetMatrix(nzMatrixType_World, NzMatrix4f::Identity());
        NzBoxf bbox(0.f,-1.f,0.f,1.f,1.f,1.f);
        NzDebugDrawer::Draw(bbox);

        //Attention, le fait de commenter NzDebugDrawer::Draw enlève la déclaration d'un shader, normal que rien ne s'affiche ici alors
        NzRenderer::SetVertexBuffer(&buf);
        NzRenderer::DrawPrimitives(nzPrimitiveMode_LineStrip,0,25);

        window.Display();

        fps++;

        if (secondClock.GetMilliseconds() >= 1000)
        {
            window.SetTitle(windowTitle + " - " + NzString::Number(fps) + " FPS");
            fps = 0;
            secondClock.Restart();
        }
    }


    //On affiche le contenu du vertex buffer
    NzBufferMapper<NzVertexBuffer> mapper2(buf,nzBufferAccess_ReadOnly);
    const float* vertices2 = reinterpret_cast<const float*>(mapper2.GetPointer());

    std::cout<<"Apres Rendu-------------------------------"<<std::endl;

    for(int i(0) ; i < 25 ; ++i)
        std::cout<<vertices2[i*3]<<" ; "<<vertices2[i*3+1]<<" ; "<<vertices2[i*3+2]<<std::endl;

    mapper2.Unmap();

    NzDebugDrawer::Uninitialize();

    return EXIT_SUCCESS;
}

NzVector3f DampedString(const NzVector3f& currentPos, const NzVector3f& targetPos, float frametime, float springStrength)
{
    // Je ne suis pas l'auteur de cette fonction
    // Je l'ai reprise du programme "Floaty Camera Example" et adaptée au C++
    // Trouvé ici: http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/opengl_programming.html#4
    // Tout le mérite revient à l'auteur (Qui me permettra ainsi d'améliorer les démos, voire même le moteur)

    // calculate the displacement between the target and the current position
    NzVector3f displacement = targetPos - currentPos;

    // whats the distance between them?
    float displacementLength = displacement.GetLength();

    // Stops small position fluctuations (integration errors probably - since only using euler)
    if (NzNumberEquals(displacementLength, 0.f))
        return currentPos;

    float invDisplacementLength = 1.f/displacementLength;

    const float dampConstant = 0.000065f; // Something v.small to offset 1/ displacement length

    // the strength of the spring increases the further away the camera is from the target.
    float springMagitude = springStrength*displacementLength + dampConstant*invDisplacementLength;

    // Normalise the displacement and scale by the spring magnitude
    // and the amount of time passed
    float scalar = std::min(invDisplacementLength * springMagitude * frametime, 1.f);
    displacement *= scalar;

    // move the camera a bit towards the target
    return currentPos + displacement;
}


Visual Studio 2013 not supported

Premake does generate solutions for Visual Studio 2013, but compilation fails with "Nazara requires a C++11 compliant compiler".

After a quick check in Prerequisites.hpp, I found:

define NAZARA_COMPILER_SUPPORTS_CPP11 (_MSC_VER >= 1900)

VS13 is bundled with MSVC 18. I assume Nazara needs VS15 (since the compilation fails spectacularly with _MSC_VER >= 1800), but it means premake needs to be upgraded to version 5.

EDIT: using premake5 out of the box seems to be breaking compatibility with Code::Blocks... Were the premake4 files in the depot modified to include the relevant action?

Compilation issue with TDM-GCC

I am having the following error when compiling NzNoise module with TDM-GCC 5.1.0
http://tdm-gcc.tdragon.net/

||=== Build: DebugDLL in NazaraCore (compiler: GNU GCC Compiler) ===|
||=== Build: DebugDLL in NazaraNoise (compiler: GNU GCC Compiler) ===|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
..\..\include\Nazara\Core\Debug\NewRedefinition.hpp|24|error: invalid pure specifier (only '= 0' is allowed) before '::' token|
||=== Build failed: 12 error(s), 0 warning(s) (1 minute(s), 3 second(s)) ===|

Do I need to update some stuff in the NzNoise module ?

Fixer -Wreorder

Activer cette option de build et corriger.

Par exemple :

.../NazaraEngine/src/Nazara/Physics2D/RigidBody2D.cpp:55: warning: field 'm_geom' 
will be initialized after field 'm_shapes' [-Wreorder]
        m_geom(std::move(object.m_geom)),
        ^

Deploying

Add packaging and deploying tests. I use CPack, I don't know what to use with premake.

Nazara3D is broken

Due to big changes, Nazara3D is currently broken and won't compile.

I'm working on it.

Pragma vs header guards

I see you use both #pragma one and header guards. Why ? Using only one of those two would be enough, wouldn't it ?

Fixer -Wmismatched-tags

Activer cette option de build et corriger.

Par exemple :

.../NazaraEngine/src/Nazara/Renderer/GLX/ContextImpl.hpp:14: warning: class
'ContextParameters' was previously declared as a struct [-Wmismatched-tags]
        class ContextParameters;
        ^

Problème de compilation code::blocks 16.01

La compilation plante à cause de IpAddressImpl.hpp :

||=== Build: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|
......\src\Nazara\Network\Win32\IpAddressImpl.hpp|20|error: 'addrinfoW' does not name a type|
||=== Build finished: 1 error(s), 0 warning(s) (0 minute(s), 44 second(s)) ===|
||=== Run: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|

OS : Windows 10, 7
Code::blocks 16.01

Crash in initializer

This piece of code that initialize the engine makes it crash:
`#include <Nazara/Core/Clock.hpp> // Horloges

include <Nazara/Graphics.hpp> // Module graphique

include <Nazara/Renderer.hpp> // Module de rendu

include <Nazara/Utility.hpp> // Module utilitaire

include <NDK/Components/CameraComponent.hpp>

include <NDK/Components/GraphicsComponent.hpp>

include <NDK/Components/LightComponent.hpp>

include <NDK/Components/NodeComponent.hpp>

include <NDK/Systems/RenderSystem.hpp>

include <NDK/Sdk.hpp>

include <NDK/World.hpp>

include

int main()
{
Nz::InitializerNdk::Sdk nazara;
if (!nazara)
{
// Une erreur s'est produite dans l'initialisation d'un des modules
std::cout << "Failed to initialize Nazara, see NazaraLog.log for further informations" << std::endl;
std::getchar(); // On laise le temps de voir l'erreur

    return EXIT_FAILURE;
}

return 0;

}
`
Compiled in code::blocks with GGC nuwen (c++14 compliant) and in x64 debug mode.
errorrr

Fail to compile Posix SocketImpl on x86 Linux system

When Nazara is compiled on x86 Linux system, it fails with Posix SocketImpl.
Error with Clang:

../../../src/Nazara/Network/Posix/SocketImpl.cpp:401:18: error: out-of-line definition of 'Poll' does not match any declaration in 'Nz::SocketImpl'
int SocketImpl::Poll(PollSocket* fdarray, unsigned long nfds, int timeout, SocketError* error)
                ^~~~

Premake4 bug with gmake generator, same-named files result in same-named target

There is a problem with the premake4's gmake generator in version 4.4-beta4, same-named files such as PCX/Loader.cpp and STB/Loader.cpp are compiled into the same object file, and as a result the last file compiled erases the others, and it links several times instead of only once.

Here is some extracts from the generated NazaraUtility.make file:

74 OBJECTS := \
[...]
111     $(OBJDIR)/Parser.o \
112     $(OBJDIR)/Loader.o \
113     $(OBJDIR)/Loader.o \
114     $(OBJDIR)/Loader.o \
115     $(OBJDIR)/Parser.o \
116     $(OBJDIR)/Loader.o \
292 $(OBJDIR)/Loader.o: ../../src/Nazara/Utility/Loaders/MD5Anim/Loader.cpp
293     @echo $(notdir $<)
294     $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
295 $(OBJDIR)/Loader.o: ../../src/Nazara/Utility/Loaders/STB/Loader.cpp
296     @echo $(notdir $<)
297     $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
298 $(OBJDIR)/Loader.o: ../../src/Nazara/Utility/Loaders/PCX/Loader.cpp
299     @echo $(notdir $<)

I've tried the premake-dev, as mentionned here : http://industriousone.com/topic/premake-gmake-issue-same-named-files-result-same-named-targets#comment-21419.

The generated makefile now looks like that :

 84     $(OBJDIR)/Loader1.o \
 85     $(OBJDIR)/Parser.o \
 86     $(OBJDIR)/Loader2.o \
 87     $(OBJDIR)/Parser1.o \
 88     $(OBJDIR)/Loader3.o \
 89     $(OBJDIR)/Loader4.o \

So using premake-dev version ( https://bitbucket.org/premake/premake-dev ) fixes the problem.

NzString is leaking memory (NzString::Unicode)

08/08/2013 - 17:13:04: ==============================
08/08/2013 - 17:13:04: Nazara Memory Leak Tracker
08/08/2013 - 17:13:04: ==============================
08/08/2013 - 17:13:10: Application finished, checking leaks...
08/08/2013 - 17:13:10: ==============================
08/08/2013 - 17:13:10: Leaks have been detected
08/08/2013 - 17:13:10: ==============================

Leak list:
-0x014fe21c -> 54 bytes allocated at C:\Program Files\CodeBlocks\NazaraEngine\src\Nazara\Core\String.cpp:3975
-0x014fe27c -> 16 bytes allocated at C:\Program Files\CodeBlocks\NazaraEngine\src\Nazara\Core\String.cpp:3979

2 blocks leaked (70 bytes)

Update readme

Hello.

I know you are aware of broken links, but know, they redirect on spam ads... Maybe you should consider to completly remove them from the readme ?

Sorry for opening an issue for that ^^

Compilation error under Linux

Hello,
I've got an error during at the begining of the compilation of NazaraEngine:

==== Building NazaraCore (debugdll) ====
TaskScheduler.cpp
../../src/Nazara/Core/TaskScheduler.cpp:12:52: erreur fatale: Nazara/Core/Posix/TaskSchedulerImpl.hpp : Aucun fichier ou dossier de ce type
  #include <Nazara/Core/Posix/TaskSchedulerImpl.hpp>
                                                    ^
compilation terminée.
NazaraCore.make:198: recipe for target 'obj/DebugDLL/NazaraCore/TaskScheduler.o' failed
make[1]: *** [obj/DebugDLL/NazaraCore/TaskScheduler.o] Error 1
Makefile:40: recipe for target 'NazaraCore' failed
make: *** [NazaraCore] Error 2

I have tested it on Archlinux and Linux Mint 16 and had the same problem.
Do you have an idea of what is the problem ?

Fixer -Wunused-private-field

Activer cette option de build et corriger.

Par exemple :

.../NazaraEngine/include/Nazara/Physics3D/Collider3D.hpp:196: warning: private field
'm_vertexStride' is not used [-Wunused-private-field]
                        unsigned int m_vertexStride;
                                     ^

Cpuid makes GCC fail to compile with x86 target

Trying to compile the engine on Linux with GCC/Clang leads to:

../../../src/Nazara/Core/Posix/HardwareInfoImpl.cpp:17:48: error: inconsistent operand constraints in an ‘asm’
        : "a" (functionId), "c" (subFunctionId));                                // input
                                               ^

AABB generation is drunk

Capture
As you can see in the screenshot, AABB generation is screwed up.

This must come from Cube::ExtendTo, as I don't have any other explanation..

But what is wrong with this ?

template<typename T>
NzCube<T>& NzCube<T>::ExtendTo(const NzVector3<T>& point)
{
    x = std::min(x, point.x);
    y = std::min(y, point.y);
    z = std::min(z, point.z);
    width = std::max(x + width, point.x) - x;
    height = std::max(y + height, point.y) - y;
    depth = std::max(z + depth, point.z) - z;

    return *this;
}

SocketPoller::Wait does not update error parameter on Linux

When calling SocketPoller::Wait with a valid error pointer, the function should update its value, even in case of success, currently it does not change its value.

Windows and generic Posix implementation are fine, only Linux is affected.

Change readme extension to .md to use Markdown

You need to use .md extension for your readme file to use Markdown.
Currently you use .txt extension: why?

Vous devez utiliser l'extension .md pour votre fichier readme afin d'utiliser le Markdown.
Actuellement vous utiliser le .txt, pourquoi ?

Wrong NzString creation

The constructor NzString(const char* string, unsigned int length) leads to an undesired behavior if strlen(string) > length, leading to copy an extra byte from the string.

The memcpy should NOT copy length+1 bytes but only length then set m_sharedString->string[length] to 0.
I suggest the following:

m_sharedString->string = new char[length+1];
std::memcpy(m_sharedString->string, string, length);
m_sharedString->string[length] = 0;

Add guidelines

Style guideline.
Rules for testing and doc.
Rules to propose a patch.

The Scene API has to be remade.

The current Scene API is stuck between the modern way of creating nodes (Scene::CreateNode) and the old way (Node::SetParent), because neither of them is perfect.

  1. How to handle nodes children with the modern way?
  2. How to handle non-scene node parenting with the modern way?
  3. How to handle scenes in the NDK (Nazara Development Kit)? I think the Scene API should not be a part of Nazara but a part of it's SDK, because a sound emitter should be able to be part of the scene as a node, same goes for a model and a physical object.

Which leads us to
4) How to handle models/sprite/text rendering in Nazara without scenes? Should we expose/impose the low-level API (i.e. render queues, culling and such)?
5) If so, why would one use Nazara without it's SDK?

I think we have to prepare Nazara for the beta before thinking of this.

Compilation under linux

Hi!
I have tried to compile Nazara under linux but after running premake-linux and make, I've got this error:

==== Building NazaraCore (debugdll) ====
ConditionVariableImpl.cpp
../../src/Nazara/Core/Posix/ConditionVariableImpl.cpp: In member function ‘bool NzConditionVariableImpl::Wait(NzMutexImpl_, nzUInt32)’:
../../src/Nazara/Core/Posix/ConditionVariableImpl.cpp:46:48: erreur: cannot convert ‘NzMutexImpl_’ to ‘pthread_mutex_t_’ for argument ‘2’ to ‘int pthread_cond_timedwait(pthread_cond_t_, pthread_mutex_t_, const timespec_)’
return pthread_cond_timedwait(&m_cv,mutex, &tv) != ETIMEDOUT;
^
../../src/Nazara/Core/Posix/ConditionVariableImpl.cpp:46:53: erreur: ‘ETIMEDOUT’ was not declared in this scope
return pthread_cond_timedwait(&m_cv,mutex, &tv) != ETIMEDOUT;
^
make[1]: *** [obj/DebugDLL/NazaraCore/ConditionVariableImpl.o] Erreur 1
make: *** [NazaraCore] Erreur 2

I don't know if the problem come from source code or from me.

NzNoise refresh

So what is the strategy to port changes from [ZNoise][https://github.com/Overdrivr/ZNoise] ?

I am not really in favor to make a manual porting, because that would mean two repositories to maintain for the same base code. But I can do it, it's not that many file.

Do you see any other option ?

Also, this leads me to this next point. In a more general approach, this could be a good exercise on how to have Nazara modules that are not necessarily a part of the core distribution.

Maybe to push further the idea, it could very cool to be able to install non-core modules simply from a bash command similar to (or even just that) git clone and have the build system be fine with it.

What are your thoughts about these two points ?

Exception in the detructor of `PhysObject`

The destructor of PhysObject throws an exception "Violation d'accès lors de l'exécution à l'emplacement 0x000000FF." (sorry my vs2015 speaks french).

PhysObject::~PhysObject()
{
        if (m_body)
            NewtonDestroyBody(m_world->GetHandle(), m_body); //-> My debugger shows this line.
}

Autres problèmes de compilation code::blocks 16.01

Un problème dans IpAddressImpl.cpp

||=== Générer: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|95|error: 'struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|149|error: 'const struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|241|error: 'struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\SocketImpl.cpp|9|fatal error: Mstcpip.h: No such file or directory|
||=== Build échoué: 4 error(s), 0 warning(s) (0 minute(s), 7 second(s)) ===|

Corrigé en rajoutant manuellement Mstcpip.h mais deux nouvelles erreurs dues à ce nouveau fichier:

||=== Générer: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\MinGW\include\Mstcpip.h|9|fatal error: _mingw_unicode.h: No such file or directory|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|95|error: 'struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|149|error: 'const struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|241|error: 'struct in6_addr' has no member named 'u'|
||=== Build échoué: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

||=== Générer: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\CodeBlocks\MinGW\include\Mstcpip.h|10|fatal error: winapifamily.h: No such file or directory|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|95|error: 'struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|149|error: 'const struct in6_addr' has no member named 'u'|
C:\Users\Maryse Hoebeke\Documents\CB_project\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|241|error: 'struct in6_addr' has no member named 'u'|
||=== Build échoué: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|

Corrigé en rajoutant manuellement _mingw_unicode.h et winapifamily.h

Mais cela n'a corrigé que les erreurs d'include, pas les autres

||=== Build: DebugDynamic in NazaraEngine (compiler: GNU GCC Compiler) ===|
C:\Users\ULg\Desktop\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|95|error: 'struct in6_addr' has no member named 'u'|
C:\Users\ULg\Desktop\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|149|error: 'const struct in6_addr' has no member named 'u'|
C:\Users\ULg\Desktop\NazaraEngine-master\src\Nazara\Network\Win32\IpAddressImpl.cpp|241|error: 'struct in6_addr' has no member named 'u'|
||=== Build finished: 3 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|

OS: WIndows 7, 10
IDE : code::blocks 16.01

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.