public static void Start() { PixelFarm.Platforms.StorageService.RegisterProvider(s_LocalStorageProvider); //--------------------------------------------------- PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new YourImplementation.ImgCodecMemBitmapIO(); //PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); if (!GLFWPlatforms.Init()) { System.Diagnostics.Debug.WriteLine("can't init glfw"); return; } bool useMyGLFWForm = true; if (!useMyGLFWForm) { GlFwForm form1 = new GlFwForm(800, 600, "PixelFarm on GLfw and GLES2"); MyApp glfwApp = new MyApp(); form1.SetDrawFrameDelegate(e => glfwApp.UpdateViewContent(e)); } else { MyGLFWForm form1 = new MyGLFWForm(800, 600, "PixelFarm on GLfw and GLES2"); MyApp glfwApp = new MyApp(); form1.SetDrawFrameDelegate(e => glfwApp.UpdateViewContent(e)); } GlfwApp.RunMainLoop(); }
public static void Start() { if (!GLFWPlatforms.Init()) { Console.WriteLine("can't init"); return; } GlFwForm form1 = new GlFwForm( 800, 600, "PixelFarm on GLfw and OpenGLES2"); //---------------- //this not need if we use glfwcontext for opentk // new OpenTK.Graphics.ES20.GL().LoadEntryPoints(); //---------------- //var demo = new OpenTkEssTest.T52_HelloTriangle2(); //var demo = new OpenTkEssTest.T107_SampleDrawImage(); //var demo = new OpenTkEssTest.T107_SampleDrawImage(); var demoContext = new Mini.GLDemoContext(800, 600); demoContext.LoadDemo(new OpenTkEssTest.T108_LionFill()); ////var demo = new OpenTkEssTest.T107_SampleDrawImage(); form1.SetDrawFrameDelegate(e => { demoContext.Render(); //demo.Render(); }); //--------------------------------- GlFwForm f2 = new GlFwForm(800, 600, "Form2"); f2.SetDrawFrameDelegate(e => { //simple draw GL.ClearColor(0, 1, 1, 1); }); GlfwApp.RunMainLoop(); demoContext.Close(); }
static void Main() { YourImplementation.LocalFileStorageProvider file_storageProvider = new YourImplementation.LocalFileStorageProvider(""); PixelFarm.Platforms.StorageService.RegisterProvider(file_storageProvider); YourImplementation.FrameworkInitGLES.SetupDefaultValues(); //2.2 Icu Text Break info //test Typography's custom text break, //check if we have that data? //------------------------------------------- string icu_datadir = YourImplementation.RelativePathBuilder.SearchBackAndBuildFolderPath(System.IO.Directory.GetCurrentDirectory(), "HtmlRenderer", @"..\Typography\Typography.TextBreak\icu62\brkitr"); if (!System.IO.Directory.Exists(icu_datadir)) { throw new System.NotSupportedException("dic"); } var dicProvider = new Typography.TextBreak.IcuSimpleTextFileDictionaryProvider() { DataDir = icu_datadir }; Typography.TextBreak.CustomBreakerBuilder.Setup(dicProvider); PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new ImgCodecMemBitmapIO(); //PixelFarm.CpuBlit.MemBitmapExtensions.DefaultMemBitmapIO = new PixelFarm.Drawing.WinGdi.GdiBitmapIO(); if (!PixelFarm.GLFWPlatforms.Init()) { System.Diagnostics.Debug.WriteLine("can't init glfw"); return; } LayoutFarm.Demo_MixHtml mix1 = new LayoutFarm.Demo_MixHtml(); var myApp = new MyApp(mix1); myApp.CreateMainForm(800, 600); GlfwApp.RunMainLoop(); }