JBeighel's picture

GraphicsModeException when creating GLControl

When I attempt to create the GLControl I get the following exception:

OpenTK.Graphics.GraphicsModeException: Invalid or unsupported GraphicsMode.
  at OpenTK.X11GLControl..ctor (OpenTK.Graphics.GraphicsMode mode, System.Windows.Forms.Control control) [0x00000] in <filename unknown>:0 
  at OpenTK.GLControlFactory.CreateGLControl (OpenTK.Graphics.GraphicsMode mode, System.Windows.Forms.Control control) [0x00000] in <filename unknown>:0 
  at OpenTK.GLControl.OnHandleCreated (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WmCreate (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.UserControl.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in <filename unknown>:0

The line causing it is "cglGLView = new GLControl();" in the constructor for my windows forms class.

public GLForm() {
			//Initialize Log label
			clblLog = new Label();
 
			clblLog.Top = 485;
			clblLog.Left = 0;
			clblLog.Width = 800;
			clblLog.Height = 125;
			clblLog.Text = "";
 
			Controls.Add(clblLog);
 
			cbGLReady = false;
 
			cglGLView = new GLControl();
 
			//Position and configure the controls
			cglGLView.Top = 0;
			cglGLView.Left = 0;
			cglGLView.Width = 640;
			cglGLView.Height = 480;
 
			//Define callbacks for the controls
			cglGLView.Load += new EventHandler(GLViewLoading);  
			cglGLView.Paint += new PaintEventHandler(GLViewPainting); 
			Controls.Add(cglGLView);
 
			//Position and configure the form
			this.Width = 775;
			this.Height = 670;
			this.FormBorderStyle = FormBorderStyle.FixedSingle;
 
			return;
		}

I'm running Ubuntu 13.10, with Mono 2.10. The graphics card is a NVidia Quadro FX 370M, however I'm using the Nouveau driver. I do have Mesa 9 installed which I thought would be enough to let this run.

Is there some other package I'm missing to get this running, or will I need to switch to the NVidia drivers for my card to get any sort of OpenGL to work?

Thanks for any help.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This is fixed by https://github.com/opentk/opentk/commit/61f334f3f531db79bf85f1f5843f45d5...

The fix will be included in the next release (tomorrow or on Monday), thanks for reporting the issue!

JBeighel's picture

Glad it helped. I honestly expected to hear I was missing some dependency somewhere that was causing it. Thank you very much for looking into and fixing this!

I don't typically use monodevelop, but if it's got a solid debugger I'll have to get it installed and take another look at it.