Пример #1
0
 static void Init()
 {
     var common = new Common();
     form = new GraphicsEngineForm();
     form.Text = "Pong";
     form.Show();
     graphics = (Graphics)new OpenGLGraphics(form, common);
 }
Пример #2
0
 protected virtual void Init()
 {
     var common = new Common();
     form = new GraphicsEngineForm { Text = name };
     form.Show();
     graphics = new OpenGLGraphics(form, common);
     timer = new Stopwatch();
     timer.Start();
 }
 public OpenGLGraphics(Form form, Common common)
 {
     this.form = form;
     this.common = common;
     var windowInfo = Utilities.CreateWindowsWindowInfo(form.Handle);
     context = new GraphicsContext(GraphicsMode.Default, windowInfo);
     context.MakeCurrent(windowInfo);
     context.LoadAll();
 }
 public OpenGL4Graphics(Form form, Common common)
 {
     this.form = form;
     this.common = common;
     CreateContext(form);
     CreateVertexBuffer();
     CreateShader();
     CreateIndexBuffer();
 }
Пример #5
0
 static void Init()
 {
     common = new Common();
     form = new GraphicsEngineForm();
     form.Text += " - " + GraphicsAPI;
     form.Show();
     graphics = GraphicsAPI == API.OpenGL
         ? (Graphics)new OpenGLGraphics(form)
         : GraphicsAPI == API.OpenGL4
             ? (Graphics)new OpenGL4Graphics(form)
             : (Graphics)new DirectXGraphics(form);
 }