flyx / OpenGLAda

Thick Ada binding for OpenGL and GLFW
flyx.github.io/OpenGLAda/
MIT License
96 stars 13 forks source link

Bind various glDepth* and glStencil* functions #10

Closed onox closed 9 years ago

onox commented 9 years ago

Following functions are not binded:

  1. glStencilFuncSeparate (OpenGL >= 2)
  2. glStencilOpSeparate (OpenGL >= 2)
  3. glStencilMaskSeparate (OpenGL >= 2)
  4. glDepthMask (OpenGL >= 1)
  5. glDepthFunc (OpenGL >= 1)
  6. glDepthRangeArray (OpenGL >= 4)
  7. glDepthRangeIndexed (OpenGL >= 4)

Note: glStencil* (is glStencil*Separate with face set to GL_FRONT_AND_BACK)

What would be a good (new) package to put this functions in? (With actual bindings in gl-api.ads)

flyx commented 9 years ago

These would fit in GL.Buffers.

For features only available in OpenGL 4, it is important to bind them using GL.Runtime_Loading.

You seem to be knowing what you're doing. Do you want to have write access to the repository? I moved away from Ada some time ago, so while I try to help you fixing issues you find, I probably won't do much active development on this library.

onox commented 9 years ago

It seems only glDepthMask and glDepthFunc exist since OpenGL 1.0, so I'll import those with StdCall convention, and use Loader for everything else.

You seem to be knowing what you're doing. Do you want to have write access to the repository? I moved away from Ada some time ago, so while I try to help you fixing issues you find, I probably won't do much active development on this library.

Moved to Nim?

I just started learning GLSL and OpenGL >= 3.2, so I prefer if you could just give me some pointers/guidance now and then and comment in pull requests if I do something obviously wrong :smile:

Btw, is there a particular use-case for doing matrix manipulations with types other than Singles/Doubles? I want to add some functions/procedures to translate/rotate/scale + create perspective matrix, and I wonder whether I should add those to GL.Algebra (functions/procedures use Matrix4 and Vector3) or whether to add them to a new package that uses GL.Types.singles.Matrix4, etc. (Basically only allowing Singles and Doubles in that case) What do you recommend?

flyx commented 9 years ago

Moved to Nim?

Yes. Moreover, I haven't done much graphics programming for some time.

I just started learning GLSL and OpenGL >= 3.2, so I prefer if you could just give me some pointers/guidance now and then and comment in pull requests if I do something obviously wrong :smile:

Okay.

Btw, is there a particular use-case for doing matrix manipulations with types other than Singles/Doubles?

Quoting the OpenGL Wiki:

All matrix types are floating-point, either single-precision or double-precision.

So while there may be use-cases for having matrix operations for integer types, they are probably not linked to OpenGL. On the other hand, I don't think it would be wrong to have them in GL.Algebra, since nobody complains about superfluous functionality. Also, you want these operations to be primary operations of the matrix types, so you basically need to put them there.

flyx commented 9 years ago

Correction: Matrix operations should be defined in GL.Matrices, which is used in GL.Algebra.