本文整理汇总了C#中Xen.SetWindowSizeVector2方法的典型用法代码示例。如果您正苦于以下问题:C# Xen.SetWindowSizeVector2方法的具体用法?C# Xen.SetWindowSizeVector2怎么用?C# Xen.SetWindowSizeVector2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xen
的用法示例。
在下文中一共展示了Xen.SetWindowSizeVector2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Begin
public void Begin(Xen.Graphics.ShaderSystem.ShaderSystemBase state, bool ic, bool ec, Xen.Graphics.ShaderSystem.ShaderExtension ext)
{
if (device != state.DeviceUniqueIndex)
{
device = state.DeviceUniqueIndex;
fx.Dispose();
state.CreateEffect(out fx, fxb, 0, 0);
}
float randX = (float)(random.NextDouble());
float randY = (float)(random.NextDouble());
this.psConstants[4].Z = randX;
this.psConstants[4].W = randY;
//random texture is limited in size, so randomly offset by a tiny amount
randX = (float)((random.NextDouble() * 2 - 1) / 256.0);
randY = (float)((random.NextDouble() * 2 - 1) / 256.0);
this.psConstants[5].X = randX;
this.psConstants[5].Y = randY;
TextureSamplerState point = TextureSamplerState.PointFiltering;
Xen.Graphics.ShaderSystem.ShaderSystemBase shaderSystem = (Xen.Graphics.ShaderSystem.ShaderSystemBase)state;
shaderSystem.SetPixelShaderSampler(0, randTexture, point);
if (positionSize != null)
shaderSystem.SetPixelShaderSampler(1, positionSize, point);
if (velocityRotation != null)
shaderSystem.SetPixelShaderSampler(2, velocityRotation, point);
if (this.colourSamplerIndex != -1)
shaderSystem.SetPixelShaderSampler(this.colourSamplerIndex, colourValues, point);
if (this.userSamplerIndex != -1)
shaderSystem.SetPixelShaderSampler(this.userSamplerIndex, userValues, point);
if (this.lifeSamplerIndex != -1)
shaderSystem.SetPixelShaderSampler(this.lifeSamplerIndex, lifeTexture, point);
state.SetWorldViewProjectionMatrix(ref this.vreg[0], ref this.vreg[1], ref this.vreg[2], ref this.vreg[3], ref this.world);
const float randTextureSize = (float)RandomValueTexture.Resolution;
const float invRandTextureSize = 1.0f / randTextureSize;
if (enabledMoveVS || enabledAddVS)
{
for (int i = 0; i < 4; i++) //copy the WVP matrix
this.vsMoveConstants[i] = this.vreg[i];
vsMoveConstants[6] = new Vector4(randTextureSize, invRandTextureSize, 0, 0);
fx.vs_c.SetValue(this.vsMoveConstants);
fx.ps_c.SetValue(psConstants);
}
else
{
state.SetWindowSizeVector2(ref this.vreg[4], ref this.viewsize);
this.vreg[6] = new Vector4(randTextureSize, invRandTextureSize, 0, 0);
fx.vs_c.SetValue(this.vreg);
fx.ps_c.SetValue(psConstants);
}
state.SetEffect(this, ref fx, Xen.Graphics.ShaderSystem.ShaderExtension.None);
}