How does OpenGL render its triangles?
===

I need an algorithm to render pixel perfect triangles without using OpenGL.

Where can I get such an algorithm like OpenGL is using? Preferrably single threaded.

It must do it like OpenGL does it, because OpenGL doesn't leave gaps or overlapped pixels on two triangles that share an edge. Scanline method makes those errors: http://joshbeam.com/articles/triangle_rasterization/ . I tried this half-space algo too: http://devmaster.net/forums/topic/1145-advanced-rasterization/ but I couldnt make it work (renders gibberish).

- How does OpenGL do it? Is it so intensive job that I should just forget about it and use the (buggy) scanline method instead?

- Where can I get the algorithm?

I would prefer a C++ solution but the language isn't the problem.
