kanato's picture

Replacement for OpenTK.Platform.Utilities.CreateWindowInfo ?

I'm trying to upgrade AgateLib from OpenTK 0.9.8 to 0.9.9 but I can't find a replacement for OpenTK.Platform.Utilities.CreateWindowInfo? Is there a replacement available?


Comment viewing options

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

Yes, this has been split into three distinct methods in OpenTK.Platform.Utilities:

  • CreateX11WindowInfo
  • CreateWindowsWindowInfo
  • CreateMacOSCarbonWindowInfo

This removes the guesswork from the CreateWindowInfo method, which caused problems when trying to use it for something other than GameWindow or WinForms (e.g. GTK#).

kanato's picture

Ok.. are there any facilities to ease the creation of a context in X11, or do I have to import the functions like XGetVisualInfo into my own project?

the Fiddler's picture

If I remember correctly, you are instantiating a GraphicsContext directly on a WinForms Form? If so, I'd strongly advise you to use GLControl instead.

The reason is that instatiating a context on a top-level window will cause several strange issues on Windows, when Aero is enabled. The most common is the "black border" issue, which occurs when you modify the window border (e.g. change it from resizable to fixed or hidden). My guess is that this is an airspace conflict between the DWM and the OpenGL ICD, but there is precious little information on the topic - the only solution I've been able to find is to instantiate the context on a docked child window. GLControl avoids the issue (GLControl is such a child window), as does NativeWindow starting with 0.9.9-2 (it creates a child window internally).

Back on topic, yes you have to import XGetVisualInfo et al manually. OpenTK.GLControl and GLWidget both do this.