Axiom.RenderSystems.OpenGLES.GLESFBOManager.TryFormat C# (CSharp) Метод

TryFormat() приватный Метод

Try a certain FBO format, and return the status. Also sets mDepthRB and mStencilRB.
private TryFormat ( All depthFormat, All stencilFormat ) : bool
depthFormat All
stencilFormat All
Результат bool
		private bool TryFormat( All depthFormat, All stencilFormat )
		{
			int status = 0, depthRB = 0, stencilRB = 0;
			if ( depthFormat != 0 )
			{
				/// Generate depth renderbuffer
				OpenGLOES.GenRenderbuffers( 1, ref depthRB );

				/// Bind it to FBO
				OpenGLOES.RenderbufferStorage( All.RenderbufferOes, depthFormat,
					ProbeSize, ProbeSize );

				/// Attach depth
				OpenGLOES.FramebufferRenderbuffer( All.FramebufferOes, All.DepthAttachmentOes,
					All.RenderbufferOes, depthRB );
			}
			// Stencil buffers aren't available on iPhone
			if ( stencilFormat != 0 )
			{
				/// Generate stencil renderbuffer
				OpenGLOES.GenRenderbuffers( 1, ref stencilRB );

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

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

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

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

			OpenGLOES.FramebufferRenderbuffer( All.RenderbufferOes, All.DepthAttachmentOes, All.RenderbufferOes, 0 );
			OpenGLOES.FramebufferRenderbuffer( All.RenderbufferOes, All.StencilAttachmentOes, All.RenderbufferOes, 0 );

			if ( depthRB != 0 )
				OpenGLOES.DeleteRenderbuffers( 1, ref depthRB );

			if ( stencilRB != 0 )
				OpenGLOES.DeleteRenderbuffers( 1, ref stencilRB );

			return status == (int)All.FramebufferCompleteOes;
		}