Ejemplo n.º 1
0
        private void setData()
        {
            EXTENSION[] exts = NativeWrapper.queryExtensions();

            System.Windows.Forms.TreeView tree = getTreeExtensions();
            IEnumerator it = tree.Nodes.GetEnumerator();

            it.MoveNext();
            TreeNode node = (TreeNode)it.Current;

            while (null != node)
            {
                if ((null != node.Tag) && (node.Text.Length > 1))
                {
                    EXTENSION ext = exts.First(e => e.extensionName == node.Text);
                    node.Checked = ext.active;
                }

                TreeNode child = node.FirstNode;
                if (null != child)
                {
                    node = child;
                }
                else
                {
                    TreeNode next = node.NextNode;
                    if (null != next)
                    {
                        node = next;
                    }
                    else
                    {
                        TreeNode parent = node.Parent;
                        node = parent.NextNode;
                    }
                }
            }

            {
                EXTENSION ext = exts.First(e => e.extensionName == "RAPTOR_SMP_CODE_GENERATION");
                SMP.Checked  = ext.active;
                ext          = exts.First(e => e.extensionName == "RAPTOR_SSE_CODE_GENERATION");
                SSE.Checked  = ext.active;
                ext          = exts.First(e => e.extensionName == "RAPTOR_SSE2_CODE_GENERATION");
                SSE2.Checked = ext.active;
            }
        }
Ejemplo n.º 2
0
        public static Builder.EXTENSION[] queryExtensions()
        {
            uint size = 0;

            bool res = NativeWrapper.getExtensions(null, ref size);

            if (res && size > 0)
            {
                NativeWrapper.NATIVE_EXTENSION[] exts = new NativeWrapper.NATIVE_EXTENSION[size];
                res = NativeWrapper.getExtensions(exts, ref size);

                if (res)
                {
                    EXTENSION[] extensions = new EXTENSION[size];
                    for (int i = 0; i < size; i++)
                    {
                        IntPtr ptr = exts[i].dependencies;
                        int    nb  = (int)exts[i].nb_dependencies;

                        List <string> ls = GetAllStrings(ptr, nb);

                        string extName = Marshal.PtrToStringAnsi(exts[i].extensionName);

                        extensions[i].kind          = exts[i].kind;
                        extensions[i].active        = exts[i].active;
                        extensions[i].extensionName = extName;
                        extensions[i].dependencies  = ls.ToArray();
                    }

                    return(extensions);
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
        private void InitTree()
        {
            Graphics g = CreateGraphics();

            System.IntPtr hDC = g.GetHdc();

            bool res = NativeWrapper.glvkInitBuilder(hDC);

            g.ReleaseHdc(hDC);
            g.Dispose();


            System.Windows.Forms.TreeView tree = getTreeExtensions();
            tree.BeginUpdate();

            TreeNode GL_root         = tree.Nodes.Add(GL_Label);
            TreeNode GL_profile_root = tree.Nodes.Add(GLProfile_Label);
            TreeNode VK_root         = tree.Nodes.Add(VK_Label);
            TreeNode ARB_root        = tree.Nodes.Add(ARB_Label);
            TreeNode VK_KHR_root     = tree.Nodes.Add(VK_KHR_Label);
            TreeNode ATI_root        = tree.Nodes.Add(ATI_Label);
            TreeNode EXT_root        = tree.Nodes.Add(EXT_Label);
            TreeNode NV_root         = tree.Nodes.Add(NV_Label);
            TreeNode KHR_root        = tree.Nodes.Add(KHR_Label);
            TreeNode _3DFX_root      = tree.Nodes.Add(_3DFX_Label);
            TreeNode OES_root        = tree.Nodes.Add(OES_Label);
            TreeNode WGL_root        = tree.Nodes.Add(WGL_Label);

            if (res)
            {
                EXTENSION[] exts = NativeWrapper.queryExtensions();
                for (uint i = 0; i < exts.Count(); i++)
                {
                    EXTENSION extension = exts[i];
                    TreeNode  root      = null;

                    switch (extension.kind)
                    {
                    case EXTENSION_KIND.COREGL:
                        root = GL_root;
                        break;

                    case EXTENSION_KIND.GLPROFILE:
                        root = GL_profile_root;
                        break;

                    case EXTENSION_KIND.COREVK:
                        root = VK_root;
                        break;

                    case EXTENSION_KIND.ARB:
                        root = ARB_root;
                        break;

                    case EXTENSION_KIND.VK:
                        root = VK_KHR_root;
                        break;

                    case EXTENSION_KIND.ATI:
                        root = ATI_root;
                        break;

                    case EXTENSION_KIND.EXT:
                        root = EXT_root;
                        break;

                    case EXTENSION_KIND.NV:
                        root = NV_root;
                        break;

                    case EXTENSION_KIND.KHR:
                        root = KHR_root;
                        break;

                    case EXTENSION_KIND.WGL:
                        root = WGL_root;
                        break;

                    case EXTENSION_KIND._3DFX:
                        root = _3DFX_root;
                        break;

                    case EXTENSION_KIND.OES:
                        root = OES_root;
                        break;

                    case EXTENSION_KIND.CPU:
                        if (extension.extensionName == "RAPTOR_SMP_CODE_GENERATION")
                        {
                            SMP.Checked = true;
                        }
                        else if (extension.extensionName == "RAPTOR_SSE_CODE_GENERATION")
                        {
                            SSE.Checked = true;
                        }
                        else if (extension.extensionName == "RAPTOR_SSE2_CODE_GENERATION")
                        {
                            SSE2.Checked = true;
                        }
                        break;
                    }

                    if (null != root)
                    {
                        TreeNode item = root.Nodes.Add(extension.extensionName);
                        item.Checked = extension.active;
                        item.Tag     = extension.kind;
                    }
                }
            }

            tree.Sort();
            tree.ExpandAll();
            tree.EndUpdate();
        }