public bool InitGameWindow(RDisplayMode displayMode, RWindowStyle windowStyle, string title = "Reactor") { try { RGame.GameWindow.Title = title; GameWindowRenderControl control = new GameWindowRenderControl(); control.GameWindow = RGame.GameWindow; control.GameWindow.ClientSize = new System.Drawing.Size(displayMode.Width, displayMode.Height); if (windowStyle == RWindowStyle.Borderless) { control.GameWindow.WindowBorder = WindowBorder.Hidden; } control.GameWindow.X = 0; control.GameWindow.Y = 0; control.Context = (GraphicsContext)control.GameWindow.Context; _renderControl = control; RLog.Info(GetGLInfo()); REngine.CheckGLError(); RLog.Info("Game Window Renderer Initialized."); //PrintExtensions(); REngine.CheckGLError(); RShader.InitShaders(); REngine.CheckGLError(); Screen.Init(); REngine.CheckGLError(); return(true); } catch (Exception e) { RLog.Error(e); return(false); } }
public bool InitPictureBox(IntPtr handle) { try { PictureBoxRenderControl control = new PictureBoxRenderControl(); control.PictureBox = (PictureBox)PictureBox.FromHandle(handle); control.Init(); _renderControl = control; RShader.InitShaders(); Screen.Init(); RLog.Info(GetGLInfo()); RLog.Info("Picture Box Renderer Initialized."); return(true); } catch (Exception e) { RLog.Error(e); return(false); } }
public bool InitForm(IntPtr handle) { try { FormRenderControl control = new FormRenderControl(); control.Form = (Form)Form.FromHandle(handle); control.Init(); _renderControl = control; RShader.InitShaders(); Screen.Init(); RLog.Info(GetGLInfo()); RLog.Info("Form Renderer Initialized."); PrintExtensions(); return(true); } catch (Exception e) { RLog.Error(e); return(false); } }