To draw a bezier curve using OpenGL or Direct3D you need to sub-divide the bezier into line segments. If you do this with enough sub-divisions it will look like a smooth curve.
Interpolation functions:
vec2 Lerp(vec2 a, vec2 b, float i) {
return a + (b - a) * i;
}
vec2 Bezier4(vec2 a, vec2 b, vec2 c, vec2 d, float i) {
return Lerp(Lerp(a, b, i), Lerp(c, d, i), i);
}
Then you generate a series of points on the bezier curve and draw connected lines between them:
vec2 bezier[4] = { bezier control points };
int resolution = 8;
vec2 points[resolution];
for(int n=0; n < resolution; ++n){
float i = (float)n / (float)(resolution-1);
points[n] = Bezier4(bezier[0], bezier[1] bezier[2] bezier[3], i);
}
DrawConnectLines(points, resolution);
You can increase the resolution to make the curve approximation smoother.