public GLDepthBuffer( PoolId poolId, GLRenderSystem renderSystem, GLContext creatorContext, GLRenderBuffer depth, GLRenderBuffer stencil, int width, int height, int fsaa, int multiSampleQuality, bool manual) : base( poolId, 0, width, height, fsaa, "", manual ) { }
public override Axiom.Graphics.RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if(autoCreateWindow) { EngineConfig.DisplayModeRow[] modes = (EngineConfig.DisplayModeRow[])engineConfig.DisplayMode.Select("Selected = true"); EngineConfig.DisplayModeRow mode = modes[0]; int width = mode.Width; int height = mode.Height; int bpp = mode.Bpp; bool fullscreen = mode.FullScreen; // create a default form to use for a rendering target DefaultForm form = CreateDefaultForm(windowTitle, 0, 0, width, height, fullscreen); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, bpp, fullscreen, 0, 0, true, false, form.Target); // set the default form's renderwindow so it can access it internally form.RenderWindow = autoWindow; // show the window form.Show(); } return autoWindow; }
public void Initialize() { #if OPENGL_OTK Contract.Requires( PlatformManager.Instance.GetType().Name == "OpenTKPlatformManager", "PlatformManager", "OpenGL OpenTK Renderer requires OpenTK Platform Manager." ); #endif Contract.Requires( Root.Instance.RenderSystems.ContainsKey( "OpenGL" ) == false, "OpenGL", "An instance of the OpenGL renderer is already loaded." ); this._renderSystem = new GLRenderSystem(); // add an instance of this plugin to the list of available RenderSystems Root.Instance.RenderSystems.Add( "OpenGL", this._renderSystem ); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if (autoCreateWindow) { int width = 800; int height = 600; int bpp = 32; bool fullScreen = false; ConfigOption optVM = ConfigOptions["Video Mode"]; string vm = optVM.Value; int pos = vm.IndexOf('x'); if (pos == -1) { throw new Exception("Invalid Video Mode provided"); } width = int.Parse(vm.Substring(0, vm.IndexOf("x"))); height = int.Parse(vm.Substring(vm.IndexOf("x") + 1)); fullScreen = (ConfigOptions["Full Screen"].Value == "Yes"); var miscParams = new NamedParameterList(); ConfigOption opt; opt = ConfigOptions["Color Depth"]; if (opt != null && opt.Value != null && opt.Value.Length > 0) { miscParams.Add("colorDepth", opt.Value); } opt = ConfigOptions["VSync"]; if (opt != null && opt.Value != null && opt.Value.Length > 0) { miscParams.Add("vsync", opt.Value); //TODO : renderSystem.WaitForVerticalBlank = (bool)opt.Value; } opt = ConfigOptions["FSAA"]; if (opt != null && opt.Value != null && opt.Value.Length > 0) { miscParams.Add("fsaa", opt.Value); } miscParams.Add("title", windowTitle); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, fullScreen, miscParams); } return(autoWindow); }
public void Initialize() { #if OPENGL_OTK Contract.Requires(PlatformManager.Instance.GetType().Name == "OpenTKPlatformManager", "PlatformManager", "OpenGL OpenTK Renderer requires OpenTK Platform Manager."); #endif Contract.Requires(Root.Instance.RenderSystems.ContainsKey("OpenGL") == false, "OpenGL", "An instance of the OpenGL renderer is already loaded."); this._renderSystem = new GLRenderSystem(); // add an instance of this plugin to the list of available RenderSystems Root.Instance.RenderSystems.Add("OpenGL", this._renderSystem); }
protected override void dispose(bool disposeManagedResources) { if (!isDisposed) { if (disposeManagedResources) { // Dispose managed resources. GLRenderSystem rs = (GLRenderSystem)Root.Instance.RenderSystem; rs.UnRegisterContext(this); } // There are no unmanaged resources to release, but // if we add them, they need to be released here. } // If it is available, make the call to the // base class's Dispose(Boolean) method base.dispose(disposeManagedResources); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if(autoCreateWindow) { // MONO: Could not cast result of Select to strongly typed data row DataRow[] modes = (DataRow[])engineConfig.DisplayMode.Select("Selected = true"); DataRow mode = modes[0]; int width = (int)mode["Width"]; int height = (int)mode["Height"]; int bpp = (int)mode["Bpp"]; bool fullscreen = (bool)mode["FullScreen"]; // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, 32, fullscreen, 0, 0, true, false, null); } return autoWindow; }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if (autoCreateWindow) { // MONO: Could not cast result of Select to strongly typed data row DataRow[] modes = (DataRow[])engineConfig.DisplayMode.Select("Selected = true"); DataRow mode = modes[0]; int width = (int)mode["Width"]; int height = (int)mode["Height"]; int bpp = (int)mode["Bpp"]; bool fullscreen = (bool)mode["FullScreen"]; // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, 32, fullscreen, 0, 0, true, false, null); } return(autoWindow); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public abstract RenderWindow CreateWindow( bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle );
public override RenderWindow CreateWindow( bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle ) { throw new Exception( "The method or operation is not implemented." ); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public abstract RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle);
public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if (autoCreateWindow) { int width = 640; int height = 480; int bpp = 32; bool fullscreen = false; ConfigOption optVM = ConfigOptions["Video Mode"]; string vm = optVM.Value; int pos = vm.IndexOf('x'); if (pos == -1) throw new Exception("Invalid Video Mode provided"); width = int.Parse(vm.Substring(0, vm.IndexOf("x"))); height = int.Parse(vm.Substring(vm.IndexOf("x") + 1)); fullscreen = (ConfigOptions["Full Screen"].Value == "Yes"); NamedParameterList miscParams = new NamedParameterList(); ConfigOption opt; opt = ConfigOptions["Color Depth"]; if (opt != null) miscParams.Add("colorDepth", opt.Value); opt = ConfigOptions["VSync"]; if (opt != null) { miscParams.Add("vsync", opt.Value); if (Wgl.IsExtensionSupported("wglSwapIntervalEXT")) Wgl.wglSwapIntervalEXT(StringConverter.ParseBool(opt.Value) ? 1 : 0); } opt = ConfigOptions["FSAA"]; if (opt != null) miscParams.Add("fsaa", opt.Value); // create a default form to use for a rendering target //DefaultForm form = CreateDefaultForm( windowTitle, 0, 0, width, height, fullscreen ); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, fullscreen, miscParams); // set the default form's renderwindow so it can access it internally //form.RenderWindow = autoWindow; // show the window //form.Show(); } return autoWindow; }
public GLDepthBuffer(PoolId poolId, GLRenderSystem renderSystem, GLContext creatorContext, GLRenderBuffer depth, GLRenderBuffer stencil, int width, int height, int fsaa, int multiSampleQuality, bool manual) : base(poolId, 0, width, height, fsaa, "", manual) { }
public override Axiom.Graphics.RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if (autoCreateWindow) { EngineConfig.DisplayModeRow[] modes = (EngineConfig.DisplayModeRow[])engineConfig.DisplayMode.Select("Selected = true"); EngineConfig.DisplayModeRow mode = modes[0]; int width = mode.Width; int height = mode.Height; int bpp = mode.Bpp; bool fullscreen = mode.FullScreen; // create a default form to use for a rendering target DefaultForm form = CreateDefaultForm(windowTitle, 0, 0, width, height, fullscreen); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, bpp, fullscreen, 0, 0, true, false, form.Target); // set the default form's renderwindow so it can access it internally form.RenderWindow = autoWindow; // show the window form.Show(); } return(autoWindow); }
public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { RenderWindow autoWindow = null; if (autoCreateWindow) { int width = 640; int height = 480; int bpp = 32; bool fullscreen = false; ConfigOption optVM = ConfigOptions["Video Mode"]; string vm = optVM.Value; int pos = vm.IndexOf('x'); if (pos == -1) { throw new Exception("Invalid Video Mode provided"); } width = int.Parse(vm.Substring(0, vm.IndexOf("x"))); height = int.Parse(vm.Substring(vm.IndexOf("x") + 1)); fullscreen = (ConfigOptions["Full Screen"].Value == "Yes"); NamedParameterList miscParams = new NamedParameterList(); ConfigOption opt; opt = ConfigOptions["Color Depth"]; if (opt != null) { miscParams.Add("colorDepth", opt.Value); } opt = ConfigOptions["VSync"]; if (opt != null) { miscParams.Add("vsync", opt.Value); if (Wgl.IsExtensionSupported("wglSwapIntervalEXT")) { Wgl.wglSwapIntervalEXT(StringConverter.ParseBool(opt.Value) ? 1 : 0); } } opt = ConfigOptions["FSAA"]; if (opt != null) { miscParams.Add("fsaa", opt.Value); } // create a default form to use for a rendering target //DefaultForm form = CreateDefaultForm( windowTitle, 0, 0, width, height, fullscreen ); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow(windowTitle, width, height, fullscreen, miscParams); // set the default form's renderwindow so it can access it internally //form.RenderWindow = autoWindow; // show the window //form.Show(); } return(autoWindow); }
public override RenderWindow CreateWindow(bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle) { throw new Exception("The method or operation is not implemented."); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public override RenderWindow CreateWindow( bool autoCreateWindow, GLRenderSystem renderSystem, string windowTitle ) { RenderWindow autoWindow = null; if ( autoCreateWindow ) { int width = 800; int height = 600; int bpp = 32; bool fullScreen = false; ConfigOption optVM = ConfigOptions[ "Video Mode" ]; string vm = optVM.Value; int pos = vm.IndexOf( 'x' ); if ( pos == -1 ) { throw new Exception( "Invalid Video Mode provided" ); } width = int.Parse( vm.Substring( 0, vm.IndexOf( "x" ) ) ); height = int.Parse( vm.Substring( vm.IndexOf( "x" ) + 1 ) ); fullScreen = ( ConfigOptions[ "Full Screen" ].Value == "Yes" ); var miscParams = new NamedParameterList(); ConfigOption opt; opt = ConfigOptions[ "Color Depth" ]; if ( opt != null && opt.Value != null && opt.Value.Length > 0 ) { miscParams.Add( "colorDepth", opt.Value ); } opt = ConfigOptions[ "VSync" ]; if ( opt != null && opt.Value != null && opt.Value.Length > 0 ) { miscParams.Add( "vsync", opt.Value ); //TODO : renderSystem.WaitForVerticalBlank = (bool)opt.Value; } opt = ConfigOptions[ "FSAA" ]; if ( opt != null && opt.Value != null && opt.Value.Length > 0 ) { miscParams.Add( "fsaa", opt.Value ); } miscParams.Add( "title", windowTitle ); // create the window with the default form as the target autoWindow = renderSystem.CreateRenderWindow( windowTitle, width, height, fullScreen, miscParams ); } return autoWindow; }