Exception:
System.Reflection.TargetInvocationException was unhandled
Message="Obiekt docelowy wywołania zgłosił wyjątek."
Source="mscorlib"
StackTrace:
w System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
w System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
w System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
w System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
w System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)
w NeHe.NeHe.SelectExample() w C:\Program Files\TaoFramework\source\examples\NeHe\NeHe.cs:wiersz 73
w NeHe.NeHe.lstExamples_SelectedIndexChanged(Object sender, EventArgs e) w C:\Program Files\TaoFramework\source\examples\NeHe\NeHe.cs:wiersz 79
w System.Windows.Forms.Control.OnDoubleClick(EventArgs e)
w System.Windows.Forms.ListBox.WndProc(Message& m)
w System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
w System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
w System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
w System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
w System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
w System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
w System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
w System.Windows.Forms.Application.Run(Form mainForm)
w NeHe.Program.Main() w C:\Program Files\TaoFramework\source\examples\NeHe\Program.cs:wiersz 44
w System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
w System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
w Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
w System.Threading.ThreadHelper.ThreadStart_Context(Object state)
w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
w System.Threading.ThreadHelper.ThreadStart()
InnerException:
Message="BŁĄD!
w Tao.OpenGl.Gl.Imports.ActiveTexture(Int32 texture)
w Tao.OpenGl.Gl.glActiveTexture(Int32 texture)
w NeHe.Lesson05.build_texture() w C:\\Program Files\\TaoFramework\\source\\examples\\NeHe\\Lesson05.cs:wiersz 460"
Source="NeHe"
StackTrace:
w NeHe.Lesson05.build_texture() w C:\Program Files\TaoFramework\source\examples\NeHe\Lesson05.cs:wiersz 476
w NeHe.Lesson05.InitGL() w C:\Program Files\TaoFramework\source\examples\NeHe\Lesson05.cs:wiersz 420
w NeHe.Lesson05.CreateGLWindow(String title, Int32 width, Int32 height, Int32 bits, Boolean fullscreenflag) w C:\Program Files\TaoFramework\source\examples\NeHe\Lesson05.cs:wiersz 317
w NeHe.Lesson05.Run() w C:\Program Files\TaoFramework\source\examples\NeHe\Lesson05.cs:wiersz 136
InnerException:
I was editing some NeHe tutorials.
Message = “Target object of the call throws an exception”
Debugger report it here:
private void SelectExample()
{
if (lstExamples.SelectedItem != null)
{
Type example = Assembly.GetExecutingAssembly().GetType("NeHe." + lstExamples.SelectedItem.ToString(), true, true);
example.InvokeMember("Run", BindingFlags.InvokeMethod, null, null, null); /*Highlighted by debugger*/
}
}
but after investigation I found that problem is line when i try to generate texture3d:
Gl.glTexImage3D(Gl.GL_TEXTURE_3D, 0, (int)Gl.GL_RGB8, 1, 1, 1, 1, Gl.GL_BGR_EXT, Gl.GL_UNSIGNED_BYTE, IntPtr.Zero);
I hope all parameters are alright… Otherwise exception would point it.
But anyway I would prefer just a simple example of glTexImage3D.
Thanks for replying!