Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please consider exporting the internal marshaling functions #67

Open
ekmett opened this issue Oct 30, 2014 · 0 comments
Open

Please consider exporting the internal marshaling functions #67

ekmett opened this issue Oct 30, 2014 · 0 comments

Comments

@ekmett
Copy link
Member

ekmett commented Oct 30, 2014

I've pretty much spent the last few hours hacking around the fact that I can't get at the GLenum's for an arbitrary ParameterizedTextureTarget in order to set up texture swizzling. =(

I basically wanted to:

    glTexParameter t gl_TEXTURE_SWIZZLE_R GL_RED
    glTexParameter t gl_TEXTURE_SWIZZLE_G GL_RED
    glTexParameter t gl_TEXTURE_SWIZZLE_B GL_RED
    glTexParameter t gl_TEXTURE_SWIZZLE_A GL_ONE

This would have been trivial and I could have continued to use the built in abstractions if we acknowledged that our abstractions leak as it is I pretty much had to give up on carrying on the abstraction through my own API.

If

class ParameterizedTextureTarget t where
   marshalParameterizedTextureTarget :: t -> GLenum
   marshalParameterizedTextureTargetProxy :: t -> GLenum
   marshalParameterizedTextureTargetEnableCap :: t -> EnableCap

exported the various marshal functions, I'd have been off to the races. There are dozens of these types sprinkled throughout the library.

What is gained from hiding the implementations of these classes? The ability to bump minor versions when you change how they are implemented?

You have lots of lovely little abstractions sprinkled around the OpenGL library. Please let us build atop them. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant