public void LoadGLControl(OpenTK.MyGLControl glControl) { //---------------------- this.glControl = glControl; glControl.SetGLPaintHandler(HandleGLPaint); hh1 = glControl.Handle; //ensure that contrl handler is created glControl.MakeCurrent(); }
void SetUpGLSurface(OpenTK.MyGLControl glControl) { if (glControl == null) { return; } //TODO: review here //Temp: _glControl = glControl; _glControl.SetGLPaintHandler(null); // IntPtr hh1 = _glControl.Handle; //ensure that contrl handler is created _glControl.MakeCurrent(); if (_vw.InnerViewportKind == InnerViewportKind.GdiPlusOnGLES) { _bridgeUI = new GdiOnGLESUIElement(glControl.Width, glControl.Height); } else { //pure agg's cpu blit _bridgeUI = new CpuBlitGLESUIElement(glControl.Width, glControl.Height); } //optional*** //_bridgeUI.SetUpdateCpuBlitSurfaceDelegate((p, area) => //{ // _client.DrawToThisCanvas(_bridgeUI.GetDrawBoard(), area); //}); GLPainterContext pcx = _vw.GetGLRenderSurface(); GLPainter glPainter = _vw.GetGLPainter(); RootGraphic rootGfx = _vw.RootGfx; _bridgeUI.CreatePrimaryRenderElement(pcx, glPainter, rootGfx); //***** RenderBoxBase renderE = (RenderBoxBase)_bridgeUI.GetPrimaryRenderElement(rootGfx); rootGfx.AddChild(renderE); rootGfx.SetPrimaryContainerElement(renderE); //*** }
public void BindSurface(LayoutFarm.UI.UISurfaceViewportControl surfaceViewport) { _myWidth = 800; _myHeight = 600; _surfaceViewport = surfaceViewport; _rootGfx = surfaceViewport.RootGfx; //---------------------- _glControl = surfaceViewport.GetOpenTKControl(); _glControl.SetGLPaintHandler(null); IntPtr hh1 = _glControl.Handle; //ensure that contrl handler is created _glControl.MakeCurrent(); }