public override void Dispose() { if (Root.Instance != null && Root.Instance.RenderSystem != null) { GLESRenderSystem rendersystem = (GLESRenderSystem)Root.Instance.RenderSystem; //Javax.Microedition.Khronos.Egl.EGLContext.EGL11.EglDestroyContext( _eglDisplay, _context ); rendersystem.UnregisterContext(this); } }
/// <summary> /// </summary> /// <param name="autoCreateWindow"> </param> /// <param name="renderSystem"> </param> /// <param name="windowTitle"> </param> /// <returns> </returns> public override RenderWindow CreateWindow(bool autoCreateWindow, GLESRenderSystem renderSystem, string windowTitle) { RenderWindow window = null; if (autoCreateWindow) { var miscParams = new NamedParameterList(); bool fullScreen = false; int width = 640; int height = 480; if (_options["Full Screen"] != null) { fullScreen = _options["Full Screen"].Value == "Yes"; } if (_options["Display Frequency"] != null) { miscParams["displayFrequency"] = _options["Display Frequency"].Value; } if (_options["Video Mode"] != null) { string val = _options["Video Mode"].Value; int xIndex = val.IndexOf("x"); if (xIndex != -1) { width = int.Parse(val.Substring(0, xIndex)); height = int.Parse(val.Substring(xIndex + 1)); } } if (_options["FSAA"] != null) { miscParams["FSAA"] = _options["FSAA"].Value; } window = renderSystem.CreateRenderWindow(windowTitle, width, height, fullScreen, miscParams); } return(window); }
/// <summary> /// /// </summary> /// <param name="autoCreateWindow"></param> /// <param name="renderSystem"></param> /// <param name="windowTitle"></param> /// <returns></returns> public override RenderWindow CreateWindow( bool autoCreateWindow, GLESRenderSystem renderSystem, string windowTitle ) { RenderWindow window = null; if ( autoCreateWindow ) { NamedParameterList miscParams = new NamedParameterList(); bool fullScreen = false; int width = 640; int height = 480; if ( _options[ "Full Screen" ] != null ) { fullScreen = _options[ "Full Screen" ].Value == "Yes"; } if ( _options[ "Display Frequency" ] != null ) { miscParams[ "displayFrequency" ] = _options[ "Display Frequency" ].Value; } if ( _options[ "Video Mode" ] != null ) { string val = _options[ "Video Mode" ].Value; int xIndex = val.IndexOf( "x" ); if ( xIndex != -1 ) { width = int.Parse( val.Substring( 0, xIndex ) ); height = int.Parse( val.Substring( xIndex + 1 ) ); } } if ( _options[ "FSAA" ] != null ) { miscParams[ "FSAA" ] = _options[ "FSAA" ].Value; } window = renderSystem.CreateRenderWindow( windowTitle, width, height, fullScreen, miscParams ); } return window; }
/// <summary> /// Initializes the plugin. /// </summary> public void Initialize() { this._renderSystem = new GLESRenderSystem(); Root.Instance.RenderSystems.Add("OpenGLES", this._renderSystem); }
/// <summary> /// </summary> /// <param name="autoCreateWindow"> </param> /// <param name="renderSystem"> </param> /// <param name="windowTitle"> </param> /// <returns> </returns> public abstract RenderWindow CreateWindow(bool autoCreateWindow, GLESRenderSystem renderSystem, string windowTitle);