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

Missing OpenGL 3.x style extension string queries #56

Open
blitzcode opened this issue Aug 31, 2014 · 0 comments
Open

Missing OpenGL 3.x style extension string queries #56

blitzcode opened this issue Aug 31, 2014 · 0 comments

Comments

@blitzcode
Copy link

The existing extension string functionality is deprecated in modern OpenGL, would be nice if something along the lines of this could be added to the wrapper:

getNumExtensions :: IO Int
getNumExtensions =
    alloca $ \(ptr :: Ptr GLR.GLint) ->
        GLR.glGetIntegerv GLR.gl_NUM_EXTENSIONS ptr >> fromIntegral <$> peek ptr

getExtensionStr :: Int -> IO String
getExtensionStr i =
    peekCString =<< castPtr <$> GLR.glGetStringi GLR.gl_EXTENSIONS (fromIntegral i)

getGLExtensionList :: IO [String]
getGLExtensionList =
  getNumExtensions >>= \numExt -> forM [0..numExt - 1] $ \i -> getExtensionStr i
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