示例#1
0
        public MainForm()
        {
            InitializeComponent();

            print        = new TextPrinter(new Font("Verdana", 9.0f, FontStyle.Bold));
            hudPage      = HudPages.ModelStats;
            hudBackColor = Color.FromArgb(96, Color.Black);

            glControl1.VSync = Properties.Settings.Default.VSync;
            enableHUDToolStripMenuItem.Checked               = Properties.Settings.Default.EnableHUD;
            disableAllShadersToolStripMenuItem.Checked       = Properties.Settings.Default.DisableAllShaders;
            enableSkeletalRenderingToolStripMenuItem.Checked = Properties.Settings.Default.EnableSkeletalStuff;

            iconImageListSmall = new ImageList()
            {
                ColorDepth = ColorDepth.Depth32Bit, ImageSize = new Size(16, 16)
            };
            iconImageListSmall.Images.Add("folderc", Win32.GetFolderIcon(Win32.IconSize.Small, Win32.FolderType.Closed));
            iconImageListSmall.Images.Add("foldero", Win32.GetFolderIcon(Win32.IconSize.Small, Win32.FolderType.Open));
            iconImageListSmall.Images.Add("default", Win32.GetDllIcon("shell32.dll", 72, Win32.IconSize.Small));

            treeViewEx1.ImageList        = iconImageListSmall;
            treeViewEx1.ImageKey         = "folderc";
            treeViewEx1.SelectedImageKey = "foldero";

            meshToRender = -1;
            renderError  = false;

            this.Text = Program.Description;
        }
示例#2
0
        private void glControl1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.F1)
            {
                hudPage++;
                if ((int)hudPage >= Enum.GetValues(typeof(HudPages)).Length)
                {
                    hudPage = (HudPages)0;
                }
            }
            else if (e.KeyCode == Keys.F5)
            {
                Properties.Settings.Default.EnableTextures = !Properties.Settings.Default.EnableTextures;
            }
            else if (e.KeyCode == Keys.F6)
            {
                GLControl senderControl = (sender as GLControl);
                Properties.Settings.Default.VSync = senderControl.VSync = !senderControl.VSync;
            }
            else if (e.KeyCode == Keys.F7)
            {
                Properties.Settings.Default.AddWireframeOverlay = !Properties.Settings.Default.AddWireframeOverlay;
            }
            else if (e.KeyCode == Keys.F8)
            {
                Properties.Settings.Default.EnableLighting = !Properties.Settings.Default.EnableLighting;
            }
            else if (e.KeyCode == Keys.F9)
            {
                Properties.Settings.Default.DisableAlpha = !Properties.Settings.Default.DisableAlpha;
            }

            // TEST TEMP TODO FIXME HACK
            else if (e.KeyCode == Keys.Back)
            {
                // TEST TEMP TODO FIXME HACK
                modelFile.Root.SklChunk.Bones[0].Rotation = new OpenTK.Vector3(
                    modelFile.Root.SklChunk.Bones[0].Rotation.X + 0.05f,
                    modelFile.Root.SklChunk.Bones[0].Rotation.Y,
                    modelFile.Root.SklChunk.Bones[0].Rotation.Z);
            }
            // TEST TEMP TODO FIXME HACK
        }