add draw_primitive method to RenderTarget