00001 #region License
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #endregion
00027
00028 using System;
00029 using System.Collections.Generic;
00030 using System.Text;
00031
00032 namespace OpenTK.Platform.MacOS
00033 {
00034 using Graphics;
00035
00036 class MacOSFactory : IPlatformFactory
00037 {
00038 #region IPlatformFactory Members
00039
00040 public virtual INativeWindow CreateNativeWindow(int x, int y, int width, int height, string title, GraphicsMode mode, GameWindowFlags options, DisplayDevice device)
00041 {
00042 return new CarbonGLNative(x, y, width, height, title, mode, options, device);
00043 }
00044
00045 public virtual IDisplayDeviceDriver CreateDisplayDeviceDriver()
00046 {
00047 return new QuartzDisplayDeviceDriver();
00048 }
00049
00050 public virtual IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
00051 {
00052 return new AglContext(mode, window, shareContext);
00053 }
00054
00055 public virtual IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
00056 {
00057 return new AglContext(handle, window, shareContext);
00058 }
00059
00060 public virtual GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext()
00061 {
00062 return (GraphicsContext.GetCurrentContextDelegate)delegate
00063 {
00064 return new ContextHandle(Agl.aglGetCurrentContext());
00065 };
00066 }
00067
00068 public virtual IGraphicsMode CreateGraphicsMode()
00069 {
00070 return new MacOSGraphicsMode();
00071 }
00072
00073 public virtual OpenTK.Input.IKeyboardDriver CreateKeyboardDriver()
00074 {
00075 throw new NotImplementedException();
00076 }
00077
00078 #endregion
00079 }
00080 }