當前位置: 首頁>>代碼示例>>C#>>正文


C# IntPtr.Copy方法代碼示例

本文整理匯總了C#中System.IntPtr.Copy方法的典型用法代碼示例。如果您正苦於以下問題:C# IntPtr.Copy方法的具體用法?C# IntPtr.Copy怎麽用?C# IntPtr.Copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IntPtr的用法示例。


在下文中一共展示了IntPtr.Copy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Init

        void Init(IntPtr pParam)
        {
            IEngineSubSystem pSubSys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_CORE_RENDERER, out pSubSys);
            pCoreRenderer = (ICoreRenderer)pSubSys;

            pEngineCore.GetSubSystem(E_ENGINE_SUB_SYSTEM.ESS_RENDER, out pSubSys);
            IRender pRender = (IRender)pSubSys;
            pRender.GetRender3D(out pRender3D);
            TColor4 c = TColor4.ColorGray();
            pRender.SetClearColor(ref c);

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

            IEngineBaseObject pBaseObj;

            const uint load_3d_flag = (uint)(E_TEXTURE_LOAD_FLAGS.TLF_FILTERING_ANISOTROPIC |
                       E_TEXTURE_LOAD_FLAGS.TLF_ANISOTROPY_4X | E_TEXTURE_LOAD_FLAGS.TLF_GENERATE_MIPMAPS);

            pResMan.Load(RESOURCE_PATH + "fonts\\Times_New_Roman_18_Bold.dft", out pBaseObj,
                (uint)E_BITMAP_FONT_LOAD_FLAGS.BFLF_GENERATE_MIPMAPS);
            pFont = (IBitmapFont)pBaseObj;
            pResMan.Load(RESOURCE_PATH + "textures\\grass.jpg", out pBaseObj, load_3d_flag |
                (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_REPEAT /* cause we will tile this texture */);
            pTexGrass = (ITexture)pBaseObj;

            pResMan.Load(RESOURCE_PATH + "sprites\\cartoon_owl.png", out pBaseObj, load_3d_flag | (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_CLAMP);
            pTexOwl = (ITexture)pBaseObj;
            pTexOwl.SetFrameSize(48, 128);

            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_1.png", out pBaseObj, load_3d_flag | (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_CLAMP);
            pTexTree1 = (ITexture)pBaseObj;
            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_1.dmd", out pBaseObj, (uint)E_MESH_MODEL_LOAD_FLAGS.MMLF_FORCE_MODEL_TO_MESH);
            pMeshTree1 = (IMesh)pBaseObj;

            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_2.png", out pBaseObj, load_3d_flag | (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_CLAMP);
            pTexTree2 = (ITexture)pBaseObj;
            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_2.dmd", out pBaseObj, (uint)E_MESH_MODEL_LOAD_FLAGS.MMLF_FORCE_MODEL_TO_MESH);
            pMeshTree2 = (IMesh)pBaseObj;

            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_3.png", out pBaseObj, load_3d_flag | (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_CLAMP);
            pTexTree3 = (ITexture)pBaseObj;
            pResMan.Load(RESOURCE_PATH + "meshes\\trees\\tree_3.dmd", out pBaseObj, (uint)E_MESH_MODEL_LOAD_FLAGS.MMLF_FORCE_MODEL_TO_MESH);
            pMeshTree3 = (IMesh)pBaseObj;

            pResMan.Load(RESOURCE_PATH + "meshes\\zard\\zard_diff.dds", out pBaseObj, load_3d_flag | (uint)E_TEXTURE_LOAD_FLAGS.TLF_COORDS_CLAMP);
            pTexZard = (ITexture)pBaseObj;
            pResMan.Load(RESOURCE_PATH + "meshes\\zard\\zard_walk.dmd", out pBaseObj, 0);
            pModelZard = (IModel)pBaseObj;

            // add some fog to the scene
            pRender3D.SetFogColor(ref c);
            pRender3D.SetLinearFogBounds(1.5f, 4f);
            pRender3D.ToggleFog(true);

            PlaneDataPtr = Unmanaged.New<float>(c_afPlane.Length);
            PlaneDataPtr.Copy(c_afPlane);

            desc = new TDrawDataDesc
            (
               PlaneDataPtr,
               12 * sizeof(float),
               24 * sizeof(float),
               false
            );
        }
開發者ID:whztt07,項目名稱:DGLE,代碼行數:69,代碼來源:Program.cs


注:本文中的System.IntPtr.Copy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。