public override void BindWindowControl(Control windowControl) { _windowControl = (UISurfaceViewportControl)windowControl; SetBaseCanvasViewport(_openGLViewport = new OpenGLCanvasViewport( this.RootGfx, new Size(windowControl.Width, windowControl.Height))); RootGfx.SetPaintDelegates( (r) => { }, //still do nothing this.PaintToOutputWindow); ////-------------------- ////--------------------------------------- //myGLControl.SetGLPaintHandler(HandleGLPaint); //hh1 = miniGLControl.Handle; //miniGLControl.MakeCurrent(); //int max = Math.Max(this.Width, this.Height); //canvas2d = PixelFarm.Drawing.GLES2.GLES2Platform.CreateCanvasGL2d(max, max); //canvasPainter = new GLCanvasPainter(canvas2d, max, max); ////create text printer for opengl ////---------------------- ////1. win gdi based ////var printer = new WinGdiFontPrinter(canvas2d, w, h); ////canvasPainter.TextPrinter = printer; ////---------------------- ////2. raw vxs ////var printer = new PixelFarm.Drawing.Fonts.VxsTextPrinter(canvasPainter); ////canvasPainter.TextPrinter = printer; ////---------------------- ////3. agg texture based font texture ////var printer = new AggFontPrinter(canvasPainter, w, h); ////canvasPainter.TextPrinter = printer; ////---------------------- ////4. texture atlas based font texture ////------------ ////resolve request font //var printer = new GLBmpGlyphTextPrinter(canvasPainter, YourImplementation.BootStrapWinGdi.myFontLoader); //canvasPainter.TextPrinter = printer; ////-------------------- //openGLViewport.NotifyWindowControlBinding(); #if DEBUG _openGLViewport.dbugOutputWindow = this; #endif this.EvaluateScrollbar(); }
/// <summary> /// bind to gl control /// </summary> /// <param name="myGLControl"></param> void BindGLControl(IGpuOpenGLSurfaceView myGLControl) { _windowControl = myGLControl; SetBaseCanvasViewport(_openGLViewport = new OpenGLCanvasViewport(this.RootGfx, _windowControl.GetSize())); RootGfx.SetPaintDelegates( null, //still do nothing this.PaintToOutputWindow); _openGLViewport.NotifyWindowControlBinding(); #if DEBUG _openGLViewport.dbugOutputWindow = this; #endif this.EvaluateScrollbar(); }
/// <summary> /// bind to gl control /// </summary> /// <param name="myGLControl"></param> void BindGLControl(GpuOpenGLSurfaceView myGLControl) { this.windowControl = myGLControl; SetBaseCanvasViewport(this.openGLViewport = new OpenGLCanvasViewport(this.RootGfx, this.windowControl.Size.ToSize(), 4)); RootGfx.SetPaintDelegates( (r) => { }, //still do nothing this.PaintToOutputWindow); openGLViewport.NotifyWindowControlBinding(); #if DEBUG this.openGLViewport.dbugOutputWindow = this; #endif this.EvaluateScrollbar(); }