本文整理汇总了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
);
}