#include #include #include #include #include #include #include #include #include SCENARIO("RenderSystem", "[NDK][RenderSystem]") { GIVEN("A world with a camera, a drawable, a light and some particles") { Ndk::World world; const Ndk::EntityHandle& cameraEntity = world.CreateEntity(); Ndk::CameraComponent& cameraComponentCamera = cameraEntity->AddComponent(); Ndk::NodeComponent& nodeComponentCamera = cameraEntity->AddComponent(); const Ndk::EntityHandle& drawableEntity = world.CreateEntity(); Ndk::GraphicsComponent& graphicsComponentDrawable = drawableEntity->AddComponent(); Nz::SpriteRef sprite = Nz::Sprite::New(); graphicsComponentDrawable.Attach(sprite); Ndk::NodeComponent& nodeComponentDrawable = drawableEntity->AddComponent(); const Ndk::EntityHandle& lightEntity = world.CreateEntity(); Ndk::LightComponent& lightComponentLight = lightEntity->AddComponent(); Ndk::NodeComponent& nodeComponentLight = lightEntity->AddComponent(); const Ndk::EntityHandle& particlesEntity = world.CreateEntity(); Ndk::ParticleGroupComponent& particleGroupComponentParticles = particlesEntity->AddComponent(1, Nz::ParticleLayout_Sprite); WHEN("We change the render technique to ForwardRenderTechnique") { Ndk::RenderSystem& renderSystem = world.GetSystem(); renderSystem.ChangeRenderTechnique(); THEN("The render system should be ForwardRenderTechnique") { REQUIRE(renderSystem.GetRenderTechnique().GetType() == Nz::RenderTechniqueType_BasicForward); } } } }