engine/video_layer.c
/*	Ensures that the framebuffer is valid, otherwise throws an error.
	glCheckFramebufferStatus
*/
Ensures that the framebuffer is valid, otherwise throws an error.
Ensures that the framebuffer is valid otherwise throws an error .
void VideoLayer_CheckFrameBufferStatus()
{
	int status;
	status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
	if (status == GL_FRAMEBUFFER_COMPLETE)
		return;
	if (status == 0)
		Sys_Error("An error occured when checking framebuffer! (%s)\n", VideoLayer_GetErrorMessage(glGetError()));
	switch (status)
	{
	case GL_FRAMEBUFFER_UNDEFINED:
		Sys_Error("Default framebuffer doesn't exist!\n");
	case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
		Sys_Error("Framebuffer attachment points are incomplete!\n");
	case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
		Sys_Error("Framebuffer doesn't have an image attached!\n");
	case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
		Sys_Error("Invalid attachment type!\n");
	case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
		Sys_Error("INCOMPLETE READ BUFFER\n");
	case GL_FRAMEBUFFER_UNSUPPORTED:
		Sys_Error("UNSUPPORTED\n");
	case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
		Sys_Error("INCOMPLETE MULTISAMPLE\n");
	case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB:
		Sys_Error("INCOMPLETE LAYER TARGETS\n");
	}
	Sys_Error("An unknown error occured when checking framebuffer status!\n");
}
void VideoLayer_CheckFrameBufferStatus ( ) { int status ; status = glCheckFramebufferStatus ( GL_FRAMEBUFFER ) ; if ( status == GL_FRAMEBUFFER_COMPLETE ) return ; if ( status == 0 ) Sys_Error ( " \n " , VideoLayer_GetErrorMessage ( glGetError ( ) ) ) ; switch ( status ) { case GL_FRAMEBUFFER_UNDEFINED : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_UNSUPPORTED : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE : Sys_Error ( " \n " ) ; case GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB : Sys_Error ( " \n " ) ; } Sys_Error ( " \n " ) ; }
Ensures that the framebuffer is valid, otherwise throws an error.
Ensures that the framebuffer is valid otherwise throws an error .
// Generic GL error.