Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Proposals OpenGL

Robert M. Lefkowitz edited this page Jun 23, 2014 · 2 revisions

PageOutline

Table of Contents

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 1.3.0.0) to the Haskell Platform. This allows for the much needed update to the OpenGL and GLUT packages (versions 2.8.0.0 and 2.4.0.0, 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.

Credits

Proposal author: Jason Dagit

Package maintainer: Jason Dagit

The following individuals contributed to the review process:

  * ...

Abstract

Overview of each package:

 * OpenGL: provides a high-level binding to the [http://www.khronos.org/opengl OpenGL API ] in a cross-platform manner and supports API extensions dynamically.
 * GLUT: provides a high-level binding to the [http://freeglut.sourceforge.net/ 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 [http://www.opengl.org/registry/doc/glu1.3.pdf GL Utility] API. This library is used by higher-level abstractions, such as the OpenGL package.

Documentation and tarballs from Hackage:

 * http://hackage.haskell.org/package/OpenGL
 * http://hackage.haskell.org/package/GLUT
 * http://hackage.haskell.org/package/OpenGLRaw
 * http://hackage.haskell.org/package/GLURaw

Development repos:

 * https://github.com/haskell-opengl/OpenGL
 * https://github.com/haskell-opengl/GLUT
 * https://github.com/haskell-opengl/OpenGLRaw
 * https://github.com/haskell-opengl/GLURaw

Rationale

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

Please see a recent edition of the OpenGL Red Book, the examples in the GLUT package, or many of the other OpenGL resources: http://www.haskell.org/haskellwiki/Opengl

Design decisions

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.

Open issues

Clone this wiki locally