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 using OpenTK.Graphics;
00032 using OpenTK.Platform.X11;
00033
00034 namespace OpenTK.Platform.Egl
00035 {
00036 class EglX11PlatformFactory : X11Factory
00037 {
00038 public override IGraphicsContext CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
00039 {
00040 X11WindowInfo x11_win = (X11WindowInfo)window;
00041 EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(x11_win.Display));
00042 return new EglContext(mode, egl_win, shareContext, major, minor, flags);
00043 }
00044
00045 public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags)
00046 {
00047 X11WindowInfo x11_win = (X11WindowInfo)window;
00048 EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(x11_win.Display));
00049 return new EglContext(handle, egl_win, shareContext, major, minor, flags);
00050 }
00051
00052 public override GraphicsContext.GetCurrentContextDelegate CreateGetCurrentGraphicsContext()
00053 {
00054 return (GraphicsContext.GetCurrentContextDelegate)delegate
00055 {
00056 return new ContextHandle(Egl.GetCurrentContext());
00057 };
00058 }
00059 }
00060 }