How to draw a quardratic surface?

For example, I have a surface defined like: z = ax^2 + bxy + cy^2.
How can I draw it using openGL?
Thanks a lot.

Lagacy or core only? AFAIK legacy OpenGLĀ® has functions for drawing quadrics. (I have never used them myself)

Personally, I would stick to core profile OpenGLĀ®, create a vertex buffer by subdividing a square (e.g. 10*10 sub patches -> 200 triangles -> 100 vertices + 600 indices. Can be easily generated in a for loop). For each vertex, map the 2D coordinates on the square surface to the range you are interested in and compute the resulting third coordinate.

The resulting vbo/ibo combination can be rendered like any other object.