diff --git a/examples/GraphicsTest/main.cpp b/examples/GraphicsTest/main.cpp index 156d435e8..5a71b028a 100644 --- a/examples/GraphicsTest/main.cpp +++ b/examples/GraphicsTest/main.cpp @@ -105,8 +105,9 @@ int main() framePipeline.RegisterRenderable(worldInstanceIndex1, &model, 0xFFFFFFFF, scissorBox); framePipeline.RegisterRenderable(worldInstanceIndex2, &model, 0xFFFFFFFF, scissorBox); - std::shared_ptr light = std::make_shared(); - light->UpdateColor(Nz::Color::Green); + std::shared_ptr light = std::make_shared(); + light->UpdateInnerAngle(Nz::DegreeAnglef(15.f)); + light->UpdateOuterAngle(Nz::DegreeAnglef(20.f)); framePipeline.RegisterLight(light, 0xFFFFFFFF); @@ -165,6 +166,7 @@ int main() camAngles.pitch = Nz::Clamp(camAngles.pitch - event.mouseMove.deltaY*sensitivity, -89.f, 89.f); camQuat = camAngles; + light->UpdateRotation(camQuat); break; } diff --git a/examples/WidgetDemo/main.cpp b/examples/WidgetDemo/main.cpp index a8d930cc4..692646b3a 100644 --- a/examples/WidgetDemo/main.cpp +++ b/examples/WidgetDemo/main.cpp @@ -60,13 +60,15 @@ int main() labelWidget->SetPosition(0.f, 200.f, 0.f); labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("Je suis un LabelWidget !", 72)); + unsigned int clickCount = 0; + Nz::ButtonWidget* buttonWidget = canvas2D.Add(); buttonWidget->SetPosition(200.f, 400.f); buttonWidget->UpdateText(Nz::SimpleTextDrawer::Draw("Press me senpai", 72)); buttonWidget->Resize(buttonWidget->GetPreferredSize()); - buttonWidget->OnButtonTrigger.Connect([=](const Nz::ButtonWidget*) + buttonWidget->OnButtonTrigger.Connect([&](const Nz::ButtonWidget*) { - buttonWidget->Destroy(); + labelWidget->UpdateText(Nz::SimpleTextDrawer::Draw("You clicked the button " + std::to_string(++clickCount) + " times", 72)); }); std::shared_ptr material = std::make_shared(); diff --git a/include/Nazara/Core/Flags.hpp b/include/Nazara/Core/Flags.hpp index b0b2ad0e0..bc670b96a 100644 --- a/include/Nazara/Core/Flags.hpp +++ b/include/Nazara/Core/Flags.hpp @@ -27,10 +27,10 @@ namespace Nz template - struct GetEnumAutoFlag : std::integral_constant {}; + struct GetEnumAutoFlag : std::bool_constant {}; template - struct GetEnumAutoFlag> : std::integral_constant {}; + struct GetEnumAutoFlag> : std::bool_constant {}; template class Flags diff --git a/include/Nazara/Graphics.hpp b/include/Nazara/Graphics.hpp index 409850c9f..7002d9f15 100644 --- a/include/Nazara/Graphics.hpp +++ b/include/Nazara/Graphics.hpp @@ -36,14 +36,17 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include #include +#include #include #include #include diff --git a/xmake-repo/packages/q/qt5widgets/xmake.lua b/xmake-repo/packages/q/qt5widgets/xmake.lua index 5692df2db..ee0a4cb85 100644 --- a/xmake-repo/packages/q/qt5widgets/xmake.lua +++ b/xmake-repo/packages/q/qt5widgets/xmake.lua @@ -15,11 +15,9 @@ package("qt5widgets") end) on_fetch(function (package) - print("on_fetch") local base = package:dep("qt5base") local qt = base:data("qtdir") if not qt then - print("nani") return end diff --git a/xmake.lua b/xmake.lua index c3b210942..a8e456664 100644 --- a/xmake.lua +++ b/xmake.lua @@ -107,6 +107,7 @@ NazaraModules = modules includes("xmake/**.lua") +set_project("NazaraEngine") set_xmakever("2.6.3") add_repositories("local-repo xmake-repo") @@ -117,13 +118,17 @@ add_requires("libvorbis", { configs = { with_vorbisenc = false } }) add_requires("openal-soft", { configs = { shared = true }}) add_requires("newtondynamics", { debug = is_plat("windows") and is_mode("debug") }) -- Newton doesn't like compiling in Debug on Linux -set_project("NazaraEngine") - -add_rules("mode.asan", "mode.coverage", "mode.debug", "mode.releasedbg") +add_rules("mode.asan", "mode.debug", "mode.releasedbg") add_rules("plugin.vsxmake.autoupdate") add_rules("build_rendererplugins") -set_allowedmodes("debug", "releasedbg", "asan", "coverage") +if is_plat("windows") then + set_allowedmodes("debug", "releasedbg", "asan") +else + set_allowedmodes("debug", "releasedbg", "asan", "coverage") + add_rules("mode.coverage") +end + set_allowedplats("windows", "mingw", "linux", "macosx") set_allowedarchs("windows|x64", "mingw|x86_64", "linux|x86_64", "macosx|x86_64") set_defaultmode("debug")