예제 #1
0
        public static GraphicsContext Create(Renderer renderer, WindowAttributes windowAttributes)
        {
            var path = string.Format("Psy.Graphics.{0}.dll", renderer);

            var assembly = Assembly.LoadFrom(path);

            var type = assembly.GetTypes().Single(x => typeof (IGraphicsContextFactory).IsAssignableFrom(x));
            var constructorInfo = type.GetConstructor(Type.EmptyTypes);
            if (constructorInfo == null)
            {
                throw new Exception("Implementation of IGraphicsContextFactory must have parameterless constructor");
            }

            var impl = constructorInfo.Invoke(null);

            var method = type.GetMethod("Create");
            var result = (GraphicsContext)method.Invoke(impl, new object[] {windowAttributes});

            return result;
        }
예제 #2
0
파일: Window.cs 프로젝트: HaKDMoDz/Psy
 protected Window(WindowAttributes windowAttributes)
 {
     _windowAttributes = windowAttributes;
     KeyboardStatus = new KeyboardStatus();
     DebugKeyHandler = new DebugKeyHandler();
 }
예제 #3
0
 public GraphicsContext Create(WindowAttributes windowAttributes)
 {
     return new OpenGLGraphicsContext(windowAttributes);
 }
예제 #4
0
 public GraphicsContext Create(WindowAttributes windowAttributes)
 {
     return new DirectXGraphicsContext(windowAttributes);
 }