Skip to content

Instantly share code, notes, and snippets.

@kosmolot
Last active June 19, 2017 19:31
Show Gist options
  • Save kosmolot/6cb4cb282c234f9aca638d4dab4d46a9 to your computer and use it in GitHub Desktop.
Save kosmolot/6cb4cb282c234f9aca638d4dab4d46a9 to your computer and use it in GitHub Desktop.
Vala GLEW binding and EXTFramebufferObject binding
/**
* (GLenum => uint32, GLubyte => uint8, GLboolean => uchar, GLint => int32, GLuint => uint32, GLsizei => int32)
*/
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename="GL/glew.h")]
namespace EXTFramebufferObject {
public uchar glIsRenderbufferEXT (uint32 renderbuffer);
public void glBindRenderbufferEXT (uint32 target, uint32 renderbuffer);
public void glDeleteRenderbuffersEXT (int32 n, uint32 *renderbuffers);
public void glGenRenderbuffersEXT (int32 n, uint32 *renderbuffers);
public void glRenderbufferStorageEXT (uint32 target, uint32 internalformat, int32 width, int32 height);
public void glGetRenderbufferParameterivEXT (uint32 target, uint32 pname, int32 *params);
public uchar glIsFramebufferEXT (uint32 framebuffer);
public void glBindFramebufferEXT (uint32 target, uint32 framebuffer);
public void glDeleteFramebuffersEXT (int32 n, uint32 *framebuffers);
public void glGenFramebuffersEXT (int32 n, uint32 *framebuffers);
public uint32 glCheckFramebufferStatusEXT (uint32 target);
public void glFramebufferTexture1DEXT (uint32 target, uint32 attachment, uint32 textarget, uint32 texture, int32 level);
public void glFramebufferTexture2DEXT (uint32 target, uint32 attachment, uint32 textarget, uint32 texture, int32 level);
public void glFramebufferTexture3DEXT (uint32 target, uint32 attachment, uint32 textarget, uint32 texture, int32 level, int32 zoffset);
public void glFramebufferRenderbufferEXT (uint32 target, uint32 attachment, uint32 renderbuffertarget, uint32 renderbuffer);
public void glGetFramebufferAttachmentParameterivEXT (uint32 target, uint32 attachment, uint32 pname, int32 *params);
public void glGenerateMipmapEXT (uint32 target);
}
/**
* This VAPI is based on GLEW 2.0
* (GLenum => uint, GLubyte => uint8, GLboolean => uchar)
*/
[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename="GL/glew.h")]
namespace GLEW {
public uint glewInit ();
public uchar glewIsSupported (char *name);
public uchar glewExperimental;
public uchar glewGetExtension (char *name);
public uint8 *glewGetErrorString (uint error);
public uint8 *glewGetString (uint name);
/* ===== START GLEW_MX ===== */
[SimpleType]
public struct GLEWContext {}
public uint8 glewContextInit (GLEWContext *ctx);
public uchar glewContextIsSupported (GLEWContext *ctx, char *name);
/* ===== END GLEW_MX ===== */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment