Merge branch 'master' into vulkan

This commit is contained in:
Lynix
2017-07-04 22:41:29 +02:00
839 changed files with 12369 additions and 5421 deletions

View File

@@ -16,6 +16,7 @@
#include <Nazara/Lua.hpp> // Module de scripting
#include <Nazara/Graphics.hpp> // Module graphique
#include <Nazara/Renderer.hpp> // Module de rendu
#include <Nazara/Network.hpp> // Module utilitaire
#include <Nazara/Utility.hpp> // Module utilitaire
#include <NDK/Application.hpp>
#include <NDK/Components.hpp>
@@ -33,6 +34,7 @@ int main()
{
// Ndk::Application est une classe s'occupant de l'initialisation du moteur ainsi que de la gestion de beaucoup de choses
Ndk::Application application;
Nz::Initializer<Nz::Network> network;
// Nazara étant initialisé, nous pouvons créer le monde pour contenir notre scène.
// Dans un ECS, le monde représente bien ce que son nom indique, c'est l'ensemble de ce qui existe au niveau de l'application.
@@ -251,7 +253,7 @@ int main()
}
// On fait disparaître le curseur de la souris
window.SetCursor(Nz::WindowCursor_None);
window.SetCursor(Nz::SystemCursor_None);
// On lie la caméra à la fenêtre
cameraComp.SetTarget(&window);

View File

@@ -644,7 +644,7 @@ void SpacebattleExample::Enter(Ndk::StateMachine& fsm)
m_turretReloadSound.LoadFromFile("resources/turretReload.wav");
//m_onMouseMoved.Connect(m_shared.target->GetEventHandler().OnMouseMoved, this, &SpacebattleExample::OnMouseMoved);
//m_shared.target->SetCursor(Nz::WindowCursor_None);
//m_shared.target->SetCursor(Nz::SystemCursor_None);
//////////////////////////////////////////////////////////////////////////

View File

@@ -17,8 +17,6 @@
int main()
{
Nz::ContextParameters::defaultCompatibilityProfile = true;
Ndk::Application app;
// Mix all sounds in mono (in order to give them 3D position)

View File

@@ -18,6 +18,9 @@ int main(int argc, char* argv[])
Ndk::Application application(argc, argv);
// Do what you want here
Nz::LuaInstance lua;
std::cout << lua.Execute("return {key = 42}") << std::endl;
std::cout << lua.DumpStack() << std::endl;
return EXIT_SUCCESS;
}

View File

@@ -1,4 +1,4 @@
// Sources pour https://github.com/DigitalPulseSoftware/NazaraEngine/wiki/(FR)-Tutoriel-01---Hello-World
// Sources pour https://github.com/DigitalPulseSoftware/NazaraEngine/wiki/(FR)-Tutoriel:-%5B01%5D-Hello-World
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>

11
examples/Tut02/build.lua Normal file
View File

@@ -0,0 +1,11 @@
EXAMPLE.Name = "Tut02_Events"
EXAMPLE.EnableConsole = true
EXAMPLE.Files = {
"main.cpp"
}
EXAMPLE.Libraries = {
"NazaraSDK"
}

50
examples/Tut02/main.cpp Normal file
View File

@@ -0,0 +1,50 @@
// Sources pour https://github.com/DigitalPulseSoftware/NazaraEngine/wiki/(FR)-Tutoriel:-%5B02%5D-Gestion-des-événements
#include <Nazara/Graphics.hpp>
#include <Nazara/Renderer.hpp>
#include <Nazara/Utility.hpp>
#include <NDK/Application.hpp>
#include <NDK/Components.hpp>
#include <NDK/Systems.hpp>
#include <NDK/World.hpp>
#include <iostream>
int main(int argc, char* argv[])
{
Ndk::Application application(argc, argv);
Nz::RenderWindow& mainWindow = application.AddWindow<Nz::RenderWindow>();
mainWindow.Create(Nz::VideoMode(800, 600, 32), "Test");
mainWindow.EnableCloseOnQuit(false);
Ndk::World& world = application.AddWorld();
world.GetSystem<Ndk::RenderSystem>().SetGlobalUp(Nz::Vector3f::Down());
world.GetSystem<Ndk::RenderSystem>().SetDefaultBackground(Nz::ColorBackground::New(Nz::Color(117, 122, 214)));
Ndk::EntityHandle viewEntity = world.CreateEntity();
viewEntity->AddComponent<Ndk::NodeComponent>();
Ndk::CameraComponent& viewer = viewEntity->AddComponent<Ndk::CameraComponent>();
viewer.SetTarget(&mainWindow);
viewer.SetProjectionType(Nz::ProjectionType_Orthogonal);
Nz::EventHandler& eventHandler = mainWindow.GetEventHandler();
eventHandler.OnKeyPressed.Connect([](const Nz::EventHandler*, const Nz::WindowEvent::KeyEvent& e)
{
std::cout << Nz::Keyboard::GetKeyName(e.code) << std::endl;
// Profitons-en aussi pour nous donner un moyen de quitter le programme
if (e.code == Nz::Keyboard::Escape)
Ndk::Application::Instance()->Quit(); // Cette ligne casse la boucle Run() de l'application
});
while (application.Run())
{
mainWindow.Display();
}
return EXIT_SUCCESS;
}