3 ms·
OpenGL is not a general purpose graphics library, it's an API to control the actual graphics hardware, as such it follows the hardware, not the user experience.
by pandaman 9y ago
OpenGL is not a general purpose graphics library, it's an API to control the actual graphics hardware, as such it follows the hardware, not the user experience. Older GPUs had been very primitive and did not require a lot of commands to do something. For example, the PS2's GPU, GS, was a kind of GPU the OpenGL 1.x targeted. It had hardware registers for vertex position, color and texture coordinate. After every three writes into the position register it would draw a triangle into the current frame buffer (setup through a couple of registers with address, dimensions and format). If you enable a texture (a couple registers), it will draw textured triangles, if not - no big deal. So the OpenGL's glVertex functions mapped nicely to that hardware.
On a more or less modern GPU you won't find those registers. The GPU reads a stream of commands instead of polling its registers. And the most primitive command is DRAW, which means "run the current vertex shader for the given index range, collect its output, rasterize the primitives made from the output and run the current pixel shader on the resulting pixels". So in order to draw anything it's required to have a command stream set up, two shaders set up and necessary data bound to both shaders. Naturally, there is no place for glVertex() in this setup.
There are high level libraries, which abstract the hardware but it's not the purpose of the OpenGL. It's only "abstracting" hardware in the sense that it works same on different models of GPU but it tries to expose as much of the hardware as possible in a model-independent manner.