Lines Matching refs:nw
38 nw::demo::DemoAllocator s_DeviceAllocator;
39 nw::demo::DemoAllocator s_ParticleAllocator;
56 typedef nw::ut::FixedSizeArray<nw::gfx::IRenderTarget*, RENDER_TARGET_COUNT> RenderTargetArray;
59 nw::demo::SceneSystem* s_SceneSystem = NULL;
60 nw::demo::RenderSystem* s_RenderSystem = NULL;
61 nw::gfx::ParticleContext* s_ParticleContext = NULL;
63 nw::demo::GraphicsDrawing s_GraphicsDrawing;
67 nw::demo::ResourceArray s_Resources;
72 nw::gfx::SceneNode* s_SceneRoot = NULL;
74 nw::gfx::Camera* s_BaseCamera = NULL;
75 nw::gfx::Camera* s_LeftCamera = NULL;
76 nw::gfx::Camera* s_RightCamera = NULL;
86 typedef nw::ut::FixedSizeArray<nw::gfx::SceneEnvironmentSetting*, ENVIRONMENT_SETTINGS_COUNT> Scene…
92 nw::ut::FixedSizeArray<nw::gfx::AnimObject*, MAX_ANIM_OBJECTS> s_AnimObjects;
97 nw::ut::FixedSizeArray<nw::gfx::ResGraphicsFile, ANIMATION_RESOURCES_COUNT> s_ResAnims;
98 nw::ut::FixedSizeArray<nw::gfx::SceneObject*, ANIMATION_TARGETS_COUNT> s_AnimTargets;
100 nw::gfx::BaseAnimEvaluator* s_MainEvaluator = NULL;
106 nw::demo::Utility::AnimationType animType;
111 { "Toy_Mobile", "Toy_Mobile", nw::demo::Utility::SKELETAL_ANIMATION },
112 { "pointLight1", "pointLight1", nw::demo::Utility::LIGHT_ANIMATION }
117 nw::gfx::ParticleSceneUpdater* s_ParticleSceneUpdater = NULL;
119 nw::demo::FlushCache* s_FlushCache;
122 typedef nw::ut::FixedSizeArray<nw::gfx::ParticleModel*, EMITTER_COUNT> ParticleMdlArray;
128 nw::gfx::SkeletalModel* s_SkeletalModel = NULL;
131 typedef nw::ut::FixedSizeArray<nw::gfx::ParticleEmitter*, EMITTER_COUNT> EmitterArray;
134 nw::gfx::Light* s_Light = NULL;
141 class CallbackConstraint : public nw::gfx::Skeleton::CalculateMatrixSlot
151 CallbackConstraint(nw::os::IAllocator* allocator) in CallbackConstraint()
152 : nw::gfx::Skeleton::CalculateMatrixSlot(allocator), in CallbackConstraint()
166 CallbackConstraint(size_t maxConstrainedCount, nw::os::IAllocator* allocator) in CallbackConstraint()
167 : nw::gfx::Skeleton::CalculateMatrixSlot(allocator), in CallbackConstraint()
178 bool AddConstrainedObject(nw::gfx::TransformNode* constrainedObject) in AddConstrainedObject()
181 nw::gfx::CalculatedTransform::FLAG_IS_WORLDMATRIX_CALCULATION_ENABLED); in AddConstrainedObject()
192 nw::gfx::SkeletalModel* skeletalModel, in SetTargetObject()
196 nw::gfx::Skeleton* skeleton = skeletalModel->GetSkeleton(); in SetTargetObject()
210 virtual void Invoke(nw::gfx::Skeleton* skeleton, int boneIdx) in Invoke()
217 nw::gfx::Skeleton::MatrixPose& pose = skeleton->WorldMatrixPose(); in Invoke()
230 typedef nw::ut::MoveArray<nw::gfx::TransformNode*> TransformNodeArray;
232 nw::gfx::Skeleton* m_Skeleton;
251 CallbackResourceBasedConstraint(nw::os::IAllocator* allocator) in CallbackResourceBasedConstraint()
263 CallbackResourceBasedConstraint(size_t maxConstrainedCount, nw::os::IAllocator* allocator) in CallbackResourceBasedConstraint()
274 bool AddConstrainedObject(nw::gfx::TransformNode* constrainedObject) in AddConstrainedObject()
280 virtual void Invoke(nw::gfx::Skeleton* skeleton, int boneIdx) in Invoke()
287 nw::gfx::Skeleton::MatrixPose& pose = skeleton->WorldMatrixPose(); in Invoke()
306 nw::gfx::CommandCacheManager::SetAllocator( &s_DeviceAllocator ); in InitializeGraphics()
309 nw::demo::RenderSystem::Description renderDescription; in InitializeGraphics()
313 renderDescription.upperScreenMode = nw::demo::UPPER_SCREEN_MODE_STEREO; in InitializeGraphics()
315 s_RenderSystem = nw::demo::RenderSystem::Create(&s_DeviceAllocator, renderDescription); in InitializeGraphics()
322 nw::demo::Utility::InitializeGraphicsDrawing(&s_DeviceAllocator, s_GraphicsDrawing); in InitializeGraphics()
325 nw::demo::Utility::CreateUpperScreenBuffer(&s_DeviceAllocator, renderDescription) in InitializeGraphics()
331 nw::demo::SceneSystem::Description sceneDescription; in InitializeGraphics()
332 s_SceneSystem = nw::demo::SceneSystem::Create(&s_DeviceAllocator, sceneDescription); in InitializeGraphics()
334 s_ParticleContext = nw::gfx::ParticleContext::Builder() in InitializeGraphics()
337 s_ParticleSceneUpdater = nw::gfx::ParticleSceneUpdater::Builder() in InitializeGraphics()
354 nw::gfx::SafeDestroy(s_LeftCamera); in TerminateGraphics()
356 nw::gfx::SafeDestroy(s_RightCamera); in TerminateGraphics()
358 nw::gfx::SafeDestroy(s_SceneSystem); in TerminateGraphics()
360 nw::gfx::SafeDestroy(s_ParticleSceneUpdater); in TerminateGraphics()
362 nw::gfx::SafeDestroy(s_ParticleContext); in TerminateGraphics()
364 nw::gfx::SafeDestroyAll(s_RenderTargets); in TerminateGraphics()
368 nw::gfx::SafeDestroy(s_RenderSystem); in TerminateGraphics()
381 nw::gfx::SafeDestroy(s_AnimObjects[animIdx]); in TerminateAnim()
395 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in SetStepFrame()
397 nw::gfx::SceneNodeArray::iterator end = sceneContext->GetSceneNodesEnd(); in SetStepFrame()
398 for (nw::gfx::SceneNodeArray::iterator i = sceneContext->GetSceneNodesBegin(); i != end; ++i) in SetStepFrame()
400 nw::gfx::ParticleEmitter* emitter = nw::ut::DynamicCast<nw::gfx::ParticleEmitter*>(*i); in SetStepFrame()
407 nw::gfx::ParticleModel* model = nw::ut::DynamicCast<nw::gfx::ParticleModel*>(*i); in SetStepFrame()
425 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in ResetParticle()
435 (*iter)->ForeachParticleSet(nw::gfx::ParticleSetsClear()); in ResetParticle()
454 …nw::gfx::BaseAnimEvaluator* evaluator = nw::ut::DynamicCast<nw::gfx::BaseAnimEvaluator*>(s_AnimObj… in ResetParticle()
476 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in LoopAnimation()
481 nw::gfx::ParticleModelArray::iterator end = sceneContext->GetParticleModelEnd(); in LoopAnimation()
482 for (nw::gfx::ParticleModelArray::iterator iter = sceneContext->GetParticleModelBegin(); in LoopAnimation()
502 s_SceneRoot = nw::gfx::TransformNode::DynamicBuilder() in BuildRootNodes()
515 nw::demo::Utility::CreateStereoCameras( in BuildCameras()
520 nw::math::VEC3(15.0f, 10.0f, 15.0f), in BuildCameras()
521 nw::math::VEC3(0.0f, 0.0f, 0.0f) in BuildCameras()
532 BuildResources(nw::demo::ResourceSet* resourceSet) in BuildResources()
534 …resourceSet->resource.ForeachTexture(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMA | GL_NO_COPY_FCRA… in BuildResources()
535 …resourceSet->resource.ForeachIndexStream(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMB | GL_NO_COPY_… in BuildResources()
536 …resourceSet->resource.ForeachVertexStream(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMB | GL_NO_COPY… in BuildResources()
538 nw::gfx::Result result = resourceSet->resource.Setup(&s_DeviceAllocator); in BuildResources()
544 nw::ut::MoveArray<nw::gfx::SceneNode*> sceneNodeArray(&s_DeviceAllocator); in BuildResources()
546 nw::gfx::ResModelArray models = resourceSet->resource.GetModels(); in BuildResources()
547 nw::gfx::ResModelArray::iterator modelsEnd = models.end(); in BuildResources()
548 for (nw::gfx::ResModelArray::iterator modelResource = models.begin(); in BuildResources()
551 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
560 nw::gfx::SkeletalModel* skeletalModel = nw::ut::DynamicCast<nw::gfx::SkeletalModel*>(node); in BuildResources()
567 nw::gfx::ResLightArray lights = resourceSet->resource.GetLights(); in BuildResources()
568 nw::gfx::ResLightArray::iterator lightsEnd = lights.end(); in BuildResources()
569 for (nw::gfx::ResLightArray::iterator lightResource = lights.begin(); in BuildResources()
572 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
581 s_Light = nw::ut::DynamicCast<nw::gfx::Light*>(node); in BuildResources()
584 nw::gfx::ResEmitterArray emitters = resourceSet->resource.GetEmitters(); in BuildResources()
585 for (nw::gfx::ResEmitterArray::iterator emitterResource = emitters.begin(); in BuildResources()
588 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
595 s_Emitters.push_back(nw::ut::DynamicCast<nw::gfx::ParticleEmitter*>(node)); in BuildResources()
598 nw::gfx::ResCameraArray cameras = resourceSet->resource.GetCameras(); in BuildResources()
599 nw::gfx::ResCameraArray::iterator camerasEnd = cameras.end(); in BuildResources()
600 for (nw::gfx::ResCameraArray::iterator cameraResource = cameras.begin(); in BuildResources()
603 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
612 nw::gfx::SceneHelper::ResolveReference(sceneNodeArray); in BuildResources()
614 nw::gfx::ParticleUtil::SetupParticleObject(&sceneNodeArray, s_ParticleContext); in BuildResources()
617 nw::gfx::SceneHelper::ForeachRootNodes( in BuildResources()
620 nw::gfx::AttachNode(s_SceneRoot) in BuildResources()
623 …nw::gfx::ResSceneEnvironmentSettingArray settings = resourceSet->resource.GetSceneEnvironmentSetti… in BuildResources()
624 nw::gfx::ResSceneEnvironmentSettingArray::iterator settingsEnd = settings.end(); in BuildResources()
625 for (nw::gfx::ResSceneEnvironmentSettingArray::iterator settingResource = settings.begin(); in BuildResources()
628 nw::gfx::SceneObject* sceneObject = nw::gfx::SceneBuilder() in BuildResources()
632 nw::gfx::SceneEnvironmentSetting* sceneEnvironmentSetting = in BuildResources()
633 nw::ut::DynamicCast<nw::gfx::SceneEnvironmentSetting*>(sceneObject); in BuildResources()
649 nw::demo::Utility::BindAnimationByName( in BuildAnimations()
662 s_MainEvaluator = nw::ut::DynamicCast<nw::gfx::BaseAnimEvaluator*>(s_AnimObjects[0]); in BuildAnimations()
741 …s_Light->Transform().DisableFlags(nw::gfx::CalculatedTransform::FLAG_IS_WORLDMATRIX_CALCULATION_EN… in SetupConstraint()
757 …nw::demo::ResourceSet* resourceSet = nw::demo::Utility::LoadResources(s_Resources, name, &s_Device… in InitializeScenes()
782 nw::gfx::SceneEnvironment& sceneEnvironment = s_RenderSystem->GetSceneEnvironment(); in InitializeScenes()
784 nw::demo::Utility::SetCameraAspectRatio(s_BaseCamera, s_RenderTargets[0]); in InitializeScenes()
797 nw::gfx::SafeDestroyBranch(s_SceneRoot); in TerminateScenes()
798 nw::demo::SafeCleanupResources(s_Resources); in TerminateScenes()
799 nw::ut::SafeDestroyAll(s_SceneEnvironmentSettings); in TerminateScenes()
823 nw::gfx::Skeleton::MatrixPose& pose = s_SkeletalModel->GetSkeleton()->WorldMatrixPose(); in ConstrainLight()
848 nw::gfx::ResCameraProjectionUpdater resProjectionUpdater = in UpdateScene()
873 nw::demo::DebugUtility::CalcLoadMeter(s_RenderSystem); in ReportDemo()
877 nw::demo::DebugUtility::DrawLoadMeter( in ReportDemo()
886 nw::demo::DebugUtility::DrawLoadMeterText( in ReportDemo()
904 nw::gfx::RenderContext* renderContext = s_RenderSystem->GetRenderContext(); in DemoScene()
908 nw::demo::DebugUtility::PostInitializeScenes(); in DemoScene()
914 nw::demo::DebugUtility::AdvanceAutoTestFrame(); in DemoScene()
916 nw::demo::PadFactory::GetPad()->Update(); in DemoScene()
930 s_RenderSystem->TransferBuffer(nw::demo::LOWER_SCREEN); in DemoScene()
932 …s_RenderSystem->PresentBuffer(nw::demo::UPPER_SCREEN | nw::demo::LOWER_SCREEN | nw::demo::EXTENSIO… in DemoScene()
939 if (nw::demo::Utility::IsTerminating()) in DemoScene()
945 nw::demo::DebugUtility::PreTerminateScenes(); in DemoScene()
958 nw::demo::InitializeGraphicsSystem(&s_DeviceAllocator); in nnMain()
959 nw::demo::InitializeDemoAllocator(&s_ParticleAllocator, nw::demo::DEMO_PARTICLE_MEMORY_SIZE); in nnMain()
961 nw::demo::PadFactory::Initialize(&s_DeviceAllocator); in nnMain()
967 s_FlushCache = nw::demo::FlushCache::Create(&s_DeviceAllocator); in nnMain()
971 nw::ut::SafeDestroy(s_FlushCache); in nnMain()
976 nw::demo::PadFactory::Finalize(); in nnMain()
978 nw::demo::FinalizeDemoAllocator(&s_ParticleAllocator); in nnMain()
980 nw::demo::FinalizeGraphicsSystem(); in nnMain()