Need a tool to convert spline into 2d mesh shape.

I want to make an in-game tool for drawing 2d meshes.

How would I to turn a list of polygon border points (eg a spline) into a triangulated shape?
I would greatly appreciate any examples or resources that show how to do that.