本文整理汇总了C#中Texture.SetMipmapping方法的典型用法代码示例。如果您正苦于以下问题:C# Texture.SetMipmapping方法的具体用法?C# Texture.SetMipmapping怎么用?C# Texture.SetMipmapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Texture
的用法示例。
在下文中一共展示了Texture.SetMipmapping方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitGL
// =====================================================================
// Updating
// =====================================================================
// =====================================================================
// Shortcuts
// =====================================================================
// =====================================================================
// Overrides
// =====================================================================
// =====================================================================
// Private functions
// =====================================================================
private void InitGL()
{
GL.ClearColor(GlobalSettings.BackgroundColor);
GL.Enable(EnableCap.Texture2D);
GL.ShadeModel(ShadingModel.Smooth); // Enable Smooth Shading
GL.Enable(EnableCap.DepthTest); // Enables Depth Testing
GL.DepthFunc(DepthFunction.Lequal); // The Type Of Depth Testing To Do
GL.Hint(HintTarget.PerspectiveCorrectionHint, HintMode.Nicest); // Really Nice Perspective Calculations
GL.Enable(EnableCap.Blend);
GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)TextureEnvMode.Modulate);
_toolboxUpNormal = new TextureGL(Resources.buttong);
_toolboxUpHover = new TextureGL(Resources.buttong_2);
_toolboxDownNormal = new TextureGL(Resources.buttong_down);
_toolboxDownHover = new TextureGL(Resources.buttong_down2);
_cubeSides = new TextureGL(Resources.cube_sides);
_cubeSides.SetMipmapping(true);
_cubeSides.SetRepeat(true);
_font = new TextureGL(Resources.tinyfont);
_font.SetMipmapping(false);
_font.SetRepeat(false);
_grassTop = new TextureGL(GlobalSettings.GetDataURI("grass.png"));
_grassTop.SetMipmapping(false);
_grassTop.SetRepeat(true);
_dynamicOverlay = new BackgroundImage("Dynamic", "Dynamic", null);
_dynamicOverlay.Item = mDYNAMICOVERLAYToolStripMenuItem;
_backgrounds.Add(_dynamicOverlay);
foreach (string file in Directory.GetFiles(GlobalSettings.GetDataURI("Overlays"), "*.png"))
{
try
{
var image = new TextureGL(file);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp);
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp);
_backgrounds.Add(new BackgroundImage(file, Path.GetFileNameWithoutExtension(file), image));
}
catch
{
MessageBox.Show(this, string.Format(GetLanguageString("B_MSG_OVERLAYERROR"), file));
}
}
int index = 0;
foreach (BackgroundImage b in _backgrounds)
{
ToolStripMenuItem item = b.Item ?? new ToolStripMenuItem(b.Name);
b.Item = item;
if (b.Path == GlobalSettings.LastBackground)
{
item.Checked = true;
_selectedBackground = index;
}
item.Click += item_Clicked;
item.Tag = index++;
if (!backgroundsToolStripMenuItem.DropDownItems.Contains(item))
backgroundsToolStripMenuItem.DropDownItems.Add(item);
}
_previewPaint = new TextureGL();
GlobalDirtiness.CurrentSkin = new TextureGL();
_alphaTex = new TextureGL();
var arra = new byte[64 * 32];
_previewPaint.Upload(arra, 64, 32);
_previewPaint.SetMipmapping(false);
_previewPaint.SetRepeat(false);
GlobalDirtiness.CurrentSkin.Upload(arra, 64, 32);
GlobalDirtiness.CurrentSkin.SetMipmapping(false);
GlobalDirtiness.CurrentSkin.SetRepeat(false);
arra = new byte[]
{
127,
127,
127,
//.........这里部分代码省略.........