使用ILNumerics在OpenGL渲染器中不显示任何标签

时间:2014-01-19 23:53:03

标签: c# opengl ilnumerics

每当我尝试使用OpenGL渲染场景时,都不会显示任何文本。文本使用GDI显示正常,但渲染当然非常慢。

我在Windows 8.1 Pro上使用的是Radeon 7850,其中包含今天下载的最新Catalyst驱动程序13.12和Visual Studio 2012。

输出中有一个DllNotFoundException,但不幸的是它没有说明缺少哪一个。

输出:

'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'D:\tt\blah\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'
The thread 'vshost.NotifyLoad' (0x48) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x600) has exited with code 0 (0x0).
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'D:\tt\blah\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe', Symbols loaded.
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'D:\tt\blah\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\ILNumerics.dll'
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
32 bit process detected.
Adding dependency directory to PATH environment variable: 
D:\tt\blah\WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\bin32
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll'
A first chance exception of type 'System.DllNotFoundException' occurred in ILNumerics.dll
A first chance exception of type 'System.TypeInitializationException' occurred in ILNumerics.dll
A first chance exception of type 'System.DllNotFoundException' occurred in ILNumerics.dll
'WindowsFormsApplication3.vshost.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted DynamicMethods Assembly'
OpenGL Version string follows...:
3.1.12618 Compatibility Profile Context 13.251.0.0
Extracted version number: 3.1
Recreate Shape: ILPoints #57(S) '' VAO:1, P(GLID:3):PositionBuffer [10000] I(GLID:6):IndexBuffer [0] C(GLID:4):ColorBuffer [10000] N(GLID:5):NormalBuffer [0]
Recreate Shape: ILLines #29(S) 'PlotCubeLines' VAO:2, P(GLID:10):PositionBuffer [8] I(GLID:13):IndexBuffer [24] C(GLID:11):ColorBuffer [0] N(GLID:12):NormalBuffer [0]
Recreate Shape: ILLines #74 'TickLines' VAO:3, P(GLID:14):PositionBuffer [6] I(GLID:17):IndexBuffer [0] C(GLID:15):ColorBuffer [0] N(GLID:16):NormalBuffer [0]
Recreate Shape: ILLines #37(S) 'GridMajorLines' VAO:4, P(GLID:18):PositionBuffer [4] I(GLID:21):IndexBuffer [0] C(GLID:19):ColorBuffer [0] N(GLID:20):NormalBuffer [0]
Recreate Shape: ILLines #38(S) 'GridMinorLines' VAO:5, P(GLID:22):PositionBuffer [0] I(GLID:25):IndexBuffer [0] C(GLID:23):ColorBuffer [0] N(GLID:24):NormalBuffer [0]
Recreate Shape: ILLines #82 'TickLines' VAO:6, P(GLID:26):PositionBuffer [8] I(GLID:29):IndexBuffer [0] C(GLID:27):ColorBuffer [0] N(GLID:28):NormalBuffer [0]
Recreate Shape: ILLines #45(S) 'GridMajorLines' VAO:7, P(GLID:30):PositionBuffer [6] I(GLID:33):IndexBuffer [0] C(GLID:31):ColorBuffer [0] N(GLID:32):NormalBuffer [0]
Recreate Shape: ILLines #46(S) 'GridMinorLines' VAO:8, P(GLID:34):PositionBuffer [0] I(GLID:37):IndexBuffer [0] C(GLID:35):ColorBuffer [0] N(GLID:36):NormalBuffer [0]
Recreate Shape: ILLines #90 'TickLines' VAO:9, P(GLID:38):PositionBuffer [2] I(GLID:41):IndexBuffer [0] C(GLID:39):ColorBuffer [0] N(GLID:40):NormalBuffer [0]
Recreate Shape: ILLines #53(S) 'GridMajorLines' VAO:10, P(GLID:42):PositionBuffer [0] I(GLID:45):IndexBuffer [0] C(GLID:43):ColorBuffer [0] N(GLID:44):NormalBuffer [0]
Recreate Shape: ILLines #54(S) 'GridMinorLines' VAO:11, P(GLID:46):PositionBuffer [0] I(GLID:49):IndexBuffer [0] C(GLID:47):ColorBuffer [0] N(GLID:48):NormalBuffer [0]
The thread 'vshost.RunParkingWindow' (0x98) has exited with code 0 (0x0).
The thread '<No Name>' (0x10d4) has exited with code 0 (0x0).
The program '[4332] WindowsFormsApplication3.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

新Windows Forms项目中的源代码Form1.cs,带有一个ILPanel和一个Button,以及使用NuGet添加的ILNumerics(Any CPU):

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using ILNumerics;
using ILNumerics.Drawing;
using ILNumerics.Data;
using ILNumerics.Misc;
using ILNumerics.Drawing.Plotting;
using ILNumerics.Algorithms;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // create a matrix A, give values explicitely
            ILArray<double> A = ILMath.array<double>(
                    new double[] { 1, 1, 1, 1, 1, 2, 3, 4, 1, 3, 6, 10, 1, 4, 10, 20 }, 4, 4);
            // use a creation function for B
            ILArray<double> B = ILMath.counter(4, 2);

            // use a function of the base class: ILMath.linsolve 
            ILArray<double> Result = ILMath.linsolve(A, B);
        }

        private void ilPanel1_Load(object sender, EventArgs e)
        {

            ILArray<float> A = ILMath.tosingle(ILMath.rand(3, 10000));

            var scene = new ILScene {
        new ILPlotCube(twoDMode: false) {
            new ILPoints {
                Positions = A,
                Color = null,
                Colors = A,
                Size = 2,
            }
        }
    };
            var pcsm = scene.First<ILPlotCube>().ScaleModes;
            pcsm.XAxisScale = AxisScale.Logarithmic;
            pcsm.YAxisScale = AxisScale.Logarithmic;
            pcsm.ZAxisScale = AxisScale.Logarithmic;

            ilPanel1.Scene = scene; 

        }
    }
}

1 个答案:

答案 0 :(得分:0)

OpenGL版本太低了。您的卡已允许创建3.1上下文。 ILNumerics至少需要3.3。