Lines Matching refs:nw
36 nw::demo::DemoAllocator s_DeviceAllocator;
37 nw::demo::DemoAllocator s_ParticleAllocator;
54 typedef nw::ut::FixedSizeArray<nw::gfx::IRenderTarget*, RENDER_TARGET_COUNT> RenderTargetArray;
57 nw::demo::SceneSystem* s_SceneSystem = NULL;
58 nw::demo::RenderSystem* s_RenderSystem = NULL;
59 nw::gfx::ParticleContext* s_ParticleContext = NULL;
61 nw::demo::GraphicsDrawing s_GraphicsDrawing;
65 nw::demo::ResourceArray s_Resources;
70 nw::gfx::SceneNode* s_SceneRoot = NULL;
72 nw::gfx::Camera* s_BaseCamera = NULL;
73 nw::gfx::Camera* s_LeftCamera = NULL;
74 nw::gfx::Camera* s_RightCamera = NULL;
84 typedef nw::ut::FixedSizeArray<nw::gfx::SceneEnvironmentSetting*, ENVIRONMENT_SETTINGS_COUNT> Scene…
90 nw::ut::FixedSizeArray<nw::gfx::AnimObject*, MAX_ANIM_OBJECTS> s_AnimObjects;
95 nw::ut::FixedSizeArray<nw::gfx::ResGraphicsFile, ANIMATION_RESOURCES_COUNT> s_ResAnims;
96 nw::ut::FixedSizeArray<nw::gfx::SceneObject*, ANIMATION_TARGETS_COUNT> s_AnimTargets;
98 nw::gfx::BaseAnimEvaluator* s_MainEvaluator = NULL;
104 nw::demo::Utility::AnimationType animType;
109 { "Toy_Mobile", "Toy_Mobile", nw::demo::Utility::SKELETAL_ANIMATION },
110 { "pointLight1", "pointLight1", nw::demo::Utility::LIGHT_ANIMATION }
115 nw::gfx::ParticleSceneUpdater* s_ParticleSceneUpdater = NULL;
117 nw::demo::FlushCache* s_FlushCache;
120 typedef nw::ut::FixedSizeArray<nw::gfx::ParticleModel*, EMITTER_COUNT> ParticleMdlArray;
126 nw::gfx::SkeletalModel* s_SkeletalModel = NULL;
129 typedef nw::ut::FixedSizeArray<nw::gfx::ParticleEmitter*, EMITTER_COUNT> EmitterArray;
132 nw::gfx::Light* s_Light = NULL;
139 class CallbackConstraint : public nw::gfx::Skeleton::CalculateMatrixSlot
149 CallbackConstraint(nw::os::IAllocator* allocator) in CallbackConstraint()
150 : nw::gfx::Skeleton::CalculateMatrixSlot(allocator), in CallbackConstraint()
164 CallbackConstraint(size_t maxConstrainedCount, nw::os::IAllocator* allocator) in CallbackConstraint()
165 : nw::gfx::Skeleton::CalculateMatrixSlot(allocator), in CallbackConstraint()
176 bool AddConstrainedObject(nw::gfx::TransformNode* constrainedObject) in AddConstrainedObject()
179 nw::gfx::CalculatedTransform::FLAG_IS_WORLDMATRIX_CALCULATION_ENABLED); in AddConstrainedObject()
190 nw::gfx::SkeletalModel* skeletalModel, in SetTargetObject()
194 nw::gfx::Skeleton* skeleton = skeletalModel->GetSkeleton(); in SetTargetObject()
208 virtual void Invoke(nw::gfx::Skeleton* skeleton, int boneIdx) in Invoke()
215 nw::gfx::Skeleton::MatrixPose& pose = skeleton->WorldMatrixPose(); in Invoke()
228 typedef nw::ut::MoveArray<nw::gfx::TransformNode*> TransformNodeArray;
230 nw::gfx::Skeleton* m_Skeleton;
249 CallbackResourceBasedConstraint(nw::os::IAllocator* allocator) in CallbackResourceBasedConstraint()
261 CallbackResourceBasedConstraint(size_t maxConstrainedCount, nw::os::IAllocator* allocator) in CallbackResourceBasedConstraint()
272 bool AddConstrainedObject(nw::gfx::TransformNode* constrainedObject) in AddConstrainedObject()
278 virtual void Invoke(nw::gfx::Skeleton* skeleton, int boneIdx) in Invoke()
285 nw::gfx::Skeleton::MatrixPose& pose = skeleton->WorldMatrixPose(); in Invoke()
304 nw::gfx::CommandCacheManager::SetAllocator( &s_DeviceAllocator ); in InitializeGraphics()
307 nw::demo::RenderSystem::Description renderDescription; in InitializeGraphics()
311 renderDescription.upperScreenMode = nw::demo::UPPER_SCREEN_MODE_STEREO; in InitializeGraphics()
313 s_RenderSystem = nw::demo::RenderSystem::Create(&s_DeviceAllocator, renderDescription); in InitializeGraphics()
320 nw::demo::Utility::InitializeGraphicsDrawing(&s_DeviceAllocator, s_GraphicsDrawing); in InitializeGraphics()
323 nw::demo::Utility::CreateUpperScreenBuffer(&s_DeviceAllocator, renderDescription) in InitializeGraphics()
329 nw::demo::SceneSystem::Description sceneDescription; in InitializeGraphics()
330 s_SceneSystem = nw::demo::SceneSystem::Create(&s_DeviceAllocator, sceneDescription); in InitializeGraphics()
332 s_ParticleContext = nw::gfx::ParticleContext::Builder() in InitializeGraphics()
335 s_ParticleSceneUpdater = nw::gfx::ParticleSceneUpdater::Builder() in InitializeGraphics()
352 nw::gfx::SafeDestroy(s_LeftCamera); in TerminateGraphics()
354 nw::gfx::SafeDestroy(s_RightCamera); in TerminateGraphics()
356 nw::gfx::SafeDestroy(s_SceneSystem); in TerminateGraphics()
358 nw::gfx::SafeDestroy(s_ParticleSceneUpdater); in TerminateGraphics()
360 nw::gfx::SafeDestroy(s_ParticleContext); in TerminateGraphics()
362 nw::gfx::SafeDestroyAll(s_RenderTargets); in TerminateGraphics()
366 nw::gfx::SafeDestroy(s_RenderSystem); in TerminateGraphics()
379 nw::gfx::SafeDestroy(s_AnimObjects[animIdx]); in TerminateAnim()
393 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in SetStepFrame()
395 nw::gfx::SceneNodeArray::iterator end = sceneContext->GetSceneNodesEnd(); in SetStepFrame()
396 for (nw::gfx::SceneNodeArray::iterator i = sceneContext->GetSceneNodesBegin(); i != end; ++i) in SetStepFrame()
398 nw::gfx::ParticleEmitter* emitter = nw::ut::DynamicCast<nw::gfx::ParticleEmitter*>(*i); in SetStepFrame()
405 nw::gfx::ParticleModel* model = nw::ut::DynamicCast<nw::gfx::ParticleModel*>(*i); in SetStepFrame()
423 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in ResetParticle()
433 (*iter)->ForeachParticleSet(nw::gfx::ParticleSetsClear()); in ResetParticle()
452 …nw::gfx::BaseAnimEvaluator* evaluator = nw::ut::DynamicCast<nw::gfx::BaseAnimEvaluator*>(s_AnimObj… in ResetParticle()
474 nw::gfx::SceneContext* sceneContext = s_SceneSystem->GetSceneContext(); in LoopAnimation()
479 nw::gfx::ParticleModelArray::iterator end = sceneContext->GetParticleModelEnd(); in LoopAnimation()
480 for (nw::gfx::ParticleModelArray::iterator iter = sceneContext->GetParticleModelBegin(); in LoopAnimation()
500 s_SceneRoot = nw::gfx::TransformNode::DynamicBuilder() in BuildRootNodes()
513 nw::demo::Utility::CreateStereoCameras( in BuildCameras()
518 nw::math::VEC3(15.0f, 10.0f, 15.0f), in BuildCameras()
519 nw::math::VEC3(0.0f, 0.0f, 0.0f) in BuildCameras()
530 BuildResources(nw::demo::ResourceSet* resourceSet) in BuildResources()
532 …resourceSet->resource.ForeachTexture(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMA | GL_NO_COPY_FCRA… in BuildResources()
533 …resourceSet->resource.ForeachIndexStream(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMB | GL_NO_COPY_… in BuildResources()
534 …resourceSet->resource.ForeachVertexStream(nw::gfx::LocationFlagSetter(NN_GX_MEM_VRAMB | GL_NO_COPY… in BuildResources()
536 nw::gfx::Result result = resourceSet->resource.Setup(&s_DeviceAllocator); in BuildResources()
542 nw::ut::MoveArray<nw::gfx::SceneNode*> sceneNodeArray(&s_DeviceAllocator); in BuildResources()
544 nw::gfx::ResModelArray models = resourceSet->resource.GetModels(); in BuildResources()
545 nw::gfx::ResModelArray::iterator modelsEnd = models.end(); in BuildResources()
546 for (nw::gfx::ResModelArray::iterator modelResource = models.begin(); in BuildResources()
549 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
558 nw::gfx::SkeletalModel* skeletalModel = nw::ut::DynamicCast<nw::gfx::SkeletalModel*>(node); in BuildResources()
565 nw::gfx::ResLightArray lights = resourceSet->resource.GetLights(); in BuildResources()
566 nw::gfx::ResLightArray::iterator lightsEnd = lights.end(); in BuildResources()
567 for (nw::gfx::ResLightArray::iterator lightResource = lights.begin(); in BuildResources()
570 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
579 s_Light = nw::ut::DynamicCast<nw::gfx::Light*>(node); in BuildResources()
582 nw::gfx::ResEmitterArray emitters = resourceSet->resource.GetEmitters(); in BuildResources()
583 for (nw::gfx::ResEmitterArray::iterator emitterResource = emitters.begin(); in BuildResources()
586 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
593 s_Emitters.push_back(nw::ut::DynamicCast<nw::gfx::ParticleEmitter*>(node)); in BuildResources()
596 nw::gfx::ResCameraArray cameras = resourceSet->resource.GetCameras(); in BuildResources()
597 nw::gfx::ResCameraArray::iterator camerasEnd = cameras.end(); in BuildResources()
598 for (nw::gfx::ResCameraArray::iterator cameraResource = cameras.begin(); in BuildResources()
601 nw::gfx::SceneNode* node = nw::demo::Utility::CreateSceneNode( in BuildResources()
610 nw::gfx::SceneHelper::ResolveReference(sceneNodeArray); in BuildResources()
612 nw::gfx::ParticleUtil::SetupParticleObject(&sceneNodeArray, s_ParticleContext); in BuildResources()
615 nw::gfx::SceneHelper::ForeachRootNodes( in BuildResources()
618 nw::gfx::AttachNode(s_SceneRoot) in BuildResources()
621 …nw::gfx::ResSceneEnvironmentSettingArray settings = resourceSet->resource.GetSceneEnvironmentSetti… in BuildResources()
622 nw::gfx::ResSceneEnvironmentSettingArray::iterator settingsEnd = settings.end(); in BuildResources()
623 for (nw::gfx::ResSceneEnvironmentSettingArray::iterator settingResource = settings.begin(); in BuildResources()
626 nw::gfx::SceneObject* sceneObject = nw::gfx::SceneBuilder() in BuildResources()
630 nw::gfx::SceneEnvironmentSetting* sceneEnvironmentSetting = in BuildResources()
631 nw::ut::DynamicCast<nw::gfx::SceneEnvironmentSetting*>(sceneObject); in BuildResources()
647 nw::demo::Utility::BindAnimationByName( in BuildAnimations()
660 s_MainEvaluator = nw::ut::DynamicCast<nw::gfx::BaseAnimEvaluator*>(s_AnimObjects[0]); in BuildAnimations()
739 …s_Light->Transform().DisableFlags(nw::gfx::CalculatedTransform::FLAG_IS_WORLDMATRIX_CALCULATION_EN… in SetupConstraint()
755 …nw::demo::ResourceSet* resourceSet = nw::demo::Utility::LoadResources(s_Resources, name, &s_Device… in InitializeScenes()
780 nw::gfx::SceneEnvironment& sceneEnvironment = s_RenderSystem->GetSceneEnvironment(); in InitializeScenes()
782 nw::demo::Utility::SetCameraAspectRatio(s_BaseCamera, s_RenderTargets[0]); in InitializeScenes()
795 nw::gfx::SafeDestroyBranch(s_SceneRoot); in TerminateScenes()
796 nw::demo::SafeCleanupResources(s_Resources); in TerminateScenes()
797 nw::ut::SafeDestroyAll(s_SceneEnvironmentSettings); in TerminateScenes()
818 nw::gfx::Skeleton::MatrixPose& pose = s_SkeletalModel->GetSkeleton()->WorldMatrixPose(); in ConstrainLight()
843 nw::gfx::ResCameraProjectionUpdater resProjectionUpdater = in UpdateScene()
868 nw::demo::DebugUtility::CalcLoadMeter(s_RenderSystem); in ReportDemo()
872 nw::demo::DebugUtility::DrawLoadMeter( in ReportDemo()
881 nw::demo::DebugUtility::DrawLoadMeterText( in ReportDemo()
899 nw::gfx::RenderContext* renderContext = s_RenderSystem->GetRenderContext(); in DemoScene()
903 nw::demo::DebugUtility::PostInitializeScenes(); in DemoScene()
909 nw::demo::DebugUtility::AdvanceAutoTestFrame(); in DemoScene()
911 nw::demo::PadFactory::GetPad()->Update(); in DemoScene()
925 s_RenderSystem->TransferBuffer(nw::demo::LOWER_SCREEN); in DemoScene()
927 …s_RenderSystem->PresentBuffer(nw::demo::UPPER_SCREEN | nw::demo::LOWER_SCREEN | nw::demo::EXTENSIO… in DemoScene()
934 if (nw::demo::Utility::IsTerminating()) in DemoScene()
940 nw::demo::DebugUtility::PreTerminateScenes(); in DemoScene()
953 nw::demo::InitializeGraphicsSystem(&s_DeviceAllocator); in nnMain()
954 nw::demo::InitializeDemoAllocator(&s_ParticleAllocator, nw::demo::DEMO_PARTICLE_MEMORY_SIZE); in nnMain()
956 nw::demo::PadFactory::Initialize(&s_DeviceAllocator); in nnMain()
962 s_FlushCache = nw::demo::FlushCache::Create(&s_DeviceAllocator); in nnMain()
966 nw::ut::SafeDestroy(s_FlushCache); in nnMain()
971 nw::demo::PadFactory::Finalize(); in nnMain()
973 nw::demo::FinalizeDemoAllocator(&s_ParticleAllocator); in nnMain()
975 nw::demo::FinalizeGraphicsSystem(); in nnMain()