Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1452 | chris | 1 | #region License |
| 2 | // |
||
| 3 | // The Open Toolkit Library License |
||
| 4 | // |
||
| 5 | // Copyright (c) 2006 - 2009 the Open Toolkit library. |
||
| 6 | // |
||
| 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
||
| 8 | // of this software and associated documentation files (the "Software"), to deal |
||
| 9 | // in the Software without restriction, including without limitation the rights to |
||
| 10 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||
| 11 | // the Software, and to permit persons to whom the Software is furnished to do |
||
| 12 | // so, subject to the following conditions: |
||
| 13 | // |
||
| 14 | // The above copyright notice and this permission notice shall be included in all |
||
| 15 | // copies or substantial portions of the Software. |
||
| 16 | // |
||
| 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||
| 18 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
||
| 19 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||
| 20 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
||
| 21 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
||
| 22 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||
| 23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
||
| 24 | // OTHER DEALINGS IN THE SOFTWARE. |
||
| 25 | // |
||
| 26 | #endregion |
||
| 27 | |||
| 28 | using System; |
||
| 29 | using System.Collections.Generic; |
||
| 30 | using System.Text; |
||
| 31 | |||
| 32 | namespace OpenTK.Platform.MacOS |
||
| 33 | { |
||
| 34 | using Graphics; |
||
| 35 | |||
| 36 | class MacOSFactory : IPlatformFactory |
||
| 37 | { |
||
| 38 | #region IPlatformFactory Members |
||
| 39 | |||
| 40 | public virtual INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device) |
||
| 41 | { |
||
| 42 | return new CarbonGLNative(x, y, width, height, title, mode, options, device); |
||
| 43 | } |
||
| 44 | |||
| 45 | public virtual IDisplayDeviceDriver CreateDisplayDeviceDriver() |
||
| 46 | { |
||
| 47 | return new QuartzDisplayDeviceDriver(); |
||
| 48 | } |
||
| 49 | |||
| 50 | public virtual IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) |
||
| 51 | { |
||
| 52 | return new AglContext(mode, window, shareContext); |
||
| 53 | } |
||
| 54 | |||
| 55 | public virtual IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) |
||
| 56 | { |
||
| 57 | return new AglContext(handle, window, shareContext); |
||
| 58 | } |
||
| 59 | |||
| 60 | public virtual GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext() |
||
| 61 | { |
||
| 62 | return (GraphicsContext.GetCurrentContextDelegate)delegate |
||
| 63 | { |
||
| 64 | return new ContextHandle(Agl.aglGetCurrentContext()); |
||
| 65 | }; |
||
| 66 | } |
||
| 67 | |||
| 68 | public virtual IGraphicsMode CreateGraphicsMode() |
||
| 69 | { |
||
| 70 | return new MacOSGraphicsMode(); |
||
| 71 | } |
||
| 72 | |||
| 73 | public virtual OpenTK.Input.IKeyboardDriver CreateKeyboardDriver() |
||
| 74 | { |
||
| 75 | throw new NotImplementedException(); |
||
| 76 | } |
||
| 77 | |||
| 78 | #endregion |
||
| 79 | } |
||
| 80 | } |