Remove System.Windows.Forms.Control dependency in favor of OpenTK.NativeWindow.

This commit is contained in:
the_fiddler 2009-09-08 13:09:50 +00:00
parent 542144ac7c
commit 4e86dd1381

View file

@ -154,10 +154,11 @@ namespace OpenTK.Platform.Windows
GraphicsMode SelectGraphicsModeARB(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, GraphicsMode SelectGraphicsModeARB(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum,
int buffers, bool stereo) int buffers, bool stereo)
{ {
using (Control native_window = new Control()) using (INativeWindow native_window = new NativeWindow())
using (WinWindowInfo window = new WinWindowInfo(native_window.Handle, null)) using (IGraphicsContext context = new GraphicsContext(new GraphicsMode(new ColorFormat(), 0, 0, 0, new ColorFormat(), 2, false), native_window.WindowInfo, 1, 0, GraphicsContextFlags.Default))
using (WinGLContext context = new WinGLContext(new GraphicsMode(new ColorFormat(), 0, 0, 0, new ColorFormat(), 2, false), window, null, 1, 0, GraphicsContextFlags.Default))
{ {
WinWindowInfo window = (WinWindowInfo)native_window.WindowInfo;
Debug.Write("Selecting pixel format (ARB)... "); Debug.Write("Selecting pixel format (ARB)... ");
if (Wgl.Delegates.wglChoosePixelFormatARB == null || Wgl.Delegates.wglGetPixelFormatAttribivARB == null) if (Wgl.Delegates.wglChoosePixelFormatARB == null || Wgl.Delegates.wglGetPixelFormatAttribivARB == null)
{ {