Axiom.RenderSystems.OpenGLES.GLESFBOManager.TryPacketFormat C# (CSharp) Method

TryPacketFormat() private method

Try a certain packed depth/stencil format, and return the status.
private TryPacketFormat ( All packedFormat ) : bool
packedFormat All
return bool
		private bool TryPacketFormat( All packedFormat )
		{
			int packedRB = 0;

			/// Generate renderbuffer
			OpenGLOES.GenRenderbuffers( 1, ref packedRB );

			//bind it to FBO
			OpenGLOES.BindRenderbuffer( All.RenderbufferOes, packedRB );

			/// Allocate storage for buffer
			OpenGLOES.RenderbufferStorage( All.RenderbufferOes, packedFormat, ProbeSize, ProbeSize );

			/// Attach depth
			OpenGLOES.FramebufferRenderbuffer( All.FramebufferOes, All.DepthAttachmentOes,
				All.RenderbufferOes, packedRB );

			/// Attach stencil
			OpenGLOES.FramebufferRenderbuffer( All.FramebufferOes, All.StencilAttachmentOes,
				All.RenderbufferOes, packedRB );

			All status = OpenGLOES.CheckFramebufferStatus( All.FramebufferOes );

			/// Detach and destroy
			OpenGLOES.FramebufferRenderbuffer( All.FramebufferOes, All.DepthAttachmentOes, All.RenderbufferOes, 0 );
			OpenGLOES.FramebufferRenderbuffer( All.FramebufferOes, All.StencilAttachmentOes, All.RenderbufferOes, 0 );
			OpenGLOES.DeleteRenderbuffers( 1, ref packedRB );

			return status == All.FramebufferCompleteOes;
		}