haskell-opengl / OpenGL

Haskell bindings to OpenGL
http://www.haskell.org/haskellwiki/OpenGL
BSD 3-Clause "New" or "Revised" License
147 stars 26 forks source link

Improving the Texture Api #44

Closed Laar closed 10 years ago

Laar commented 10 years ago

The old texture Api had the problem that functions like texImage2D has a predefined texture target. This commit range changes TextureTarget from a ADT to a typeclass, with new ADTs like TextureTarget2D for each dimension.

Note: This is very old code, yet I think the idea is right.

svenpanne commented 10 years ago

I'll take a look and see how much can easily be merged. I was not completely happy with this part of the API, anyway, and the next release might be a good place for improving this, because it has some incompatible changes already.

svenpanne commented 10 years ago

I added a slight variation of your changes, but as mentioned in dcd70b40a7167572e97ea9a95a5a86f27bd8bb2e, cube maps still need some fixing. The native OpenGL API is not very nice regarding this.

svenpanne commented 10 years ago

Cube maps etc. work now, too. The changes are basically a generalization of your patch, so we can close this pull request. Thanks!