io7m
io7m-jcanephora 0.45.1
2.1
Problems with OpenGL
2.1.1
Overview
1
The jcanephora package takes the general view that OpenGL as an API is a ridiculously error-prone and poorly defined mess [1]. The package attempts to address most if not all of the problems listed in this section.
2.1.2
Types
1
The OpenGL API itself is weakly typed even for a C language API, simply exposing absolutely everything as a float, int, or untyped pointer. Entire classes of problems that should be prevented at compile time are moved to run-time, increasing development time, developer frustration, and testing burden.
2.1.3
Confusion
1
Rather than add or remove function entry points, the OpenGL designers decided to endlessly extend existing functions with yet more combinations of barely-typed parameters. Actually using the OpenGL API correctly is a challenge even for those that are familiar with the full API specification. Out of the hundreds of thousands of combinations of parameters that can be passed to any given API function, only a handful are actually valid.
2.1.4
Silent failure
1
OpenGL programs frequently fail, and when they do, they usually do so silently. Programmers are forced to call glGetError after every API call if they wish to avoid this (and actually detect the error at the correct function call).

[1]
Whilst, annoyingly, being the only viable cross-platform and vendor neutral graphics API available.