Page 1 of 1

2D primitives - is there any way to draw a filled triangle?

Posted: Mon Mar 07, 2011 6:19 am
by Josh1billion
Hi guys,

I'm currently using three calls to draw2DLine() function to draw a triangle onto a texture. (To see what I mean, you can click here: http://img683.imageshack.us/img683/234/ ... hwalls.png -- this screenshot shows four such triangles)

Is there any alternative function that I can use to render a solid, filled-in triangle, instead of just the outline as happens when I use draw2DLine()?

Posted: Mon Mar 07, 2011 6:36 am
by serengeor
You know there's API for that, I think you could use this:
virtual void draw2DVertexPrimitiveList (const void *vertices, u32 vertexCount, const void *indexList, u32 primCount, E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT)=0
Draws a vertex primitive list in 2d.