Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 protected Window(WindowAttributes windowAttributes)
 {
     _windowAttributes = windowAttributes;
     KeyboardStatus = new KeyboardStatus();
     DebugKeyHandler = new DebugKeyHandler();
 }
Ejemplo n.º 3
0
 public GraphicsContext Create(WindowAttributes windowAttributes)
 {
     return new OpenGLGraphicsContext(windowAttributes);
 }
Ejemplo n.º 4
0
 public GraphicsContext Create(WindowAttributes windowAttributes)
 {
     return new DirectXGraphicsContext(windowAttributes);
 }