Tao update
Submitted by Borrillis on March 7, 2008 - 6:11pm.
Would it be possible to get an updated offical release of Tao with all the changes for OpenGL and Platform.Windows? I still can't get Tao 2.0 offical download + the updates from these forums to work properly. An offical tested drop would be much appreciated.

I agree, it is time for a
I agree, it is time for a new release.
------
OpenTK
I second that... But,
I second that...
But, Borrillis, the latest snapshots should work without a problem (at least OpenGL and Windows, which are probably the best maintained parts of TAO). So if you're having trouble with them, please tell so we can fix it before a release.
Hi Borrillis, let us know
Hi Borrillis, let us know the test conditions and any issues you are running into with the SVN version of Tao. I also have SVN access to Axiom so I can help out on this effort. I assume we should test against the Crickhollow version of Axiom?
One thing that may hold up
One thing that may hold up the release is that I am trying to update the Windows installer. The NSIS version has problems with installing/uninstalling into the GAC. I am trying to create a Wix installer, but the learning curve is pretty steep. I also am working on an OSX installer as well. Anyone is welcome to help
.
Here's the latest one, and
Here's the latest one, and this is using version *.12 of Tao.OpenGL
Object reference not set to an instance of an object.
at Tao.Platform.Windows.Wgl.wglGetExtensionsStringARB(IntPtr hdc)
at Axiom.RenderSystems.OpenGL.GLSupport._initializeWgl() in D:\Projects\Game Development\Axiom\crickhollow\Projects\Axiom\Source\RenderSystems\OpenGL\Win32\GLHelper.cs:line 124
at Axiom.RenderSystems.OpenGL.GLSupport.Start() in D:\Projects\Game Development\Axiom\crickhollow\Projects\Axiom\Source\RenderSystems\OpenGL\Win32\GLHelper.cs:line 305
at Axiom.RenderSystems.OpenGL.GLRenderSystem.Initialize(Boolean autoCreateWindow, String windowTitle) in D:\Projects\Game Development\Axiom\crickhollow\Projects\Axiom\Source\RenderSystems\OpenGL\GLRenderSystem.cs:line 1488
at Axiom.Core.Root.Initialize(Boolean autoCreateWindow, String windowTitle) in D:\Projects\Game Development\Axiom\crickhollow\Projects\Axiom\Source\Engine\Core\Root.cs:line 477
at Axiom.Demos.TechDemo.Setup() in D:\Projects\Game Development\Axiom\crickhollow\Projects\AxiomDemos\Source\Demos\TechDemo.cs:line 148
at Axiom.Demos.TechDemo.Start() in D:\Projects\Game Development\Axiom\crickhollow\Projects\AxiomDemos\Source\Demos\TechDemo.cs:line 211
A first chance exception of type 'System.NullReferenceException' occurred in Axiom.Demos.dll
And this is the code ( previous code is commented )
IntPtr wglGetExtensionsStringARB = Wgl.wglGetProcAddress( "wglGetExtensionsStringARB" );
// check for pixel format and multisampling support
if ( wglGetExtensionsStringARB != IntPtr.Zero )
{
string exts = Wgl.wglGetExtensionsStringARB( hdc ); // Tao 2.0
//string exts = Wgl.wglGetExtensionsStringARB( wglGetExtensionsStringARB, hdc );
_hasPixelFormatARB = exts.Contains( "WGL_ARB_pixel_format" );
_hasMultisample = exts.Contains( "WGL_ARB_multisample" );
}
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Try replacing the above code
Try replacing the above code with a call to e.g.
Wgl.IsExtensionSupported("WGL_ARB_pixel_format");If the NRE still occurs, try placing a call to
Wgl.ReloadFunctions();just prior to this code.------
OpenTK
Also make sure you have
Also make sure you have updated Platform.Windows, as that's were Wgl resides. It's recently updated to support wgl extensions, in the same style as we do for OpenGL (as StApostol showed).
I'm using Tao Source right
I'm using Tao Source right now so I can debug this. It looks like it's not finding that delegate properly, it's finding others, but just not that one.
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Now I'm getting the 'Object
Now I'm getting the 'Object not set' on this line
Wgl.wglSwapIntervalEXT( vsync ? 1 : 0 ); // Tao 2.0
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Ah, success, and I think I
Ah, success, and I think I found the pattern that was failing. I need to use Wgl.IsExtensionSupported() instead of
IntPtr wglEXT = Wgl.wglGetProcAddress( "Ext" );
//if ( wglEXT != IntPtr.Zero )
Ok, now onto the problems in Ubuntu and SDL
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
What does
What does Wgl.IsExtensionSupported("WGL_EXT_swap_control") say? And do you know your driver supports it?
Edit:
Yes, you found it! Tao 2.0 did not support Wgl extensions, so you had to load them yourself. In the current svn you shouldn't need to use GetProcAddress anywhere.
AFAIK if(Wgl.wglSwapIntervalExt != null) should also work, but using IsExtensionSupported is better.
Argh! IsExtensionSupported
Argh!
IsExtensionSupported is returning false because it can't find that extension in the list. In Wgl.BuildExtensionList() : 267
extension_string = wglGetExtensionsStringARB(wglGetCurrentDC());
Throws a NullReferenceException and then eats it.
The NullReferenceExceptions is actually generated in Wgl.cs:499 return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(Delegates.wglGetExtensionsStringARB((IntPtr)hdc));
because Delegates.wglGetExtensionsStringARB is null;
And calling Wgl.ReloadFunctions() earlier hadn't helped. But if I call it right before the call to IsExtensionSupported, it works. Now the only thing between the two calls to ReloadFunctions() are two gl calls:
IntPtr hrc = Wgl.wglCreateContext( hdc );
if ( hrc != IntPtr.Zero )
{
// if wglMakeCurrent fails, wglGetProcAddress will return null
Wgl.wglMakeCurrent( hdc, hrc );
So what Wgl methods cause me to have to call ReloadFunctions?
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Using Tao 2.0 on ubuntu I'm
Using Tao 2.0 on ubuntu I'm getting some wierd problems, this code:
GlExtensionLoader.LoadAllExtensions();
// get the OpenGL version string and vendor name
_glVersion = Gl.glGetString( Gl.GL_VERSION ); // TAO 2.0
_videoCard = Gl.glGetString( Gl.GL_RENDERER ); // TAO 2.0
_vendor = Gl.glGetString( Gl.GL_VENDOR ); // TAO 2.0
ends up with null strings. Whereas it works properly under windows.
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Here's another one for
Here's another one for you:
This call works with the previous release of Tao:
_hWindow = Sdl.SDL_SetVideoMode(800, 600, 32, 536870914);
but doesn't with 2.0.
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Ok, let's try to debug
Ok, let's try to debug things one step at a time.
a) You must create an opengl context before calling any opengl functions. This is a very common programming error which is silently ignored on Windows. Unix is not so forgiving.
Tao.OpenGl up to version 2.1.12 doesn't throw an exception. 2.1.13 will detect this situation and warn in time.
b) GlExtensionLoader is deprecated. It does not work in Tao 2.0, so please don't use it. Use GL.ReloadFunctions() instead.
c) Under normal use, you will not need to call GL.ReloadFunctions() or Wgl.ReloadFunctions(). You will only need to, if you break rule (a) above - in this case, you will need to call it exactly once after you create the opengl context, in order to initialize the entry points for opengl/wgl.
It's simpler than it sounds. Just create the context first and everything will work.
Does someone care to explain why Wgl.BuildExtensionList() swallows up the Null Reference Exception? It sounds like the wrong thing to do, but I might be missing something.
------
OpenTK
Does someone care to explain
Does someone care to explain why Wgl.BuildExtensionList() swallows up the Null Reference Exception? It sounds like the wrong thing to do, but I might be missing something.
If I remember correctly it's because wglGetExtensionStringARB is an extension function itself, which might be not available. In that case, just checking if an extension is available would throw an exception, while I'd expect it to just return false, because it can't detect the extension (after all, without the extension string, it can't detect any extension).
Ah, makes sense. Why not do
Ah, makes sense. Why not do this, though?
if (Wgl.Delegates.wglGetExtensionsStringARB != null)
{
...
}
------
OpenTK
That's also a possibility...
That's also a possibility...
Haha Any ideas what's the
Haha
Any ideas what's the difference between the ARB and the EXT version of wglGetExtensionString? It looks like one doesn't need a DC to work, but do they return the same strings?
------
OpenTK
Well, ARB extension are ARB
Well, ARB extension are ARB approved, while EXT just means it's supported by more than one vendor. So in general the ARB version had more reviews and have the best support.
About the HDC: I found the ARB meeting notes, that say that the additional HDC parameter is to distinguish supported extensions in multi-monitor cases.
Borrillis - regarding SDL -
Borrillis - regarding SDL - Strange. It works fine for me. What error/problem do you get?
It SegFaults, I'll post the
It SegFaults, I'll post the fault trace here in a few.
Stacktrace:
at (wrapper managed-to-native) Tao.Sdl.Sdl.SDL_SetVideoMode (int,int,int,int) <0x00004>
at (wrapper managed-to-native) Tao.Sdl.Sdl.SDL_SetVideoMode (int,int,int,int) <0xffffffff>
at Axiom.RenderSystems.OpenGL.SdlWindow.Create (string,int,int,bool,Axiom.Collections.NamedParameterList) [0x001d4] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/RenderSystems/OpenGL/SDL/SdlWindow.cs:170
at Axiom.RenderSystems.OpenGL.GLSupport.NewWindow (string,int,int,bool,Axiom.Collections.NamedParameterList) [0x00006] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/RenderSystems/OpenGL/SDL/SdlGLSupport.cs:146
at Axiom.RenderSystems.OpenGL.GLRenderSystem.CreateRenderWindow (string,int,int,bool,Axiom.Collections.NamedParameterList) [0x000e1] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/RenderSystems/OpenGL/GLRenderSystem.cs:310
at Axiom.RenderSystems.OpenGL.GLSupport.CreateWindow (bool,Axiom.RenderSystems.OpenGL.GLRenderSystem,string) [0x00134] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/RenderSystems/OpenGL/SDL/SdlGLSupport.cs:197
at Axiom.RenderSystems.OpenGL.GLRenderSystem.Initialize (bool,string) [0x0000f] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/RenderSystems/OpenGL/GLRenderSystem.cs:1489
at Axiom.Core.Root.Initialize (bool,string) [0x00022] in /home/borrillis/Projects/Axiom/crickhollow/Projects/Axiom/Source/Engine/Core/Root.cs:477
at Axiom.Demos.TechDemo.Setup () [0x0003b] in /home/borrillis/Projects/Axiom/crickhollow/Projects/AxiomDemos/Source/Demos/TechDemo.cs:148
at Axiom.Demos.TechDemo.Start () [0x00000] in /home/borrillis/Projects/Axiom/crickhollow/Projects/AxiomDemos/Source/Demos/TechDemo.cs:211
at Axiom.Demos.Browser.WinForm.Program.Run () [0x00031] in /home/borrillis/Projects/Axiom/crickhollow/Projects/AxiomDemos/Source/Browser/WinForm/Main.cs:89
at Axiom.Demos.Browser.WinForm.Program.Main (string[]) [0x00006] in /home/borrillis/Projects/Axiom/crickhollow/Projects/AxiomDemos/Source/Browser/WinForm/Main.cs:110
at (wrapper runtime-invoke) Axiom.Demos.Browser.WinForm.Program.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/bin/mono [0x8171bce]
/usr/bin/mono [0x807e231]
[0xffffe440]
/usr/lib/libX11.so.6 [0xb5d485cf]
/usr/lib/libX11.so.6(XrmQGetResource+0x3e) [0xb5d604ee]
/usr/lib/libX11.so.6(XStringToKeysym+0x15a) [0xb5d562aa]
/usr/lib/libX11.so.6(_XimParseStringFile+0xb48) [0xb5d8b4b8]
/usr/lib/libX11.so.6(_XimLocalOpenIM+0x432) [0xb5d89272]
/usr/lib/libX11.so.6(_XimOpenIM+0x135) [0xb5d879f5]
/usr/lib/libX11.so.6(XOpenIM+0x4a) [0xb5d6cdda]
/usr/lib/libSDL-1.2.so.0 [0xb604cd23]
/usr/lib/libSDL-1.2.so.0 [0xb6056061]
/usr/lib/libSDL-1.2.so.0 [0xb605646f]
/usr/lib/libSDL-1.2.so.0(SDL_SetVideoMode+0x203) [0xb6042ab3]
[0xb4389034]
[0xb49aae6c]
[0xb49aa7c0]
[0xb49aa2e3]
[0xb49a99e4]
[0xb49a966c]
[0xb49a9411]
[0xb49a9155]
[0xb49a8fbe]
[0xb76ff415]
[0xb76ff275]
[0xb76ff1c3]
/usr/bin/mono(mono_runtime_exec_main+0xbb) [0x80bfa3b]
/usr/bin/mono(mono_runtime_run_main+0x1ba) [0x80c0e4a]
/usr/bin/mono(mono_main+0xfd2) [0x805b812]
/usr/bin/mono [0x805a332]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7d46050]
/usr/bin/mono [0x805a2a1]
Debug info from gdb:
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1210915120 (LWP 6935)]
[New Thread -1222968432 (LWP 6958)]
[New Thread -1222820976 (LWP 6946)]
0xffffe410 in __kernel_vsyscall ()
3 Thread -1222820976 (LWP 6946) 0xffffe410 in __kernel_vsyscall ()
2 Thread -1222968432 (LWP 6958) 0xffffe410 in __kernel_vsyscall ()
1 Thread -1210915120 (LWP 6935) 0xffffe410 in __kernel_vsyscall ()
Thread 3 (Thread -1222820976 (LWP 6946)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7eab9f6 in ?? () from /lib/tls/i686/cmov/libpthread.so.0
#2 0x0811c601 in collection_thread (unused=0x0) at collection.c:34
#3 0xb7ea446b in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb7e036de in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 2 (Thread -1222968432 (LWP 6958)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7ea8676 in pthread_cond_wait@@GLIBC_2.3.2 ()
from /lib/tls/i686/cmov/libpthread.so.0
#2 0x0810cb0f in timedwait_signal_poll_cond (cond=0xb76ad1dc,
mutex=0xb76ad1c4, timeout=0x0, alertable=0) at handles.c:1443
#3 0x0810f5af in _wapi_handle_timedwait_signal_handle (handle=0x404,
timeout=0x0, alertable=0) at handles.c:1523
#4 0x0810f62c in _wapi_handle_wait_signal_handle (handle=0x404, alertable=0)
at handles.c:1483
#5 0x0811034f in WaitForSingleObjectEx (handle=0x404, timeout=4294967295,
alertable=0) at wait.c:200
#6 0x080f99ba in finalizer_thread (unused=0x0) at gc.c:894
#7 0x080e9a9f in start_wrapper (data=0x827e9d0) at threads.c:589
#8 0x08117222 in thread_start_routine (args=0xb755bac0) at threads.c:282
#9 0x08131c65 in GC_start_routine (arg=0x26f40) at pthread_support.c:1369
#10 0xb7ea446b in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#11 0xb7e036de in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 1 (Thread -1210915120 (LWP 6935)):
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7dfc2a1 in select () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7f1b780 in g_spawn_sync () from /usr/lib/libglib-2.0.so.0
#3 0xb7f1bb4c in g_spawn_command_line_sync () from /usr/lib/libglib-2.0.so.0
#4 0x08171c69 in mono_handle_native_sigsegv (signal=11, ctx=0xb7bf9d0c)
at mini-exceptions.c:1046
#5 0x0807e231 in mono_arch_handle_altstack_exception (sigctx=0xb7bf9d0c,
fault_addr=0x1d, stack_ovf=0) at exceptions-x86.c:855
#6
#7 0xb7ea6550 in pthread_mutex_lock ()
from /lib/tls/i686/cmov/libpthread.so.0
#8 0xb5d485cf in ?? () from /usr/lib/libX11.so.6
#9 0x00000011 in ?? ()
#10 0xb5e0bb2c in ?? () from /usr/lib/libX11.so.6
#11 0xbfb3b95c in ?? ()
#12 0xb5d604ee in XrmQGetResource () from /usr/lib/libX11.so.6
Backtrace stopped: frame did not save the PC
#0 0xffffe410 in __kernel_vsyscall ()
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Now this may be operator error, so what packages must I have installed for SDL and OpenGL to work properly. I tried using the examples to test but so far only the SDLExamples have worked. NeHe requires windows.
Borrillis
The Steward of Axiom
http://axiomengine.sf.net
Hey everyone, I have fixed
Hey everyone, I have fixed up the Windows installer script and made some changes to the nant build. We should be able to plan a release at this point. I may look into some ways of making the OSX build better, but that should not hold up a general release.