
GLWidget fails creating context
Posted Thursday, 2 September, 2010 - 12:19 by yiannis inHi,
I hope this is the place to post for help regarding GLWidget.
When running the GLWidget test project, the application terminates with this error:
The program 'GLWidgetTest' received an X Window System error. This probably reflects a bug in the program. The error was 'BadMatch (invalid parameter attributes)'. (Details: serial 213 error_code 8 request_code 128 minor_code 5) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.)
This error occurs in GLWidget.cs line 212 (graphicsContext.MakeCurrent(windowInfo)).
Any ideas or pointers on what to look for?
Thanks in advance for all the help.
PS: My environment is:
Ubuntu 10.04 32 bit
Mono 2.6.7
GTK# 2.12.9
MonoDevelop 2.4
OpenTK svn trunk (have also tried with 1.0.0-rc1)


Comments
Re: GLWidget fails creating context
I just tested on a virtual machine. I am not getting a crash when running, but I do get this error when calling new GraphicsMode:
OpenGL Warning: XGetVisualInfo returned 0 visuals for....
What video card are you running? Is hardware acceleration enabled?
You may want to try explicitly setting a ColorBPP on the GLWidget to maybe 24 or 16 and see if that works....
For Reference:
Re: GLWidget fails creating context
Thanks for the reply JTalton.
My GPU is GeForce 9600M GS and, yes, hardware acceleration is enabled (i.e. the card works just fine with other programs I 've written (in C++)).
Anyway, I have enabled tracing and here's a more detailed log of what happens:
Re: GLWidget fails creating context
At one point this was working, so something changed, either in Ubuntu, GTK , or OpenTK. If I can find some time, I'll try to figure out what is going on.
Re: GLWidget fails creating context
At one point this was working, so something changed, either in Ubuntu, GTK , or OpenTK. If I can find some time, I'll try to figure out what is going on.
Thanks a lot for the help.
After looking at the code in OpenTK (X11GLContext.cs), I tried requesting a GL context version 3.0 and it worked. This means that the context was successfully created only when the code called GLX_ARB_create_context.
Looks like Glx.CreateContext() (the call made for contexts <3.0) was the culprit in my case, if anyone wants to investigate more...