public void Start() { RuntimeConfiguration rtc = Program.GetRuntime(); Runtime.RGSSVersion = rtc.GetRGSSVersion(); Runtime.ResourcePaths = rtc.GetResourcePaths(); Runtime.DefaultResolutionWidth = rtc.GetDefaultResolutionWidth(); Runtime.DefaultResolutionHeight = rtc.GetDefaultResolutionHeight(); Graphics.initialize(Program.Window); engine.Execute(Window.ruby_helper(), scope); engine.Execute(CTilemap.ruby_helper(), scope); engine.Execute(Viewport.ruby_helper(), scope); engine.Execute(Rect.ruby_helper(), scope); engine.Execute(Sprite.ruby_helper(), scope); engine.Execute(Color.ruby_helper(), scope); engine.Execute(Tone.ruby_helper(), scope); engine.Execute(Bitmap.ruby_helper(), scope); Font.load_fonts(); engine.Execute(Font.ruby_helper(), scope); try { engine.Execute(@"rgss_start", scope); } catch (Exception e) { Program.Error(e.Message); } }
public static void OnLoad() { Window.VSync = VSyncMode.On; Window.Title = Runtime.GetGameTitle(); //setup opengl GL.MatrixMode(MatrixMode.Projection); GL.LoadIdentity(); GL.Ortho(0, Runtime.GetDefaultResolutionWidth(), Runtime.GetDefaultResolutionHeight(), 0, -1, 1); GL.Enable(EnableCap.Texture2D); //TODO: Only enable textures where they are needed (fixed function performance hit) GL.Enable(EnableCap.Blend); //TODO: blend should only be enabled where it is needed! Needless performance hit here GL.Disable(EnableCap.DepthTest); //TODO: Remove depth buffer from context if depth test is not used GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha); //TODO: move this to only where it is needed to be used GL.ClearColor(0f, 0f, 0f, 1.0f); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); Window.SwapBuffers(); }
public void Start() { RuntimeConfiguration rtc = Program.GetRuntime(); OpenGame.Runtime.Runtime.RGSSVersion = rtc.GetRGSSVersion(); OpenGame.Runtime.Runtime.ResourcePaths = rtc.GetResourcePaths(); OpenGame.Runtime.Runtime.DefaultResolutionWidth = rtc.GetDefaultResolutionWidth(); OpenGame.Runtime.Runtime.DefaultResolutionHeight = rtc.GetDefaultResolutionHeight(); OG_Graphics.initialize(Program.Window); if (rtc.IsDebug() && rtc.IsPlayTest()) { engine.Execute("$DEBUG = $TEST = true", scope); } engine.Execute(OG_Graphics.ruby_helper(), scope); engine.Execute(OG_Input.ruby_helper(), scope); engine.Execute(Plane.ruby_helper(), scope); engine.Execute(Table.ruby_helper(), scope); engine.Execute(Window.ruby_helper(), scope); engine.Execute(CTilemap.ruby_helper(), scope); engine.Execute(Viewport.ruby_helper(), scope); engine.Execute(Rect.ruby_helper(), scope); engine.Execute(Sprite.ruby_helper(), scope); engine.Execute(Color.ruby_helper(), scope); engine.Execute(Tone.ruby_helper(), scope); engine.Execute(Bitmap.ruby_helper(), scope); Font.load_fonts(); engine.Execute(Font.ruby_helper(), scope); try { engine.Execute(@"$OPENGAME_EXE = true"); engine.Execute("$RGSS_SCRIPTS_PATH = '" + rtc.GetScriptsPath() + "'"); engine.Execute(@"rgss_start", scope); } catch (Exception e) { Program.Error(e.Message); } }
// The program's start point, entered from the Launcher // RuntimeConfiguration is provided public static void Start(RuntimeConfiguration rtc) { Runtime = rtc; //Create the Ruby instance Ruby = new Ruby(); //compensate for border and caption thickness int width = Runtime.GetDefaultResolutionWidth(); // + (GetSystemMetrics(SystemMetric.SM_CXFIXEDFRAME) << 1); int height = Runtime.GetDefaultResolutionHeight(); // + (GetSystemMetrics(SystemMetric.SM_CYFIXEDFRAME) << 1) + GetSystemMetrics(SystemMetric.SM_CYCAPTION); Window = new GameWindow(width, height); OG_Graphics.dpi_scale = Window.Width / (float)width; Window.Width = width; Window.Height = height; System.Drawing.Size client_size = Window.ClientSize; client_size.Width = width; client_size.Height = height; Window.ClientSize = client_size; Window.Icon = Properties.Resources.OpenGame; Window.Resize += (sender, e) => { OnResize(sender, e); }; Window.Closed += (sender, e) => { OnClose(sender, e); }; Window.Visible = true; OnLoad(); //Start the game Ruby.Start(); //Clean up the Ruby instance Ruby.Dispose(); }
// The program's start point, entered from the Launcher // RuntimeConfiguration is provided public static void Start(RuntimeConfiguration rtc) { Runtime = rtc; //Create the Ruby instance Ruby = new Ruby(); Window = new GameWindow(Runtime.GetDefaultResolutionWidth(), Runtime.GetDefaultResolutionHeight()); Window.Icon = Properties.Resources.OpenGame; Window.Resize += (sender, e) => { OnResize(sender, e); }; Window.Closed += (sender, e) => { OnClose(sender, e); }; Window.Visible = true; OnLoad(); //Start the game Ruby.Start(); //Clean up the Ruby instance Ruby.Dispose(); }
// The program's start point, entered from the Launcher // RuntimeConfiguration is provided public static void Start(RuntimeConfiguration rtc) { Runtime = rtc; //Create the Ruby instance Ruby = new Ruby(); Window = new GameWindow(Runtime.GetDefaultResolutionWidth(), Runtime.GetDefaultResolutionHeight()); Window.Icon = Properties.Resources.OpenGame; Window.Resize += (sender, e) => { OnResize(sender, e); }; Window.Closed += (sender, e) => { OnClose(sender, e); }; Window.Visible = true; OnLoad(); //Start the game Ruby.Start(); //Clean up the Ruby instance Ruby.Dispose(); }