diff options
Diffstat (limited to 'src/x11/ffi.rs')
-rw-r--r-- | src/x11/ffi.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/x11/ffi.rs b/src/x11/ffi.rs index a31b9c2..d127a27 100644 --- a/src/x11/ffi.rs +++ b/src/x11/ffi.rs @@ -13,7 +13,7 @@ pub type Drawable = XID; // TODO: not sure pub type GLXContext = *const (); pub type GLXContextID = XID; pub type GLXDrawable = XID; -pub type GLXFBConfig = (); +pub type GLXFBConfig = *const (); pub type GLXPbuffer = XID; pub type GLXPixmap = XID; pub type GLXWindow = XID; @@ -204,6 +204,15 @@ pub static GLX_PBUFFER: libc::c_int = 0x8023; pub static GLX_PBUFFER_HEIGHT: libc::c_int = 0x8040; pub static GLX_PBUFFER_WIDTH: libc::c_int = 0x8041; +pub static GLX_CONTEXT_MAJOR_VERSION: libc::c_int = 0x2091; +pub static GLX_CONTEXT_MINOR_VERSION: libc::c_int = 0x2092; +pub static GLX_CONTEXT_FLAGS: libc::c_int = 0x2094; +pub static GLX_CONTEXT_PROFILE_MASK: libc::c_int = 0x9126; +pub static GLX_CONTEXT_DEBUG_BIT: libc::c_int = 0x0001; +pub static GLX_CONTEXT_FORWARD_COMPATIBLE_BIT: libc::c_int = 0x0002; +pub static GLX_CONTEXT_CORE_PROFILE_BIT: libc::c_int = 0x00000001; +pub static GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT: libc::c_int = 0x00000002; + pub static XIMPreeditArea: libc::c_long = 0x0001; pub static XIMPreeditCallbacks: libc::c_long = 0x0002; pub static XIMPreeditPosition: libc::c_long = 0x0004; @@ -1348,6 +1357,7 @@ extern "C" { pub fn XDestroyWindow(display: *mut Display, w: Window); pub fn XFilterEvent(event: *mut XEvent, w: Window) -> Bool; pub fn XFlush(display: *mut Display); + pub fn XFree(data: *const libc::c_void); pub fn XGetGeometry(display: *mut Display, d: Drawable, root_return: *mut Window, x_return: *mut libc::c_int, y_return: *mut libc::c_int, width_return: *mut libc::c_uint, height_return: *mut libc::c_uint, @@ -1384,12 +1394,15 @@ extern "C" { pub fn glXCreateContext(dpy: *mut Display, vis: *const XVisualInfo, shareList: GLXContext, direct: Bool) -> GLXContext; + pub fn glXCreateNewContext(dpy: *mut Display, config: GLXFBConfig, render_type: libc::c_int, + shareList: GLXContext, direct: Bool) -> GLXContext; pub fn glXDestroyContext(dpy: *mut Display, ctx: GLXContext); pub fn glXChooseFBConfig(dpy: *mut Display, screen: libc::c_int, - attrib_list: *const libc::c_int, nelements: *mut libc::c_int); + attrib_list: *const libc::c_int, nelements: *mut libc::c_int) -> *mut GLXFBConfig; pub fn glXChooseVisual(dpy: *mut Display, screen: libc::c_int, attribList: *const libc::c_int) -> *const XVisualInfo; pub fn glXGetProcAddress(procName: *const libc::c_uchar) -> *const (); + pub fn glXGetVisualFromFBConfig(dpy: *mut Display, config: GLXFBConfig) -> *mut XVisualInfo; pub fn glXMakeCurrent(dpy: *mut Display, drawable: GLXDrawable, ctx: GLXContext) -> Bool; pub fn glXSwapBuffers(dpy: *mut Display, drawable: GLXDrawable); @@ -1398,7 +1411,6 @@ extern "C" { /* GLXFBConfig *glXGetFBConfigs (Display *dpy, int screen, int *nelements); int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value); -XVisualInfo *glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config); GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); void glXDestroyWindow (Display *dpy, GLXWindow win); GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); |