本文整理汇总了C#中Loon.Core.Graphics.Opengl.LTexture.Destroy方法的典型用法代码示例。如果您正苦于以下问题:C# LTexture.Destroy方法的具体用法?C# LTexture.Destroy怎么用?C# LTexture.Destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Loon.Core.Graphics.Opengl.LTexture
的用法示例。
在下文中一共展示了LTexture.Destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init(LTexture tex2d, float limit, bool remove, float scale) {
this.isVisible = true;
this.expandLimit = limit;
this.width = tex2d.GetWidth();
this.height = tex2d.GetHeight();
this.scaleWidth = (int) (width * scale);
this.scaleHeight = (int) (height * scale);
this.loopMaxCount = (MathUtils.Max(scaleWidth, scaleHeight) / 2) + 1;
this.fractions = new float[(scaleWidth * scaleHeight) * maxElements];
this.exWidth = (int) (scaleWidth * expandLimit);
this.exHeigth = (int) (scaleHeight * expandLimit);
LImage image = tex2d.GetImage().ScaledInstance(scaleWidth, scaleHeight);
Color[] pixels = image.GetPixels();
if (image != null) {
image.Dispose();
image = null;
}
this.size = pixels.Length;
this.pixmap = new LPixmapData(exWidth, exHeigth, true);
int no = 0, idx = 0;
int length = fractions.Length;
float angle = 0;
float speed = 0;
System.Random random = LSystem.random;
for (int y = 0; y < scaleHeight; y++) {
for (int x = 0; x < scaleWidth; x++) {
if (idx + maxElements < length) {
no = y * scaleWidth + x;
angle = random.Next(360);
speed = 10f / random.Next(30);
fractions[idx + 0] = x;
fractions[idx + 1] = y;
fractions[idx + 2] = (MathUtils.Cos(angle * MathUtils.PI
/ 180) * speed);
fractions[idx + 3] = (MathUtils.Sin(angle * MathUtils.PI
/ 180) * speed);
fractions[idx + 4] = (pixels[no].PackedValue == 0xff00 ? 0xffffff
: pixels[no].PackedValue);
fractions[idx + 5] = x / 6 + random.Next(10);
idx += maxElements;
}
}
}
if (remove) {
if (tex2d != null) {
tex2d.Destroy();
tex2d = null;
}
}
this.tmp = tex2d;
this.StartUsePixelThread();
}
示例2: Close
public static void Close(LTexture texture)
{
if (texture != null)
{
texture.Destroy();
texture = null;
}
}