|Version 3 (modified by dagit, 2 years ago)|
Proposal: Add the OpenGLRaw and GLURaw package and also update OpenGL and GLUT packages (already) in the Haskell Platform
This is a proposal to add OpenGLRaw and GLURaw (both at version 18.104.22.168) to the Haskell Platform. This allows for the much needed update to the OpenGL and GLUT packages (versions 22.214.171.124 and 126.96.36.199, respectively).
Everyone is invited to review this proposal, following the standard procedure for proposing and reviewing packages.
Review comments should be sent to the libraries mailing list before Monday March 25th, 2013, which is the discussion deadline.
Proposal author: Jason Dagit
Package maintainer: Jason Dagit
The following individuals contributed to the review process:
Overview of each package:
- OpenGL: provides a high-level binding to the OpenGL API in a cross-platform manner and supports API extensions dynamically.
- GLUT: provides a high-level binding to the OpenGL Utility Toolkit API. This gives users cross-platform access to graphics contexts and other primitives such as fonts.
- OpenGLRaw: provides low-level foreign imports and marshalling code for directly interfacing with the C OpenGL API. This library is used by higher-level abstractions, such as the OpenGL package, and closely matches the C API for OpenGL.
- GLURaw: provides low-level foreign imports and marshalling code for directly interfacing with the C GL Utility API. This library is used by higher-level abstractions, such as the OpenGL package.
Documentation and tarballs from Hackage:
OpenGL is an industry standard rasterization library that provides efficient access for direct rendering of 2D and 3D graphics. As such, this library makes a solid foundation for high-performance scientific visualization, video games, and toy projects. See for example the gloss library that uses OpenGL for the "heavy lifting".
While the core of the OpenGL standard is not platform specific, creating an OpenGL context within an application and managing user input requires platform specific support. This proposal includes the GLUT package as a means to provide that platform specific support. GLUT can be used to handle mouse and keyboard input, create and control a GUI window suitable for OpenGL rendering, and also provide primitive font rendering.
In order to support the OpenGL package, the platform will also need to accept the underlying low-level bindings that OpenGL depends on (OpenGLRaw and GLURaw). These raw packages are in some ways nicer to use than the higher-level package. They are nicer when:
- The programmer is familiar with or wants to use the C API
- The programmer is using generic OpenGL textbooks and code samples
- A high level API would get in the way or cause performance issues
While the haddock documentation for the raw packages is not as good those packages follow the naming conventions of the documented API so well that external documentation can be used to understand them. OpenGLRaw and GLURaw modules could live inside the OpenGL package, but packing them separately allows for a nice split (and fewer dependencies) for advanced users who want to directly use functions defined in OpenGLRaw. Additionally, the higher-level interface tends to lag behind the official specification whereas with OpenGLRaw, by simply wrapping the C API, it is much easier to update. In fact, we have future plans to autogenerate OpenGLRaw directly from the published specifications.
Introduction to the API
As alluded to above, one decision that the haskell-opengl team holds dearly is the split between high-level and low-level aspects of the bindings. We have no plans to merge the packages and feel that we strongly benefit from having them divided.