[HOpenGL] Specialized versions of renderPrimitives?

Henning Thielemann haskell at henning-thielemann.de
Fri Oct 27 07:25:21 EDT 2006


On Fri, 27 Oct 2006, Sven Panne wrote:

> One thing I don't fully understand: What is not type safe in the current API? 
> The only thing I see is that one could use a different monad within 
> renderPrimitive to enforce that only correct OpenGL command could be issued 
> there.

There are several OpenGL commands that make no sense in renderPrimitive
like glViewport, glEnd, glFlush ... For modes like Lines, where pairs of
vertices are needed, it could be enforced by types, that you can only pass
pairs of vertices.

> But having direct access to the IO monad is more important to access 
> e.g. IORefs etc.

I think it is enough to access them outside renderPrimitive.


More information about the HOpenGL mailing list