void AfterPresentSurfaceGLES(EAGLSurfaceDesc* surface)
{
	if(surface->use32bitColor != UnityUse32bitDisplayBuffer())
	{
		surface->use32bitColor = UnityUse32bitDisplayBuffer();
		CreateSurfaceGLES(surface);
		GLES_CHK( glBindRenderbufferOES(GL_RENDERBUFFER_OES, surface->renderbuffer) );
	}

#if GL_APPLE_framebuffer_multisample
	if (_supportsMSAA)
	{
		const int desiredMSAASamples = UnityGetDesiredMSAASampleCount(MSAA_DEFAULT_SAMPLE_COUNT);
		if (surface->msaaSamples != desiredMSAASamples)
		{
			surface->msaaSamples = desiredMSAASamples;
			CreateSurfaceMultisampleBuffersGLES(surface);
			GLES_CHK( glBindRenderbufferOES(GL_RENDERBUFFER_OES, surface->renderbuffer) );
		}

		if (surface->msaaSamples > 1)
		{
			UNITY_DBG_LOG ("  glBindFramebufferOES (GL_FRAMEBUFFER_OES, %i); // PresentSurface\n", surface->msaaFramebuffer);
			GLES_CHK( glBindFramebufferOES(GL_FRAMEBUFFER_OES, surface->msaaFramebuffer) );

			gDefaultFBO = surface->msaaFramebuffer;
		}
	}
#endif
}
Exemplo n.º 2
0
void AfterPresentSurfaceGLES(EAGLSurfaceDesc* surface)
{
	if(surface->use32bitColor != UnityUse32bitDisplayBuffer())
	{
		surface->use32bitColor = UnityUse32bitDisplayBuffer();
		CreateSurfaceGLES(surface);
		GLES_CHK( glBindRenderbufferOES(GL_RENDERBUFFER_OES, surface->systemRenderbuffer) );
	}

	if(NeedRecreateRenderingSurfaceGLES(surface))
	{
		UnityGetRenderingResolution(&surface->targetW, &surface->targetH);
		surface->msaaSamples = UnityGetDesiredMSAASampleCount(MSAA_DEFAULT_SAMPLE_COUNT);

		CreateRenderingSurfaceGLES(surface);
	}
}