protected override void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { CleanUpTextures(); if (videoTextureCache != null) { videoTextureCache.Flush(CVOptionFlags.None); videoTextureCache.Dispose(); } if (context != null) { context.Dispose(); } } GL.DeleteFramebuffers(1, ref frameBufferHandle); GL.DeleteRenderbuffers(1, ref colorBufferHandle); disposed = true; base.Dispose(disposing); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); context.Dispose(); glContext.Dispose(); }
protected virtual void Dispose(bool disposing) { if (EAGLContext != null) { EAGLContext.Dispose(); } EAGLContext = null; }
internal override void Initialize(GameContext gameContext) { GameContext = gameContext; gameForm = gameContext.GameView; nativeWindow = new WindowHandle(AppContextType.iOS, gameForm); gameForm.Load += gameForm_Load; gameForm.Unload += gameForm_Unload; gameForm.RenderFrame += gameForm_RenderFrame; // get the OpenGL ES version var contextAvailable = false; foreach (var version in OpenGLUtils.GetGLVersions(gameContext.RequestedGraphicsProfile)) { var contextRenderingApi = MajorVersionTOEAGLRenderingAPI(version); EAGLContext contextTest = null; try { contextTest = new EAGLContext(contextRenderingApi); // delete extra context if (contextTest != null) contextTest.Dispose(); gameForm.ContextRenderingApi = contextRenderingApi; contextAvailable = true; } catch (Exception) { // TODO: log message } } if (!contextAvailable) throw new Exception("Graphics context could not be created."); gameForm.LayerColorFormat = MonoTouch.OpenGLES.EAGLColorFormat.RGBA8; //gameForm.LayerRetainsBacking = false; // Setup the initial size of the window var width = gameContext.RequestedWidth; if (width == 0) { width = (int)(gameForm.Size.Width * gameForm.ContentScaleFactor); } var height = gameContext.RequestedHeight; if (height == 0) { height = (int)(gameForm.Size.Height * gameForm.ContentScaleFactor); } gameForm.Size = new Size(width, height); //gameForm.Resize += OnClientSizeChanged; }
void DestroyContext() { EAGLContext.SetCurrentContext(_glContext); GL.DeleteRenderbuffers(1, ref _db); GL.DeleteRenderbuffers(1, ref _cb); GL.DeleteFramebuffers(1, ref _fb); _db = _cb = _fb = 0; _glContext.Dispose(); _alContext.Dispose(); }
protected override void Dispose(bool disposing) { if (IsDisposed) { return; } if (EAGLContext != null) { EAGLContext.Dispose(); } EAGLContext = null; IsDisposed = true; }
protected override void Dispose(bool disposing) { if (!IsDisposed) { if (disposing) { if (EAGLContext != null) { EAGLContext.Dispose(); } EAGLContext = null; } IsDisposed = true; } }
protected override void Initialize(GameContext <iOSWindow> gameContext) { gameForm = gameContext.Control.GameView; nativeWindow = new WindowHandle(AppContextType.iOS, gameForm, gameForm.Handle); gameForm.Load += gameForm_Load; gameForm.Unload += gameForm_Unload; gameForm.RenderFrame += gameForm_RenderFrame; // get the OpenGL ES version var contextAvailable = false; foreach (var version in OpenGLUtils.GetGLVersions(gameContext.RequestedGraphicsProfile)) { var contextRenderingApi = MajorVersionTOEAGLRenderingAPI(version); EAGLContext contextTest = null; try { contextTest = new EAGLContext(contextRenderingApi); // delete extra context if (contextTest != null) { contextTest.Dispose(); } gameForm.ContextRenderingApi = contextRenderingApi; contextAvailable = true; break; } catch (Exception) { // TODO: log message } } if (!contextAvailable) { throw new Exception("Graphics context could not be created."); } gameForm.LayerColorFormat = EAGLColorFormat.RGBA8; //gameForm.LayerRetainsBacking = false; currentOrientation = UIApplication.SharedApplication.StatusBarOrientation; }
internal override void Initialize(GameContext gameContext) { GameContext = gameContext; gameForm = gameContext.GameView; nativeWindow = new WindowHandle(AppContextType.iOS, gameForm); gameForm.Load += gameForm_Load; gameForm.Unload += gameForm_Unload; gameForm.RenderFrame += gameForm_RenderFrame; // get the OpenGL ES version var contextAvailable = false; foreach (var version in OpenGLUtils.GetGLVersions(gameContext.RequestedGraphicsProfile)) { var contextRenderingApi = MajorVersionTOEAGLRenderingAPI(version); EAGLContext contextTest = null; try { contextTest = new EAGLContext(contextRenderingApi); // delete extra context if (contextTest != null) contextTest.Dispose(); gameForm.ContextRenderingApi = contextRenderingApi; contextAvailable = true; break; } catch (Exception) { // TODO: log message } } if (!contextAvailable) throw new Exception("Graphics context could not be created."); gameForm.LayerColorFormat = EAGLColorFormat.RGBA8; //gameForm.LayerRetainsBacking = false; }
public void Dispose() { Context?.Dispose(); Context = null; }
internal override void Initialize(GameContext gameContext) { GameContext = gameContext; gameForm = gameContext.GameView; nativeWindow = new WindowHandle(AppContextType.iOS, gameForm); gameForm.Load += gameForm_Load; gameForm.Unload += gameForm_Unload; gameForm.RenderFrame += gameForm_RenderFrame; // get the OpenGL ES version var contextAvailable = false; foreach (var version in OpenGLUtils.GetGLVersions(gameContext.RequestedGraphicsProfile)) { var contextRenderingApi = MajorVersionTOEAGLRenderingAPI(version); EAGLContext contextTest = null; try { contextTest = new EAGLContext(contextRenderingApi); // delete extra context if (contextTest != null) { contextTest.Dispose(); } gameForm.ContextRenderingApi = contextRenderingApi; contextAvailable = true; } catch (Exception) { // TODO: log message } } if (!contextAvailable) { throw new Exception("Graphics context could not be created."); } gameForm.LayerColorFormat = MonoTouch.OpenGLES.EAGLColorFormat.RGBA8; //gameForm.LayerRetainsBacking = false; // Setup the initial size of the window var width = gameContext.RequestedWidth; if (width == 0) { width = (int)(gameForm.Size.Width * gameForm.ContentScaleFactor); } var height = gameContext.RequestedHeight; if (height == 0) { height = (int)(gameForm.Size.Height * gameForm.ContentScaleFactor); } gameForm.Size = new Size(width, height); //gameForm.Resize += OnClientSizeChanged; }