The OpenTK solution provides the following public namespaces:
The public API of OpenTK is completely cross-platform. All platform-specific code is contained in internal interfaces under the OpenTK.Platform namespace. In that sense, most public classes act as façades that forward method calls to the correct platform-specific implementation.
public class Foo : IFoo { IFoo implementation; public Foo() { implementation = OpenTK.Platform.Factory.Default.CreateFoo(); } #region IFoo Members public void Bar() { implementation.Bar(); } #endregion }
This pattern is used in all public OpenTK classes that need platform-specific code to operate: DisplayDevice, DisplayResolution, GraphicsContext, GraphicsMode, NativeWindow and the various input classes.
Classes that do not rely on platform-specific code and classes that contain performance-sensitive code do not use this pattern: the various math classes, the OpenGL, OpenCL and OpenAL bindings, the AudioContext and AudioCapture classes all fall into these categories.