当前位置: 首页>>代码示例>>C#>>正文


C# Texture.SetMipmapping方法代码示例

本文整理汇总了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,
//.........这里部分代码省略.........
开发者ID:rmbzlib,项目名称:mcskin3d,代码行数:101,代码来源:Editor.cs


注:本文中的Texture.SetMipmapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。