Ejemplo n.º 1
0
static void __inline__ mga_draw_triangle( mgaContextPtr mmesa,
					   mgaVertexPtr v0,
					   mgaVertexPtr v1,
					   mgaVertexPtr v2 )
{
   GLuint vertex_size = mmesa->vertex_size;
   GLuint *vb = mgaAllocDmaLow( mmesa, 3 * 4 * vertex_size );
   int j;

   EMIT_VERT( j, vb, vertex_size, v0 );
   EMIT_VERT( j, vb, vertex_size, v1 );
   EMIT_VERT( j, vb, vertex_size, v2 );
}
Ejemplo n.º 2
0
static void mgaFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts, 
				       GLuint n )
{
   mgaContextPtr mmesa = MGA_CONTEXT( ctx );
   GLuint vertex_size = mmesa->vertex_size;
   GLuint *vb = mgaAllocDmaLow( mmesa, (n-2) * 3 * 4 * vertex_size );
   GLubyte *vertptr = (GLubyte *)mmesa->verts;			
   const GLuint *start = (const GLuint *)VERT(elts[0]);
   int i,j;

   for (i = 2 ; i < n ; i++) {
      EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i-1]) );
      EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) VERT(elts[i]) );
      EMIT_VERT( j, vb, vertex_size, (mgaVertexPtr) start );
   }
}
Ejemplo n.º 3
0
static void INLINE mga_draw_quad( mgaContextPtr mmesa,
				       mgaVertexPtr v0,
				       mgaVertexPtr v1,
				       mgaVertexPtr v2,
				       mgaVertexPtr v3 )
{
   GLuint vertex_size = mmesa->vertex_size;
   GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
   int j;

   EMIT_VERT( j, vb, vertex_size, v0 );
   EMIT_VERT( j, vb, vertex_size, v1 );
   EMIT_VERT( j, vb, vertex_size, v3 );
   EMIT_VERT( j, vb, vertex_size, v1 );
   EMIT_VERT( j, vb, vertex_size, v2 );
   EMIT_VERT( j, vb, vertex_size, v3 );
}