当前位置: 首页>>代码示例>>C#>>正文


C# IResourceManager.Load方法代码示例

本文整理汇总了C#中IResourceManager.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IResourceManager.Load方法的具体用法?C# IResourceManager.Load怎么用?C# IResourceManager.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IResourceManager的用法示例。


在下文中一共展示了IResourceManager.Load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Renderer

        public Renderer(IResourceManager resources, SpriteBatch spriteBatch, GraphicsDevice graphicsDevice)
        {
            _defaultFont = resources.Load<SpriteFont>("DefaultFont", "DefaultFont");

            _spriteBatch = spriteBatch;

            _graphicsDevice = graphicsDevice;

            ClearColor = Color.Black;

            _renderables = new List<KeyValuePair<IEnumerable<string>, IRenderable>>();
        }
开发者ID:hyjynx-studios,项目名称:bizio,代码行数:12,代码来源:Renderer.cs

示例2: SimpleMaterialEditorController

    public SimpleMaterialEditorController(IRenderer renderer, ISceneReader sceneReader, IResourceManager resourceManager)
    {
      if (renderer == null) throw new ArgumentNullException("renderer");
      if (sceneReader == null) throw new ArgumentNullException("sceneReader");
      if (resourceManager == null) throw new ArgumentNullException("resourceManager");
      _renderer = renderer;
      _sceneReader = sceneReader;
      _resourceManager = resourceManager;

      _resourceManager.Load(ResourcePath);
      _scene = _sceneReader.Read(ScenePath);
      
      _centralView = new SimpleMaterialEditorView();
    }
开发者ID:dgopena,项目名称:Starter3D.Base,代码行数:14,代码来源:SimpleMaterialEditorController.cs

示例3: SceneGraphController

    public SceneGraphController(IRenderer renderer, ISceneReader sceneReader, IResourceManager resourceManager)
    {
      if (renderer == null) throw new ArgumentNullException("renderer");
      if (sceneReader == null) throw new ArgumentNullException("sceneReader");
      if (resourceManager == null) throw new ArgumentNullException("resourceManager");
      _renderer = renderer;
      _sceneReader = sceneReader;
      _resourceManager = resourceManager;

      _resourceManager.Load(ResourcePath);
      _scene = _sceneReader.Read(ScenePath);

      _centralView = new SceneGraphView(this);
    }
开发者ID:dgopena,项目名称:Starter3D.Base,代码行数:14,代码来源:SceneGraphController.cs

示例4: Init

        void Init(IntPtr pParam)
        {
            // get subsystems

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RESOURCE_MANAGER, out p_sub_sys);
            pResMan = (IResourceManager)p_sub_sys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_INPUT, out p_sub_sys);
            pInput = (IInput)p_sub_sys;
            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RENDER, out p_sub_sys);
            pRender = (IRender)p_sub_sys;
            pRender.GetRender2D(out pRender2D);

            // create arrays
            IEngineBaseObject pObj = null;
            pTextures = new ITexture[TexCount];
            pShadows = new ITexture[ShadowCount];
            pMeshes = new IMesh[MeshCount];

            // loading data
            pResMan.Load(RESOURCE_PATH + "sounds\\helicopter.wav", out pObj, 0);
            pSound = (ISoundSample)pObj;
            pSound.PlayEx(out pSoundChannel, E_SOUND_SAMPLE_PARAMS.SSP_LOOPED);

            for (int i = 0; i < TexCount; i++)
            {
                uint flags = TexNames[i].Contains("grass") ? (uint)(E_TEXTURE_LOAD_FLAGS.TLF_FILTERING_BILINEAR | E_TEXTURE_LOAD_FLAGS.TLF_COORDS_REPEAT) : (uint)E_TEXTURE_LOAD_FLAGS.TEXTURE_LOAD_DEFAULT_2D;
                pResMan.Load(RESOURCE_PATH + TexNames[i], out pObj, flags);
                pTextures[i] = (ITexture)pObj;
            }

            pTextures[6].SetFrameSize(256, 256); // zombie sprite splitting

            for (int i = 0; i < MeshCount; i++)
            {
                pResMan.Load(RESOURCE_PATH + MeshNames[i], out pObj, (uint)E_MESH_MODEL_LOAD_FLAGS.MMLF_FORCE_MODEL_TO_MESH);
                pMeshes[i] = (IMesh)pObj;
            }

            // render shadows
            for (int i = 0; i < MeshCount; i++)
            {
                RenderMeshToTexture(out pShadows[i], pMeshes[i], pTextures[i]);
            }

            // render rotor shadow
            pResMan.CreateTexture(out pShadows[5], null, 256, 256, E_TEXTURE_DATA_FORMAT.TDF_RGBA8, E_TEXTURE_CREATE_FLAGS.TCF_DEFAULT, E_TEXTURE_LOAD_FLAGS.TLF_FILTERING_BILINEAR);
            pRender.SetRenderTarget(pShadows[5]);
            TPoint2 coords = new TPoint2(128f, 128f);
            TColor4 col = TColor4.ColorWhite();
            pRender2D.DrawCircle(ref coords, 100, 64, ref col, E_PRIMITIVE2D_FLAGS.PF_FILL);
            pRender.SetRenderTarget(null);

            // gather, fill and init 3d-objects data
            MyMeshes = new MyMesh[8]
            {
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2( 900f, 500f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2(-250f, 300f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[0], pTextures[0], pShadows[0], new TPoint2( 800f, 200f), new TPoint3(400f, 400f, 400f), 225),
                new MyMesh(pMeshes[1], pTextures[1], pShadows[1], new TPoint2(   0f, 450f), new TPoint3(300f, 300f, 400f), 175),
                new MyMesh(pMeshes[1], pTextures[1], pShadows[1], new TPoint2(  50f, 750f), new TPoint3(300f, 300f, 300f), 175),
                new MyMesh(pMeshes[2], pTextures[2], pShadows[2], new TPoint2( 500f, 150f), new TPoint3(400f, 400f, 500f), 225),
                new MyMesh(pMeshes[3], pTextures[3], pShadows[3], new TPoint2( 180f, 150f), new TPoint3(400f, 400f, 600f), 200),
                new MyMesh(pMeshes[3], pTextures[3], pShadows[3], new TPoint2( 600f, 550f), new TPoint3(400f, 400f, 600f), 200, 90)
            };

            copter = new Copter(new MyMesh(pMeshes[4], pTextures[4], pShadows[4], new TPoint2(), new TPoint3(600, 600, 600), 200, 0, true), pTextures[5], pShadows[5]);
            zombie = new Zombie(pTextures[6]);
        }
开发者ID:whztt07,项目名称:DGLE,代码行数:69,代码来源:Program.cs

示例5: PixelShaderController

    public PixelShaderController(IRenderer renderer, ISceneReader sceneReader, IResourceManager resourceManager)
    {
      if (renderer == null) throw new ArgumentNullException("renderer");
      if (sceneReader == null) throw new ArgumentNullException("sceneReader");
      if (resourceManager == null) throw new ArgumentNullException("resourceManager");
      _renderer = renderer;
      _sceneReader = sceneReader;
      _resourceManager = resourceManager;

      _resourceManager.Load(ResourcePath);
      _resourceManager.GetMaterials();
      _scene = _sceneReader.Read(ScenePath);
      _shapes = _scene.Shapes;
      _centralView = new PixelShaderView();
      _centralView.DataContext = this;
    }
开发者ID:dgopena,项目名称:Starter3D.Base,代码行数:16,代码来源:PixelShaderController.cs


注:本文中的IResourceManager.Load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。