本文整理汇总了C#中__Native类的典型用法代码示例。如果您正苦于以下问题:C# __Native类的具体用法?C# __Native怎么用?C# __Native使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
__Native类属于命名空间,在下文中一共展示了__Native类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Size = @ref.Size;
this.SizeImageInfo = @ref.SizeImageInfo;
this.ViewCount = @ref.ViewCount;
this.ButtonCount = @ref.ButtonCount;
this.AxeCount = @ref.AxeCount;
this.PovCount = @ref.PovCount;
this.BufferSize = @ref.BufferSize;
this.BufferUsed = @ref.BufferUsed;
this.ImageInfoArrayPointer = @ref.ImageInfoArrayPointer;
if (this.BufferSize > 0 && this.ImageInfoArrayPointer != IntPtr.Zero)
{
int nbImageInfoElements = BufferSize/ sizeof(DeviceImage.__Native);
Images = new DeviceImage[nbImageInfoElements];
var pImageInfo = (DeviceImage.__Native*)this.ImageInfoArrayPointer;
for (int i = 0; i < Images.Length; i++)
{
var image = new DeviceImage();
image.__MarshalFrom(ref *pImageInfo);
pImageInfo++;
}
}
}
开发者ID:numo16,项目名称:SharpDX,代码行数:26,代码来源:DeviceImageHeader.cs
示例2: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.FontFace = (@ref.FontFace == IntPtr.Zero) ? null : new FontFace(@ref.FontFace);
// If FontFace != null, adds a reference to it
if (FontFace != null)
((IUnknown) this.FontFace).AddReference();
this.FontSize= @ref.FontEmSize;
this.GlyphCount = @ref.GlyphCount;
if (@ref.GlyphIndices != IntPtr.Zero)
{
Indices = new short[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphIndices, Indices, 0, GlyphCount);
}
if (@ref.GlyphAdvances != IntPtr.Zero)
{
Advances = new float[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphAdvances, Advances, 0, GlyphCount);
}
if (@ref.GlyphOffsets != IntPtr.Zero)
{
Offsets = new GlyphOffset[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphOffsets, Offsets, 0, GlyphCount);
}
this.IsSideways = @ref.IsSideways;
this.BidiLevel = @ref.BidiLevel;
}
开发者ID:rbwhitaker,项目名称:SharpDX,代码行数:32,代码来源:GlyphRun.cs
示例3: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.LocaleName = (this.LocaleName == null) ? IntPtr.Zero : Marshal.StringToHGlobalUni(this.LocaleName);
@ref.Text = (this.Text == null) ? IntPtr.Zero : Marshal.StringToHGlobalUni(this.Text);
@ref.TextLength = (this.Text == null)?0: this.Text.Length;
@ref.ClusterMap = this.ClusterMap;
@ref.TextPosition = this.TextPosition;
}
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:9,代码来源:GlyphRunDescription.cs
示例4: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.LocaleName = (@ref.LocaleName == IntPtr.Zero) ? null : Marshal.PtrToStringUni(@ref.LocaleName);
this.Text = (@ref.Text == IntPtr.Zero) ? null : Marshal.PtrToStringUni(@ref.Text, @ref.TextLength);
this.TextLength = @ref.TextLength;
this.ClusterMap = @ref.ClusterMap;
this.TextPosition = @ref.TextPosition;
}
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:9,代码来源:GlyphRunDescription.cs
示例5: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(__Native* @ref)
{
this.Format = null;
this.FormatPointer = @ref->FormatPointer;
if (this.FormatPointer != IntPtr.Zero)
this.Format = WaveFormat.MarshalFrom(this.FormatPointer);
this.MaxFrameCount = @ref->MaxFrameCount;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:9,代码来源:LockParameters.cs
示例6: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Category = @ref.Category;
this.Severity = @ref.Severity;
this.Id = @ref.Id;
this.Description = (@ref.PDescription == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(@ref.PDescription, @ref.DescriptionByteLength);
this.DescriptionByteLength = @ref.DescriptionByteLength;
}
开发者ID:RadioSpace,项目名称:SharpDX,代码行数:9,代码来源:Message.cs
示例7: UpdateNative
internal void UpdateNative(ref __Native native, IntPtr pinBuffer)
{
native.Pointer = pinBuffer;
if (managedData != null)
{
native.Size = managedData.Length;
}
}
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:8,代码来源:ShaderBytecode.cs
示例8: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Size = @ref.Size;
this.ObjectSize = @ref.ObjectSize;
this.Flags = @ref.Flags;
this.DataSize = @ref.DataSize;
this.ObjectArrayCount = @ref.ObjectArrayCount;
this.ObjectArrayPointer = @ref.ObjectArrayPointer;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:10,代码来源:DataFormat.cs
示例9: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.AttribId = @ref.AttribId;
this.FaceStart = @ref.FaceStart;
this.FaceCount = @ref.FaceCount;
this.VertexStart = @ref.VertexStart;
this.VertexCount = @ref.VertexCount;
this.BonedIdsPointer = @ref.BonedIdsPointer;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:10,代码来源:BoneCombination.cs
示例10: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.Size = this.Size;
@ref.Flags = this.Flags;
@ref.BufferBytes = this.BufferBytes;
@ref.Reserved = this.Reserved;
@ref.pFormat = WaveFormat.MarshalToPtr(Format);
@ref.AlgorithmFor3D = this.AlgorithmFor3D;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:10,代码来源:SoundBufferDescription.cs
示例11: __MarshalFrom
// Method to marshal from native to managed struct
internal void __MarshalFrom(ref __Native @ref)
{
waveFormatTag = @ref.pcmWaveFormat.waveFormatTag;
channels = @ref.pcmWaveFormat.channels;
sampleRate = @ref.pcmWaveFormat.sampleRate;
averageBytesPerSecond = @ref.pcmWaveFormat.averageBytesPerSecond;
blockAlign = @ref.pcmWaveFormat.blockAlign;
bitsPerSample = @ref.pcmWaveFormat.bitsPerSample;
extraSize = @ref.extraSize;
}
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:11,代码来源:WaveFormat.cs
示例12: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.waveFormatTag = @ref.pcmWaveFormat.waveFormatTag;
this.channels = @ref.pcmWaveFormat.channels;
this.sampleRate = @ref.pcmWaveFormat.sampleRate;
this.averageBytesPerSecond = @ref.pcmWaveFormat.averageBytesPerSecond;
this.blockAlign = @ref.pcmWaveFormat.blockAlign;
this.bitsPerSample = @ref.pcmWaveFormat.bitsPerSample;
this.extraSize = @ref.extraSize;
}
开发者ID:numo16,项目名称:SharpDX,代码行数:11,代码来源:WaveFormat.cs
示例13: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Category = @ref.Category;
this.Priority = @ref.Priority;
this.Pitch = @ref.Pitch;
this.Volume = @ref.Volume;
this.TrackProperties = new TrackProperties[@ref.NumTracks];
fixed (void* ptr = &@ref.TrackPropertiesPointer)
Utilities.Read((IntPtr) ptr, this.TrackProperties, 0, @ref.NumTracks);
}
开发者ID:GrafSeismo,项目名称:SharpDX,代码行数:11,代码来源:SoundProperties.cs
示例14: __MarshalTo
// Method to marshal from managed struct tot native
internal void __MarshalTo(ref __Native @ref)
{
@ref.pcmWaveFormat.waveFormatTag = waveFormatTag;
@ref.pcmWaveFormat.channels = channels;
@ref.pcmWaveFormat.sampleRate = sampleRate;
@ref.pcmWaveFormat.averageBytesPerSecond = averageBytesPerSecond;
@ref.pcmWaveFormat.blockAlign = blockAlign;
@ref.pcmWaveFormat.bitsPerSample = bitsPerSample;
@ref.extraSize = extraSize;
}
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:11,代码来源:WaveFormat.cs
示例15: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.AttribId = this.AttribId;
@ref.FaceStart = this.FaceStart;
@ref.FaceCount = this.FaceCount;
@ref.VertexStart = this.VertexStart;
@ref.VertexCount = this.VertexCount;
@ref.BonedIdsPointer = IntPtr.Zero;
if (BoneIds != null)
@ref.BonedIdsPointer = Marshal.AllocHGlobal(BoneIds.Length*sizeof (int));
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:12,代码来源:BoneCombination.cs
示例16: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.LpfDirectCoefficient = @ref.LPFDirectCoefficient;
this.LpfReverbCoefficient = @ref.LPFReverbCoefficient;
this.ReverbLevel = @ref.ReverbLevel;
this.DopplerFactor = @ref.DopplerFactor;
this.EmitterToListenerAngle = @ref.EmitterToListenerAngle;
this.EmitterToListenerDistance = @ref.EmitterToListenerDistance;
this.EmitterVelocityComponent = @ref.EmitterVelocityComponent;
this.ListenerVelocityComponent = @ref.ListenerVelocityComponent;
}
开发者ID:alexey-bez,项目名称:SharpDX,代码行数:12,代码来源:DspSettings.cs
示例17: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.EffectFilename = (this.EffectFilename == null) ? IntPtr.Zero : Marshal.StringToHGlobalAnsi(this.EffectFilename);
var defaultsNative = (EffectDefault.__Native*)Marshal.AllocHGlobal(Defaults.Length * sizeof(EffectDefault.__Native));
for (int i = 0; i < Defaults.Length; i++)
{
Defaults[i].__MarshalTo(ref defaultsNative[i]);
}
@ref.DefaultCount = Defaults.Length;
@ref.DefaultPointer = (IntPtr)defaultsNative;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:12,代码来源:EffectInstance.cs
示例18: __MarshalTo
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.FormatPointer = IntPtr.Zero;
if (Format != null)
{
int sizeOfFormat = Marshal.SizeOf(Format);
@ref.FormatPointer = Marshal.AllocCoTaskMem(sizeOfFormat);
Marshal.StructureToPtr(Format, @ref.FormatPointer, false);
}
@ref.MaxFrameCount = this.MaxFrameCount;
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:11,代码来源:LockParameters.cs
示例19: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.EffectFilename = (@ref.EffectFilename == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(@ref.EffectFilename);
var defaultsNative = new EffectDefault.__Native[@ref.DefaultCount];
Utilities.Read(@ref.DefaultPointer, defaultsNative, 0, defaultsNative.Length);
Defaults = new EffectDefault[defaultsNative.Length];
for (int i = 0; i < Defaults.Length; i++)
{
Defaults[i] = new EffectDefault();
Defaults[i].__MarshalFrom(ref defaultsNative[i]);
}
}
开发者ID:Nezz,项目名称:SharpDX,代码行数:13,代码来源:EffectInstance.cs
示例20: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Category = @ref.Category;
this.Priority = @ref.Priority;
this.Pitch = @ref.Pitch;
this.Volume = @ref.Volume;
this.TrackProperties = new TrackProperties[@ref.NumTracks];
// if there are no tracks - don't read the properties, otherwise a IndexOutOfRangeException is thrown.
if (@ref.NumTracks > 0)
{
fixed (void* ptr = &@ref.TrackPropertiesPointer)
Utilities.Read((IntPtr)ptr, this.TrackProperties, 0, @ref.NumTracks);
}
}
开发者ID:QuantumDeveloper,项目名称:SharpDX,代码行数:16,代码来源:SoundProperties.cs
注:本文中的__Native类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论