engine/video_layer.c
/*	Deals with tris view and different primitive types, then finally draws
	the given arrays.
*/
Deals with tris view and different primitive types, then finally draws
the given arrays.
Deals with tris view and different primitive types then finally draws the given arrays .
void VideoLayer_DrawArrays(const VideoPrimitive_t vpPrimitiveType, unsigned int uiSize, bool bWireframe)
{
	unsigned int uiPrimitiveType = VideoLayer_TranslatePrimitiveType(vpPrimitiveType);
	if (uiPrimitiveType == VIDEO_PRIMITIVE_IGNORE)
		Sys_Error("Invalid primitive type! (%i)\n", vpPrimitiveType);
	if (bWireframe)
	{
		switch (vpPrimitiveType)
		{
		case VIDEO_PRIMITIVE_LINE:
		case VIDEO_PRIMITIVE_TRIANGLES:
			uiPrimitiveType = GL_LINES;
			break;
		default:
			glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
		}
	}
	glDrawArrays(uiPrimitiveType, 0, uiSize);
	if (bWireframe)
		if ((vpPrimitiveType != VIDEO_PRIMITIVE_LINE) &&
			(vpPrimitiveType != VIDEO_PRIMITIVE_TRIANGLES))
			glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
void VideoLayer_DrawArrays ( const VideoPrimitive_t vpPrimitiveType , unsigned int uiSize , bool bWireframe ) { unsigned int uiPrimitiveType = VideoLayer_TranslatePrimitiveType ( vpPrimitiveType ) ; if ( uiPrimitiveType == VIDEO_PRIMITIVE_IGNORE ) Sys_Error ( " \n " , vpPrimitiveType ) ; if ( bWireframe ) { switch ( vpPrimitiveType ) { case VIDEO_PRIMITIVE_LINE : case VIDEO_PRIMITIVE_TRIANGLES : uiPrimitiveType = GL_LINES ; break ; default : glPolygonMode ( GL_FRONT_AND_BACK , GL_LINE ) ; } } glDrawArrays ( uiPrimitiveType , 0 , uiSize ) ; if ( bWireframe ) if ( ( vpPrimitiveType != VIDEO_PRIMITIVE_LINE ) && ( vpPrimitiveType != VIDEO_PRIMITIVE_TRIANGLES ) ) glPolygonMode ( GL_FRONT_AND_BACK , GL_FILL ) ; }
Deals with tris view and different primitive types, then finally draws
the given arrays.
Deals with tris view and different primitive types then finally draws the given arrays .